Translate the content of the digital delivery pages Sky Pilot creates in your store

Sky Pilot adds dynamic pages to your Shopify store where customers can download files or view videos attached to their purchased products. The content of these pages can be translated to cater the customers around the world:

  1. Go to "Settings"

  2. Click on the "Theme"

  3. In the current theme, click on "Actions"

  4. And select "Edit Code"


By following our example, we will add a "subheading" text to our Order page, which is going to be translatable.

 

To do so, first scroll down to LOCALES section and select the applicable locale you want to edit, for example, de.json for German customers:


Locate the order key, which already includes the "heading" 


...
"order": {
"heading": "Ihre Bibliothek",
...
}
...


Now we add a key "subheading" at the end of a block, so the content looks like the following:

...
"order": {
"heading": "Ihre Bibliothek",
...
"subheading": "Muster",
}
...

Then Save the file.

 
Repeat and add this "subheading" (or the name you have chosen for your page) in all applicable locales such as en.json, fr.json, ... place the same "subheading" key in all of them, with the corresponding translated value. Example en.json would be:

...
"order": {
"heading": "Your Library",
...
"subheading": "Example",
}
...

 
Once you are finished editing all the Locales, scroll up in the file sidebar to locate TEMPLATES, and select the template which will show the translated text (for example order.liquid).


Add this piece of code in the place you want the translated text to appear. Following our example, we add:

<h4 class="sky-pilot-heading">{{ 'order.heading' | t: order_number: order.order_number }}</h4>
...
<p>{{ 'order.subheading' | t }}</p>

 

IMPORTANT: customer.subheading corresponds to en.json's "customer": { "subheading": "..." }, so if your key is named differently, make sure it matches in locale file and liquid file as well.

To finish Save the template file. 

 

Now view an example order and use Shopify's language toggle to view the delivery page in different languages. The content inserted in the template should be now translated according to the values from the locale JSON file.