Description

This function retrieves a user's locale ID tag.


We strongly recommend that you use the following UAPI function instead of this function:


Examples 




https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Locale&cpanel_jsonapi_func=get_user_locale



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve locale ID tag for "user."
$get_locale_tag = $cpanel->api2(
    'Locale', 'get_user_locale'
	
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve locale ID tag for "user."
my $get_locale_tag = $cpliveapi->api2(
	'Locale', 'get_user_locale',

  );

 




cpapi2 --user=username Locale get_user_locale



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "get_user_locale",
    "data": [
      {
        "locale": "en"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Locale"
  }
}



Parameters

This function does not accept parameters.

 

Returns

ReturnTypeDescriptionPossible valuesExample
localestring

The authenticated user's locale ID tag.

 

The ISO code for any locale on the server.en
reasonstring

A reason for failure.

This function only returns a reason value if there was an error. 


A string that describes the error.This is an error message.
resultBoolean

Whether the function succeeded.

 

  • 1 — The function succeeded.
  • 0 — The function failed.
1