-
Notifications
You must be signed in to change notification settings - Fork 29
PKLOC.currentUserLocale
kerrishotts edited this page Nov 12, 2012
·
1 revision
(part of PKLOC)
Type: string
Default: empty string
Stores the locale as calculated by PKLOC.getUserLocale. The value is calculated only if this value is empty. This is to help improve efficiency as the localization functions may be called quite often.
If overridden with a blank, the next localization function will force a recalculation of the locale. If overridden with a valid locale, the next localization function will use the overridden locale instead, which makes it useful when testing locales.
For example:
PKLOC.currentUserLocale;
// returns ""
PKLOC.getUserLocale();
// returns "en-US"
PKLOC.currentUserLocale;
// returns "en-US"
PKLOC.currentUserLocale = "";
PKLOC.getUserLocale();
PKLOC.currentUserLocale;
// returns "en-US"
PKLOC.currentUserLocale = "es-ES";
PKLOC.getUserLoale();
// returns "es-ES"
Never reference this value directly when attempting to discern the user's locale. Always use PKLOC.getUserLocale()
instead as this value may not have yet been initialized.
0.1 Introduced
0.2 Docs Valid