Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Retrieve a List of Available Languages — getlanglist

This function retrieves a list of the languages available on your server.

Calling Functions

Using the XML API

To use the XML API to perform the getlanglist function from within your custom script:

  • Append the /xml-api/getlanglist function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/getlanglist

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the getlanglist function from within your custom script:

  • Append the /json-api/getlanglist function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/getlanglist

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

None

Output

Show Hide

  • getlanglist — Root-level XML tag for the output of the getlanglist function.
    • lang (string) — An available language.
      • Example: french
    • themes (string) — Container for the list of themes available.
      • name (string) — A theme available on your server.
        • Example: x3
      • $charset (boolean) — Character sets, associated by language, available within certain themes. The number of character sets will vary per theme, depending on what is available on your server. Example:
        <arabic>1</arabic>
        • 1 — This character set is available with the current theme.
        • 0 — This value is never displayed, as the language will never be displayed in the output.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/getlanglist in WebHost Manager will produce output similar to:

<getlanglist>
        <lang>arabic</lang>
        <lang>bengali</lang>
        <lang>chinese</lang>
        <lang>english</lang>
        <lang>english-utf8</lang>
        <lang>french</lang>
        <lang>french-utf8</lang>
        <lang>german</lang>
        <lang>german-utf8</lang>
        <lang>hindi</lang>
        <lang>japanese</lang>
        <lang>portuguese</lang>
        <lang>portuguese-utf8</lang>
        <lang>russian</lang>
        <lang>spanish</lang>
        <lang>spanish-utf8</lang>
        <themes>
                  <name>x</name>
                  <english>1</english>
        </themes>
        <themes>
                  <name>x3</name>
                  <arabic>1</arabic>
                  <bengali>1</bengali>
                  <chinese>1</chinese>
        </themes>
</getlanglist>

JSON API

Show Hide

Calling https://example.com:2087/json-api/getlanglist in WebHost Manager will produce output similar to:

{
   "lang":[
      "arabic",
      "bengali",
      "brazilian-portuguese-utf8",
      "chinese",
      "chinese_ibm500",
      "dutch-utf8",
      "eng_root",
      "eng_x3",
      "english",
      "english-utf8",
      "engmonsoon",
      "french",
      "french-utf8",
      "german",
      "german-utf8",
      "hindi",
      "japanese",
      "portuguese",
      "portuguese-utf8",
      "russian",
      "span2",
      "spanish",
      "spanish-utf8"
   ],
   "themes":{
      "x3":{
         "chinese_ibm500":1,
         "spanish":1,
         "bengali":1,
         "japanese":1,
         "english":1,
         "russian":1,
         "french-utf8":1,
         "eng_root":1,
         "eng_x3":1,
         "arabic":1,
         "spanish-utf8":1,
         "portuguese":1,
         "german":1,
         "portuguese-utf8":1,
         "hindi":1,
         "chinese":1,
         "german-utf8":1,
         "french":1,
         "english-utf8":1,
         "span2":1
      },
      "x":{
         "eng_root":1,
         "engmonsoon":1,
         "english":1
      },
      "x3mail":{
         "chinese_ibm500":1,
         "spanish":1,
         "bengali":1,
         "japanese":1,
         "english":1,
         "russian":1,
         "french-utf8":1,
         "eng_root":1,
         "arabic":1,
         "spanish-utf8":1,
         "portuguese":1,
         "german":1,
         "portuguese-utf8":1,
         "hindi":1,
         "chinese":1,
         "german-utf8":1,
         "french":1,
         "english-utf8":1,
         "span2":1
      }
   }
}

Topic revision: r2 - 29 Sep 2009 - 18:33:12 - MelanieSeibert