fbpx
Skip to content
Questions & AnswersCategory: QuestionsHard-coded Text Library
Benjamin asked 8 years ago
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.
Benjamin replied 8 years ago

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”);
}
}

Benjamin replied 8 years ago

NB, code for April must be replaced with jQuery(‘a,time’).replaceText(/\bApril\b/ig, “Aprile”);

1 Answers
Dave Hilditch Staff answered 8 years ago

Someone has done one in German. Posting these up is a great idea. If anyone else has implemented any other translations I’m sure other customers would appreciate your efforts.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.