fbpx
Skip to content
Questions & AnswersCategory: QuestionsCan't translate some hard-coded words
Benoit asked 5 years ago
I can't seem to find how to translate some of the hard-coded words on my site:
  • Cart (top menu)
  • Quick-view (on home page and products page)
  • Adding and Added (when a product is added to the cart)
  • Checkout (button on cart page)
  • Previous / Next (on a product's page)
  • Sold out (on products page)
Any idea how to do this? Here's the site: https://benoit-hebert-3w2p.squarespace.com/
3 Answers
johnite Staff answered 5 years ago

Hi Benoit,
Thanks for your custom.
The below listed solution should help you out. 

If there is any other issues, let us know and we will fix them.
Regards
John

Translating the hard-coded text in Squarespace
If you are using Shopify, you get access to the underlying theme files to edit the translations and can use the Multilingualizer formatting to make these pieces of text bilingual/multilingual.
With Squarespace templates, you *can* get access to these files as a developer but it’s non-trivial. There are hard-coded pieces of text such as error-messages on forms, placeholders for search boxes, form titles etc.
To translate these pieces of text, please add the Squarespace Extensions file to your footer. You can find the extensions file here:
https://www.multilingualizer.com/mlcode/squarespace.extension.english.french.txt
Note: The above extensions file includes translations for most Squarespace templates from English to French. For other languages, you will need to modify the translations yourself. If you are using English and French, you can just paste the code above into your footer (below any other scripts you may already have).
Finally – you can extend the hard-coded translations script yourself if you find your theme has extra pieces of english-only text we’ve missed.
In the Squarespace extensions script, on the line following the last line which begins like this:

jQuery('*').replaceText(.......)

Add a line like the following:

jQuery('*').replaceText(escapeRegExp("Enter hardcoded text to translate here"), "Enter translation here");

You can repeat as necessary for any other pieces of hard-coded text that are missing from your specific theme.

Benoit replied 5 years ago

hey, thanks for your answer but I have already injected that code in my footer and it did work for most of the hard-coded words on my site. It does not work however for the words that I mentioned in my original question. can you please that a look at this?

johnite Staff answered 5 years ago

Hi Benoit – If you put for example …. Cart .. Chariot …. in the field where you name the page this should work – if there is any difficulty – email me directly and I will set up a demo on your site for you.
Regards
John

kakansundberg replied 4 years ago

Hi John!
I’ve the same issue as Benoit with those words. How did you solve it? Best Karin

Natasa answered 5 years ago

Hello! I’m new here 🙂 
And have similar question but for SHOPIFY.
You said ‘If you are using Shopify, you get access to the underlying theme files to edit the translations and can use the Multilingualizer formatting to make these pieces of text bilingual/multilingual.
But how? Any step-by-step somewhere?
Thank you!

Natasa replied 5 years ago

.

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.