This module manages language handling
- Source:
Requires
- module:jHammer
Methods
-
init()
-
Initializes class. Sets data-lang attribute of
- Source:
Fires:
- event:loadLanguageFile()
-
assignListeners()
-
Assigns listeners to events used in this class.
- Source:
Listens to Events:
- event:EVENT_ADMIN_GOT_MANIFEST
- event:EVENT_LANGUAGE_RESET
- event:EVENT_PRSONAS_MESSAGE_STATUS
- event:EVENT_APPLY_LANGUAGE
- event:EVENT_TEMPLATE_LOADED
- event:langBtn
-
getProjectId()
-
Returns the project ID. First trying the commandline then falling back to project JSON prsonas.projectId
- Source:
Returns:
Returns the project ID
- Type
- String
-
initLanguages()
-
Initializes languages
- Source:
Fires:
- event:resetLanguage()
-
resetLanguage()
-
Resets the language to defaults.
- Source:
Fires:
- onSetLanguage() jConfig.document.languageevent:
-
loadLanguageFile()
-
Loads language file content/json/langCopy.json
- Source:
Fires:
- jConfig.document.event:startEvent
-
initLanguageUX()
-
Loads language file content/json/langCopy.json
- Source:
Fires:
- jConfig.document.event:startEvent
-
doPersistentLangAnim()
-
Animates the rotation of the persistent language panel
- Source:
-
doLangPageAnim()
-
Animates the rotation of the language page
- Source:
-
applyCurrentLanguage()
-
Applies the current language based on $("body").attr("data-lang");
- Source:
-
onModelReady()
-
Called when project.json is loaded
- Source:
Fires:
- event:initIha()
- event:assignListeners()
- event:initMappedIn()
-
onReceivedManifest(manifest)
-
Process manifest data from Prsonas manifest
Parameters:
Name Type Description manifestObject - Source:
-
onLanguageStatus()
-
Applies current language from Prsonas message event EVENT_PRSONAS_MESSAGE_STATUS
- Source:
-
onSetLanguage(langObj)
-
Applies current language from user event EVENT_SET_LANGUAGE
Parameters:
Name Type Description langObjObject Language data
- Source:
Fires:
- event:EVENT_LANGUAGE_SET
-
onPageLoad(eventId, data)
-
Called when a page is loaded
Parameters:
Name Type Description eventIdString Event ID
dataObject Event data
- Source: