Sets the culture and UI culture to a specific culture. Allows overriding of currency and optionally disallows setting the UI culture.
You can also limit the locales that are allowed in order to minimize resource access for locales that aren't implemented at all.
public static void SetUserLocale(string culture, string uiCulture, string currencySymbol, bool setUiCulture, string allowedLocales)
Parameters
culture
2 or 5 letter ietf string code for the Culture to set.
Examples: en-US or en
uiCulture
ietf string code for UiCulture to set
currencySymbol
Override the currency symbol on the culture
setUiCulture
if uiCulture is not set but setUiCulture is true
it's set to the same as main culture
allowedLocales
Names of 2 or 5 letter ietf locale codes you want to allow
separated by commas. If two letter codes are used any
specific version (ie. en-US, en-GB for en) are accepted.
Any other locales revert to the machine's default locale.
Useful reducing overhead in looking up resource sets that
don't exist and using unsupported culture settings .
Example: de,fr,it,en-US
See also:
Class WebUtils© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic