Map name translations

Maps in amCharts 5 will display names of the countries and other places in English by default. This tutorial will show how you can use bundled translation files to display country names in different languages.

Loading translation files

Translation files are included with the Geodata package, in a sub-directory lang.

Loading those will depend on your development environment:

import am5geodata_lang_ES from "@amcharts/amcharts5-geodata/lang/ES"; 
<script src="https://cdn.amcharts.com/lib/5/geodata/lang/ES.js"></script>

NOTE If you are using <script> tag to load translation data, global variables will be created, e.g. am5geodata_lang_ES. Much like with geodata itself.

Applying translations

To apply translations, simply set geodataNames setting on your map series:

let polygonSeries = chart.series.push(
  am5map.MapPolygonSeries.new(root, {
    geoJSON: am5geodata_worldLow,
    geodataNames: am5geodata_lang_ES
  })
);
var polygonSeries = chart.series.push(
  am5map.MapPolygonSeries.new(root, {
    geoJSON: am5geodata_worldLow,
    geodataNames: am5geodata_lang_ES
  })
);

That's all there is to it. Now the country names, will be shown in the language you loaded, rather than defaults contained in map files.

Available translations

LanguageCode/FilenameGlobal variable
AFRIKAANSAFam5geodata_lang_AF
AMHARICAMam5geodata_lang_AM
ARABICARam5geodata_lang_AR
AZERBAIJANIAZam5geodata_lang_AZ
BELARUSIANBEam5geodata_lang_BE
BULGARIANBGam5geodata_lang_BG
BENGALIBNam5geodata_lang_BN
TIBETAN STANDARDBOam5geodata_lang_BO
CATALANCAam5geodata_lang_CA
CZECHCSam5geodata_lang_CS
WELSHCYam5geodata_lang_CY
DANISHDAam5geodata_lang_DA
GERMANDEam5geodata_lang_DE
EWEEEam5geodata_lang_EE
GREEKELam5geodata_lang_EL
ENGLISHENam5geodata_lang_EN
ESPERANTOEOam5geodata_lang_EO
SPANISHESam5geodata_lang_ES
ESTONIANETam5geodata_lang_ET
BASQUEEUam5geodata_lang_EU
PERSIANFAam5geodata_lang_FA
FINNISHFIam5geodata_lang_FI
FAROESEFOam5geodata_lang_FO
FRENCHFRam5geodata_lang_FR
IRISHGAam5geodata_lang_GA
GALICIANGLam5geodata_lang_GL
GUJARATIGUam5geodata_lang_GU
HEBREWHEam5geodata_lang_HE
HINDIHIam5geodata_lang_HI
CROATIANHRam5geodata_lang_HR
HUNGARIANHUam5geodata_lang_HU
ARMENIANHYam5geodata_lang_HY
INTERLINGUAIAam5geodata_lang_IA
INDONESIANIDam5geodata_lang_ID
ICELANDICISam5geodata_lang_IS
ITALIANITam5geodata_lang_IT
JAPANESEJAam5geodata_lang_JA
GEORGIANKAam5geodata_lang_KA
KIKUYUKIam5geodata_lang_KI
KHMERKMam5geodata_lang_KM
KANNADAKNam5geodata_lang_KN
KOREANKOam5geodata_lang_KO
GANDALGam5geodata_lang_LG
LAOLOam5geodata_lang_LO
LITHUANIANLTam5geodata_lang_LT
LATVIANLVam5geodata_lang_LV
MACEDONIANMKam5geodata_lang_MK
MALAYALAMMLam5geodata_lang_ML
MARATHIMRam5geodata_lang_MR
MALAYMSam5geodata_lang_MS
MALTESEMTam5geodata_lang_MT
BURMESEMYam5geodata_lang_MY
NORWEGIAN BOKMALNBam5geodata_lang_NB
NEPALINEam5geodata_lang_NE
DUTCHNLam5geodata_lang_NL
NORWEGIAN NYNORSKNNam5geodata_lang_NN
NORWEGIANNOam5geodata_lang_NO
ORIYAORam5geodata_lang_OR
POLISHPLam5geodata_lang_PL
PORTUGUESEPTam5geodata_lang_PT
ROMANSHRMam5geodata_lang_RM
ROMANIANROam5geodata_lang_RO
RUSSIANRUam5geodata_lang_RU
NORTHERN SAMISEam5geodata_lang_SE
SLOVAKSKam5geodata_lang_SK
SLOVENESLam5geodata_lang_SL
SHONASNam5geodata_lang_SN
ALBANIANSQam5geodata_lang_SQ
SERBIANSRam5geodata_lang_SR
SWEDISHSVam5geodata_lang_SV
TAMILTAam5geodata_lang_TA
TELUGUTEam5geodata_lang_TE
THAITHam5geodata_lang_TH
TIGRINYATIam5geodata_lang_TI
TAGALOGTLam5geodata_lang_TL
TURKISHTRam5geodata_lang_TR
UKRAINIANUKam5geodata_lang_UK
URDUURam5geodata_lang_UR
VIETNAMESEVIam5geodata_lang_VI
CHINESE SIMPLIFIEDcn_ZHam5geodata_lang_cn_ZH
CHINESE TRADITIONALtw_ZHam5geodata_lang_tw_ZH

Example

See the Pen amChrts 5: Translating country names by amCharts team (@amcharts) on CodePen.

Credits

The translations included in geodata language package is made from IP2Location™ Country Multilingual Database which available from https://www.ip2location.com.