Class: Language

Language

CompactChart supports language translation. Each phrase that is seen or heard in the UI is assigned a code which is used to look up the appropriate translation. The phrases and their assigned numeric codes appear in the js/modules/language.js file. Should a new phrase be added, in order to support language translation, that phrase would need to be added to this file and assigned a unique code. In the js/modules/languages folder there are a few modules supporting translation of these codes into English, French, Spanish, Hindi, Arabic, and Japanese. More languages may be added simply by creating a copy of an existing language file, renaming it to the desired locale, and changing the translations in the file. To provide support for a language, include its locale in the languages section of the configuration LanguageConfig.

Since:
  • 9.4.0

Type Definitions


LanguageConfig

Languages supported. Note the key for the locale code uses an underscore, while the name of the translation file uses a dash.

Type:
Since:
  • 9.4.0

Example

Sample language configuration:

languages: {
	en_US: {
		modulePath: "./modules/languages/en-US.js"
	},
	es_MX: {
		modulePath: "./modules/languages/es-MX.js"
	},
	fr_FR: {
		modulePath: "./modules/languages/fr-FR.js"
	}
}

SingleLanguageConfig

Configure specific language. Note the key for the locale code uses an underscore, while the name of the translation file uses a dash.

Type:
Since:
  • 9.4.0