Translation app skips text on my store

Solved
Highlighted
Tourist
9 1 1

Hey guys!

So my store needs to be bilingual for legal reasons, and I'm using a free app that lets me manually translate everything. However, I had to add a notice at checkout and my translation app keeps skipping it. I reached out to the app people and they said that it only imports whatever is considered translatable by Shopify, which is the following fields and resource types: https://support.hextom.com/hc/en-us/articles/360050409854-Can-I-translate-tags-vendors-product-types...

I know enough liquid/html/css to be able to make most of the changes I want to my store, but I'm not quite sure what they mean. Does anyone know what syntax/tags I should use to add a simple line of text to my cart and a placeholder to my product page so that I'm sure that the translation app is able to import them?

0 Likes
Highlighted
Tourist
9 1 1

This is an accepted solution.

If anyone else is having the same issue, I've found what I was looking for! All you have to do is change your default.json file and call that piece of text in your liquid code.

For example, let's say you want to display a translatable custom notice in your cart and your code is:

 

<div class="custom-notice">{{ 'My custom notice text goes here' }}</div>

 

What you want to do is replace it with the following:

 

<div class="custom-notice">{{ 'cart.general.custom_notice' | t }}</div>

 

Then go to the "Locales" section in your code editor, open your default.json (in my case en.default.json since my default language is English) and add whatever you need to add. In our example, you'd need to find the "cart" section, then under "cart" find "general", and then add a new "custom_notice" section under that one. It should look something like this:

 

  "cart": {
    "general": {
      "custom_notice": "My custom notice text goes here."
    },

 

Just make sure you use the exact same syntax as the other entries, and voilà! Your translation app will be able to import your custom text!

0 Likes