API Docs for:
Show:

LanguageManager Class

Module: gs

Manages the different languages of the game.

Methods

initialize

()

Initializes the language system by loading the necessary language profiles and strings bundles.

loadBundles

()

Loads the necessary strings bundles for the current language.

selectLanguage

(
  • language
)

Sets the specified language as current language.

Parameters:

  • language Object
    • The language to set.

string

(
  • id
)
String

Gets the string for the specified id. If the string doesn't exist for current language, its taken from the default language.

Parameters:

  • id String
    • The ID of the string to get.

Returns:

String:

The string for the specified ID. If the string could not be found the result is an empty string.

stringFromDefault

(
  • id
)
String

Gets the string for the specified id in default language.

Parameters:

  • id String
    • The ID of the string to get.

Returns:

String:

The string for the specified ID. If the string could not be found the result is an empty string.

Properties

bundle

gs.LanguageStringsBundle

The current strings bundle.

defaultBundle

gs.LanguageStringsBundle

The default strings bundle.

defaultProfile

gs.LanguageProfile

The default language profile.

profile

gs.LanguageProfile

The current language profile.