Description


This function retrieves a user's locale's name in that locale's language.


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_name



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Display locale for the user.
$get_locale_name = $cpanel->api2(
    'Locale', 'get_user_locale_name'
	
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Display locale for the user.
my $get_locale_name = $cpliveapi->api2(
	'Locale', 'get_user_locale_name',

  );

 




cpapi2 --user=username Locale get_user_locale_name



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "get_user_locale_name",
    "data": [
      {
        "name": "English"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Locale"
  }
}



Parameters

This function does not accept parameters.

 

Returns

ReturnTypeDescriptionPossible valuesExample
namestring

The authenticated user's locale, in the locale's language.

 

Any available locale.English
reasonstring

A reason for failure.

This function only returns a reasonvalue 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