Hello, I'm working on translating the hard coded squarespace text into Italian, but it's a side project and moving slowly. Any chance anyone has already done this and has a ready made file (like Dave's original in French)? If not, I will post the full working Italian version when done here.
Here is the Italian I have done so far if anyone wants to employ it on their site. Mostly days and dates and none of the shopping relevant text, which is not used on my site.
function replaceSquarespaceText() {
if (readCookie(‘language’) != ”) {
currentlanguage=readCookie(‘language’);
} else {
currentlanguage = 0;
}
if (currentlanguage == 0) {console.log(‘nothing to translate because language 0 chosen – change to language 1 and this will do something’);
return;
}
if (currentlanguage == 1) {
jQuery(“div.ss-social-button”).filter(
function(index) {
if(jQuery(this).text().indexOf(‘Share’) >= 0 )
return true;
else
return false;
}
).each(function() {
jQuery(this).html(jQuery(this).html().replace(‘Share’, ‘Condividi’));
jQuery(this).html(jQuery(this).html().replace(/First Name/ig, “Nome”));
jQuery(this).html(jQuery(this).html().replace(/Last Name/ig, “Cognome”));
});
jQuery(‘a,time’).replaceText(/January/ig, “Gennaio”);
jQuery(‘a,time’).replaceText(/February/ig, “Febbraio”);
jQuery(‘a,time’).replaceText(/March/ig, “Marzo”);
jQuery(‘a,time’).replaceText(/April/ig, “Aprile”);
jQuery(‘a,time’).replaceText(/May/ig, “Maggio”);
jQuery(‘a,time’).replaceText(/June/ig, “Giugno”);
jQuery(‘a,time’).replaceText(/July/ig, “Luglio”);
jQuery(‘a,time’).replaceText(/August/ig, “Agosto”);
jQuery(‘a,time’).replaceText(/September/ig, “Settembre”);
jQuery(‘a,time’).replaceText(/October/ig, “Ottobre”);
jQuery(‘a,time’).replaceText(/November/ig, “Novembre”);
jQuery(‘a,time’).replaceText(/December/ig, “Dicembre”);
jQuery(‘a,time’).replaceText(/Monday/ig, “Lunedi”);
jQuery(‘a,time’).replaceText(/Tuesday/ig, “Martedì”);
jQuery(‘a,time’).replaceText(/Wednesday/ig, “Mercoledì”);
jQuery(‘a,time’).replaceText(/Thursday/ig, “Giovedi”);
jQuery(‘a,time’).replaceText(/Friday/ig, “Venerdì”);
jQuery(‘a,time’).replaceText(/Saturday/ig, “Sabato”);
jQuery(‘a,time’).replaceText(/Sunday/ig, “Domenica”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/jan/gi, “Gen”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/feb/gi, “Feb”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/mar/gi, “Mar”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/apr/gi, “Apr”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/may/gi, “Mag”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/jun/gi, “Giu”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/jul/gi, “Lug”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/aug/gi, “Ago”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/sep/gi, “Set”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/oct/gi, “Ott”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/nov/gi, “Nov”);
jQuery(‘div.eventlist-datetag-startdate–month’).replaceText(/dec/gi, “Dic”);
jQuery(‘span’).replaceText(/Share/gi, “Condividi”);
}
}
NB, code for April must be replaced with jQuery(‘a,time’).replaceText(/\bApril\b/ig, “Aprile”);