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, create a custom Widget Constructor for each of them and recreate the widget every time users switch the language.
Unsupported languages
The library only supports the predefined languages listed in the table above. It is not possible to add support for a completely new language or a custom locale that is not already included in the library.
If you specify an unsupported locale in the Widget Constructor, the chart falls back to English and logs a console warning: locale isn't supported.
Custom translations
If you want to provide custom translations for specific UI strings,
use the custom_translate_function property of the Widget Constructor.
Note that a list of all internal UI strings cannot be provided.
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.