Skip to content
kerrishotts edited this page Nov 12, 2012 · 2 revisions

(part of PKLOC)

ASYNC

Return Type: void

Parameters: theLocales ( array ), completion ( function )

Loads one or more culture libraries from the framework/cultures directory based on the list of locales passed in. When all have been loaded, the completion function is called.

For example:

function localesLoaded()
{
    // locales are loaded. We can do things like this now:
    console.log ( __D() );
}

function loadLocales()
{
    // the library is now loaded, load our locales
    PKLOC.loadLocales ( ["en-US", "es-US", "es-MX", "es-ES"], localesLoaded );
}

PKLOC.initializeGlobalization ( loadLocales );

Notes

  • The __T method can be used without having locales loaded. Any method dealing with numbers, dates, or currency, however, relies upon the library being loaded and having cultures defined for the locales in use.
  • The locale must exist in the framework/cultures directory and be named as globalize.culture.the-Locale.js. For example, "en-US" would be named globalize.culture.en-US.js.

Version

0.1 Introduced

0.2 Docs Valid

Clone this wiki locally