Skip to content

Locales

amCharts 5 comes with a set of locales. This pages shows how to load and use them.

Locale brings in various region-specific settings, such as text prompt translations, date and number formats, etc.

Each locale is located in a separate file in locales folder. The file name comprises the syntax of language code (lowercase) + region code (uppercase). E.g. to load U.S. English, we would use file en_US.

import am5locales_en_US from "@amcharts/amcharts5/locales/en_US";

To apply the locale to the chart, simply set locale property of the root element:

root.locale = am5locales_en_US;

Please refer to our “Creating translations” tutorial for more info.

It’s possible to force charts to use specific time zone when displaying time/date. For more information visit “Root element: Time zone” tutorial.

Normally, the locale we are using will determine which week day is considered start of the week.

If we want to override it, we can do so by modifying firstDayOfWeek value in the locale:

// Start the week on Sunday
root.locale.firstDayOfWeek = 0;

For RTL options, check out “Right-to-left support” tutorial.

Country names on map charts can automatically be translated to a selection of languages. Please refer to “Map translations” tutorial.