A low level API is provided to manage the current locale. This will only be required for special purposes, such as custom authentication.
The id of the current locale, for example
Set the locale for the current session using a locale ID. An exception will be thrown if the locale is not known.
The change in locale may not take effect until the next request is handled. You should respond with a redirect to any request which calls this function to make sure all response handling uses a consistent locale when rendering the HTML response.
This change is not persistent for the logged in user.