Localization
Set up language
To set up a default language, specify the locale
property in the Widget Constructor.
Check out the Widget Constructor tutorial on YouTube for an implementation example.
Supported languages
The languages that the library supports are listed below.
Language | locale value |
---|---|
Arabic | ar |
Catalan (Spain) | ca_ES |
Chinese (Taiwan) | zh_TW |
Chinese | zh |
English | en |
French | fr |
German (Germany) | de |
Hebrew (Israel) | he_IL |
Indonesian (Indonesia) | id_ID |
Italian | it |
Japanese | ja |
Korean | ko |
Malay (Malaysia) | ms_MY |
Polish | pl |
Portuguese | pt |
Russian | ru |
Spanish | es |
Swedish | sv |
Thai (Thailand) | th |
Turkish | tr |
Vietnamese | vi |
Multiple languages
To support several languages, you need to create a custom Widget Constructor for each of them and recreate the widget every time users switch the language.
Unsupported locale
If an unsupported locale is specified in the Widget Constructor, the chart falls back to English with a console warning locale isn't supported.
Custom translations
If you want to provide custom translations for UI strings,
use the custom_translate_function
property of the Widget Constructor.
Right-to-left alignment
The library supports right-to-left (RTL) alignment for RTL languages such as Arabic and Hebrew. Note that the alignment affects only toolbars, dialogs, and other UI elements except the chart.