Jump to content

Translating using Java

Go to solution Solved by tuanphan,

Recommended Posts

Posted (edited)

Hello everyone,


Is there a way for me to translate some pieces of text on my shop ? I have a bilingual website built thanks to BradGood's guide.

On this product : https://gregoirepansu.com/fr/tirages-dart/p/eclaircie-au-cur-de-lorage you can see that, even though it is in the french version of the website, it still says "size" "select size" "frame" "select frame". 


Is there a way to target and translate those for all the products, but using Java ? So that I can insert the code in the Javascript language loop, which will allow it to only work on the french products (If lang=fr ... etc).



Thank you so much ! 

Edited by Greg_pns
Link to comment
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

21 hours ago, tuanphan said:


I don't see text on this product. Can you check it again?




I worked on my url mapping recently and changed the URLs, so that's why the link doesn't work anymore.


Here is a correct one : https://gregoirepansu.com/fr/tirages-art/p/reflets-dor


I managed to translate some stuff, but for other words I just can't find a solution...


Thank you so much ! 


Link to comment
  • Solution

Add to Last Line in Code Injection > Footer

    $(".variant-option-title").html(function() { 
          return $(this).html().replace("Size:", "new size");  
      $(".variant-option-title").html(function() { 
          return $(this).html().replace("Frame:", "new frame");  


Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.