Hi florianmarianna,
probably the easiest way to achieve what you need would be creating variable for each subdivisions inside the javascript file of the map accordingly to the language used :
1. Get lang attribute of HTML tag using document.documentElement.lang
2. Create a variable each subdivisions with translations
3. Change default subdivisions name in the json series ( just search for subdivisions’ names and replace them with corresponding variable )
So, basically, at top of the javascript map file (it starts with “jquery-jvectormap-” suffix ) add something like following before “jQuery.fn.vectorMap…” :
var getWpLang = document.documentElement.lang;
if( getWpLang.length ) {
if( getWpLang == 'it-IT' ) {
var italy_var = "Italia";
var germany_var = "Germania";
//other subdivisions...
}
else if ( getWpLang == 'de-DE' ){
var italy_var = "Italien";
var germany_var = "Deutschland";
//other subdivisions...
}
else {//english default
var italy_var = "Italy";
var germany_var = "Germany";
//other subdivisions...
}
}
else {//english default in case no lang attribute is retrieved
var italy_var = "Italy";
var germany_var = "Germany";
//other subdivisions...
}
In this case I’m using the world map. now search for “Italy” subdivions and replace it with ts corresponding variable italy_var, do the same for Deutchland with germany_var and so on for all the other subdivions.
Just let me know if it make sense.
Thank you for using RVM.