Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - Locale::list_locales - Developer Documentation - cPanel Documentation
Child pages
  • UAPI Functions - Locale::list_locales
Skip to end of metadata
Go to start of metadata

Description

This function lists an account's available interface languages.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess###########/execute/Locale/list_locales


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List all locales for the account.
$list_locales = $cpanel->uapi(
    'Locale', 'list_locales', 
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List all locales for the account.
my $set_locale = $cpliveapi->uapi(
    'Locale', 'list_locales',
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username Locale list_locales


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "status":1,
   "metadata":{  
	 "transformed": 1
   },
   "warnings":null,
   "messages":null,
   "data":[  
      {  
         "local_name":"polski",
         "locale":"pl",
         "name":"Polish",
         "direction":"ltr"
      },
      {  
         "name":"Dutch",
         "direction":"ltr",
         "local_name":"Nederlands",
         "locale":"nl"
      },
      {  
         "name":"Brazilian Portuguese",
         "direction":"ltr",
         "local_name":"português do Brasil",
         "locale":"pt_br"
      },
      {  
         "locale":"es_419",
         "local_name":"español latinoamericano",
         "name":"Latin American Spanish",
         "direction":"ltr"
      },
      {  
         "local_name":"magyar",
         "locale":"hu",
         "name":"Hungarian",
         "direction":"ltr"
      },
      {  
         "local_name":"i_en",
         "locale":"i_en",
         "name":"i_en",
         "direction":"rtl"
      },
      {  
         "locale":"es",
         "local_name":"español",
         "direction":"ltr",
         "name":"Spanish"
      },
      {  
         "direction":"ltr",
         "name":"Turkish",
         "local_name":"Türkçe",
         "locale":"tr"
      },
      {  
         "direction":"ltr",
         "name":"Bulgarian",
         "local_name":"български",
         "locale":"bg"
      },
      {  
         "local_name":"čeština",
         "locale":"cs",
         "name":"Czech",
         "direction":"ltr"
      },
      {  
         "name":"i_cpanel_snowmen",
         "direction":"ltr",
         "locale":"i_cpanel_snowmen",
         "local_name":"i_cpanel_snowmen"
      },
      {  
         "local_name":"Norwegian",
         "locale":"no",
         "direction":"ltr",
         "name":"Norwegian"
      },
      {  
         "locale":"sl",
         "local_name":"slovenščina",
         "direction":"ltr",
         "name":"Slovenian"
      },
      {  
         "locale":"id",
         "local_name":"Bahasa Indonesia",
         "direction":"ltr",
         "name":"Indonesian"
      },
      {  
         "locale":"th",
         "local_name":"ไทย",
         "name":"Thai",
         "direction":"ltr"
      },
      {  
         "direction":"ltr",
         "name":"Danish",
         "locale":"da",
         "local_name":"dansk"
      },
      {  
         "direction":"ltr",
         "name":"Finnish",
         "locale":"fi",
         "local_name":"suomi"
      },
      {  
         "locale":"ar",
         "local_name":"العربية",
         "name":"Arabic",
         "direction":"rtl"
      },
      {  
         "direction":"ltr",
         "name":"French",
         "locale":"fr",
         "local_name":"français"
      },
      {  
         "direction":"ltr",
         "name":"Korean",
         "local_name":"한국어",
         "locale":"ko"
      },
      {  
         "locale":"nb",
         "local_name":"norsk bokmål",
         "name":"Norwegian Bokmål",
         "direction":"ltr"
      },
      {  
         "local_name":"English",
         "locale":"en",
         "name":"English",
         "direction":"ltr"
      },
      {  
         "locale":"ro",
         "local_name":"română",
         "name":"Romanian",
         "direction":"ltr"
      },
      {  
         "name":"Japanese",
         "direction":"ltr",
         "local_name":"日本語",
         "locale":"ja"
      },
      {  
         "direction":"ltr",
         "name":"Chinese (Taiwan)",
         "local_name":"中文(台湾)",
         "locale":"zh_tw"
      },
      {  
         "local_name":"русский",
         "locale":"ru",
         "name":"Russian",
         "direction":"ltr"
      },
      {  
         "locale":"pt",
         "local_name":"português",
         "name":"Portuguese",
         "direction":"ltr"
      },
      {  
         "name":"Hebrew",
         "direction":"rtl",
         "locale":"he",
         "local_name":"עברית"
      },
      {  
         "direction":"ltr",
         "name":"Iberian Spanish",
         "local_name":"español de España",
         "locale":"es_es"
      },
      {  
         "direction":"ltr",
         "name":"Chinese",
         "local_name":"中文",
         "locale":"zh"
      },
      {  
         "locale":"de",
         "local_name":"Deutsch",
         "direction":"ltr",
         "name":"German"
      },
      {  
         "direction":"ltr",
         "name":"Greek",
         "local_name":"Ελληνικά",
         "locale":"el"
      },
      {  
         "local_name":"svenska",
         "locale":"sv",
         "direction":"ltr",
         "name":"Swedish"
      },
      {  
         "direction":"ltr",
         "name":"Malay",
         "locale":"ms",
         "local_name":"Bahasa Melayu"
      },
      {  
         "locale":"it",
         "local_name":"italiano",
         "direction":"ltr",
         "name":"Italian"
      },
      {  
         "direction":"ltr",
         "name":"Ukrainian",
         "locale":"uk",
         "local_name":"українська"
      },
      {  
         "local_name":"Tiếng Việt",
         "locale":"vi",
         "name":"Vietnamese",
         "direction":"ltr"
      },
      {  
         "locale":"zh_cn",
         "local_name":"中文(中国)",
         "name":"Chinese (China)",
         "direction":"ltr"
      },
      {  
         "locale":"fil",
         "local_name":"Filipino",
         "name":"Filipino",
         "direction":"ltr"
      }
   ],
   "errors":null
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
directionstringThe locale's text direction.
  • ltr — Left to right.
  • rtl — Right to left.
ltr
local_namestringThe locale's full name, in the language.A valid string.Deutsch
localestringThe locale's abbreviated name.A valid two-letter ISO-3166 code.de
namestringThe locale's full name.A valid string.German