Solo Posted November 11, 2015 Posted November 11, 2015 Hi, How can I change the captions adress 1 and Adress 2, City, Zip Code, telephone in forms, I want to change language? thanks
musicaldesigner Posted May 24, 2016 Posted May 24, 2016 @groundcontact Thank you for the code, it works great! I was trying to figure out how to replace and/or remove the captions for addresses as well (Address 1, Address 2, State/Province, Zip/Postal Code, City, Country). It worked fine, except for "State/Province" and "Zip/Postal Code" because the '/' couldn't be typed into your code as is. I'm not a programmer, but after some research I finally figured it out. I'll explain below in case anyone is still trying to figure this out. @Solo. I used three separate functions to remove 'State' , '/' , and 'Province' since they do not use this label in Norway, by replacing them with nothing (""). For '/' I had to insert a \ before it. I believe it is similar in other parts of Europe, where State/Province is not necessary. The code below removes this easily. $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/State/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/\//ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Province/ig, "")); } }); I did the same for Zip/Postal Code by replacing 'Zip' with 'Postnummer' and removing 'Postal Code' separately. The previous function above already removed all the forward slashes in the form '/'. $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Zip/ig, "Postnummer")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Postal Code/ig, "")); } }); Here is @groundcontact's entire code again, with my address labels included within, and a few other modifications: <script type="text/javascript"> function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { if (oldonload) { oldonload(); } func(); }; } } addLoadEvent(function () { // Translate form captions $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/First Name/ig, "Fornavn")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Last Name/ig, "Etternavn")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Address 1/ig, "Adresse 1")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Address 2/ig, "Adresse 2")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/City/ig, "Sted")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/State/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/\//ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Province/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Zip/ig, "Postnummer")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Postal Code/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Country/ig, "Land")); } }); // Translate blog page items $('.pagination').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Newer/ig, "Nyere")); } }); $('.pagination').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Older/ig, "Eldre")); } }); $('.tags-cats').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/tags/ig, "etiketter")); } }); $('.excerpt').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Read More/ig, "Les mer")); } }); $('.sqs-comment-link.sqs-disqus-comment-link').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Comment/ig, "Kommentere")); } }); // Translate dates $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/January/ig, "Januar")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/February/ig, "Februar")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/March/ig, "Mars")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/April/ig, "April")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/May/ig, "Mai")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/June/ig, "Juni")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/July/ig, "Juli")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/August/ig, "August")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/September/ig, "September")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/October/ig, "Oktober")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/November/ig, "November")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/December/ig, "Desember")); } }); // Translate site-wide items $('.back-to-top').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Back to Top/ig, "Tilbake til toppen")); } }); $('.icon-comments').attr('title', 'Kommentarer'); $('.icon-share').attr('title', 'Del'); $('.search-input').attr('placeholder', 'Søke'); }); </script> I also modified the .search-input function because it was not working for me. Instead of 'value placeholder' I just used 'placeholder'.
musicaldesigner Posted May 24, 2016 Posted May 24, 2016 I just used a Number field instead of Phone, since the phone format in Europe is different than the US and Canada (###-###-####). You can change the name for the number field in the form settings.
musicaldesigner Posted May 24, 2016 Posted May 24, 2016 I know this is two years later but I found this worked on blogs when I injected into "POST BLOG ITEM CODE INJECTION": https://answers.squarespace.com/questions/11258/how-to-change-the-date-format.html
webdesignstroobants Posted September 28, 2016 Posted September 28, 2016 Hello groundcontact, I copied the code from your initial post into the designated area but the form captions aren't changing towards the new languages when I'm refreshing my browser. Any idea why? Thanks!
Guest Posted August 15, 2017 Posted August 15, 2017 Hi there, I just tried the above mentioned codes, jut to replace "Last Name" with "Nachname" and "First Name" with "Vorname". I tried different varieties of the code, but nothing worked, it still shows Last Name and First Name. Anybody here who can help me on this? Thanks!
Guest Posted October 12, 2017 Posted October 12, 2017 Hi, I have tried too and unfortunately, this solution is not working for me. Any idea? Is something is not working anymore in 2017 or something we are missing? Thanks!
angama Posted November 17, 2017 Posted November 17, 2017 :-( Tried every solution in this post...not a single worked ("Bedford" template; form within a blog)Any alternatives?
fredericG Posted February 16, 2018 Posted February 16, 2018 Hi @Cragg Your answer is amazing. Wish i could go further. Looking to replace the address parts (i.e. city, zip code, etc) and i'm looking to find the appropriate handle so i can build my own code. I've tried to use the inspector, but i'm no programmer, and this is all chinese to me… Can you help me find what to use instead of (for instance) myFirstname and sqsFirstname?(Hope my question makes sense!)peace out
dugost Posted March 12, 2018 Posted March 12, 2018 @groundcontact I was able to change the captions on my contact form using the code in your original answer (I didn't go the jQuery route) so thank you for that! I went even further by adding some code I found in another forum so I could also change the placeholder appearing in the MailChimp Newsletter block's email address field. The only issue I have now is that the JS only seems to affect the forms on first load or reload. If I return to the page the text doesn't switch to the new wording I specified in the JS. Does anyone know of a way to have the code run each time the page is visited?
paul2009 Posted April 16, 2019 Posted April 16, 2019 The Squarespace code for the newsletter block has changed considerably since this question was originally posted in 2013 and many of the comments were added. You'll find the latest solution (April 2019) for renaming (translating) the name labels here: Translate the Squarespace Newsletter Block -Paul Squarespace Expert & Professional Developer Contributors to this forum voluntarily give their time to help you. If we correctly answer your question, please accept the answer by clicking Accept below it (you'll see it when you're logged on). If an answer doesn't help, feel free to ask for more help or wait for other forum users to add their comments and/or answers. Whenever an accepted answer helps you, please vote it up using the up arrow on the right. This helps other forum users by giving them confidence in an answer. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.