BuycPanel Blog

BuycPanel Blog

Latest news and updates

Quick Steps to Determine the Browser Locale

Posted by Allura on 15 08 2018.


The cPanel and WHM Version11.32 has a new feature that allows the user to select the locale for their session through a localized login page. There are certain factors like the locale query string parameter, the session_locale cookie, the Accept-Language header, etc.  that help in determining the visible locale when one logs into their cPanel, Webmail or WHM account.

The Determining Factors:

The cPanel Service Daemon, better known as cpsrvd service run the following steps when the user logs into their cPanel, Webmail or WHM account for determining which locale to display.

  1. URL stands for Uniform Resource Locator. And as the name suggests, it has a locale query string parameter in it. For example, the cPanel interface will set the locale as Russian for the URL .

The browser will set the session_locale cookie to the same value based on the locale query string parameter if it is present in the URL.

However, two things should be noted, Firstly, the validity of the session_locale cookie is for one year and secondly, the configured locale of the account gets overridden by the session_locale cookie.

  1. Given, there is already the session_locale cookie in the user’s browser, the specified locale is set for the login interface and also for the rest of the user’s session by default.
  2. In case of no locale query string specification in the URL and there is no session_locale cookie active in the browser; the cpsrvd service will review if the user’s browser has sent an Accept-Language header.

The cpsrvd service will use the first valid locale that corresponded to the value of the Accept-Language header, only if the user’s browser had sent an Accept-Language header. It must be noted, the Accept-Language header is not always active for all browsers.

  1. For a situation where none of the above-mentioned parameters has been configured by the user, the selected locale in the Server Locale option of the WHM’s Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings) will be used by the login system. The cPanel and WHM account holders should note that the setting is stored as the service_locale variable in the /var/cpanel/cpanel.config file by the cPanel and WHM stores.


A Concluding Note:

For a browser and system set-up that does not align with any of the above-mentioned conditions, the login system will opt for the default locale which is the U.S. English locale.