Skip to main content

How to keep your translations when you switch Shopify themes

Export your theme translations before you switch themes, then import them into the new theme so you do not lose them.

Goal: Move the translations of your current Shopify theme to a new theme. Shopify stores theme translations on the theme itself, so when you publish a different theme, its storefront text shows without your translations. You can export the translations, point the file at the new theme, and import it again.

This article is about theme translations only (the ONLINE_STORE_THEME type). Translations of products, collections, pages, and other store content are not stored on the theme, so they stay when you switch themes.

Prerequisites:

  • You have Altera installed on your Shopify store

  • You have one or more languages set up in your Shopify store (Settings > Languages)

  • The new theme is installed in your theme library (Online Store > Themes)

Step 1 - Export your theme translations

In Altera, click New export and select Translations. Click Add filter, select Data type, and select Online Store Theme. Click Start export.

Without a Theme ID filter, the export contains the translations of your published theme. Do this step before you publish the new theme.

If you already switched themes, you can still get the translations of the old theme. Add a Theme ID filter with the ID of the old theme (see Step 3 for how to find a theme ID). This filter also works for unpublished themes.

The export contains only base translations. If you use market adaptations, run one more export with a Markets / Adaptations filter (see Markets / Adaptations filter).

Step 2 - Download the file

When the export is complete, click Download output. Keep an unchanged copy of the file as a backup of your translations.

Step 3 - Find the IDs of the old and the new theme

In your Shopify admin, go to Online Store > Themes. Click Customize on a theme. The theme ID is the number after /themes/ in the URL of the theme editor (for example, admin.shopify.com/store/your-store/themes/123456789012/editor).

Write down the ID of the old theme and the ID of the new theme. The old theme ID is also in the Identification column of the exported file.

Step 4 - Publish the new theme

In Online Store > Themes, publish the new theme.

Step 5 - Change the theme ID in the file

Open the exported file. In the ID, Identification, and Parent ID columns, replace the old theme ID with the new theme ID. Use the find and replace function of your spreadsheet program and select only these three columns, so that the default and translated content do not change.

Change the ID column too, not only Identification. Altera uses the ID column first, so if it still contains the old theme ID, the import updates the old theme.

Step 6 - Remove the rows without a translation

Delete the rows where the Translated content column is empty. When a row has an empty Translated content cell, the import deletes that translation. The new theme can have translations of its own (for example, the translations that come with the theme), and these rows would remove them.

Step 7 - Import the file

In Altera, click New import and upload the file. Review the file analysis, then click Start import.

Step 8 - Review the import results

When the import is complete, look at the warnings and messages in the results:

  • TRNS011 - The field does not exist in the new theme, so Altera skipped the row (see TRNS011).

  • TRNS025 - The default content of the field is different in the new theme. Altera saved the translation, but make sure that it still fits the new text (see TRNS025).

Outcome

The translations of your old theme are now on the new theme, for each field that both themes have. You can check them in the Shopify Translate & Adapt app or on your storefront in each language.

What does not carry over

A translation moves to the new theme only when the new theme has a field with the same key (the Field column). How many rows match depends on how similar the two themes are:

  • Keys that start with shopify. (for example, checkout and customer account text) are text that Shopify supplies, so they usually match in every theme.

  • Theme text keys (for example, products.product.add_to_cart) come from the locale files of the theme. They match when the new theme uses the same key, which is common for newer versions of the same theme and less common for themes from other developers.

  • Section and block settings have long keys with random IDs, for example section.index.json.6a3bb789-ce10-45f5-ae67-e2063ef8c76b.heading:3a9gs9p3xxf35. These IDs come from the sections and blocks that you added in the theme editor. If the new theme has different sections or blocks, these rows do not match, and you must translate that content again in the new theme.

Altera does not match rows by their default content, so a row with a key that the new theme does not have is skipped, even if the new theme has the same text.

Example

These rows move two translations from theme 123456789012 to theme 987654321098. Only the ID, Identification, and Parent ID columns change.

Type

ID

Identification

Parent Type

Parent ID

Field

Locale

Default content

Translated content

ONLINE_STORE_THEME

gid://shopify/OnlineStoreTheme/987654321098

987654321098

ONLINE_STORE_THEME

gid://shopify/OnlineStoreTheme/987654321098

products.product.add_to_cart

fr

Add to cart

Ajouter au panier

ONLINE_STORE_THEME

gid://shopify/OnlineStoreTheme/987654321098

987654321098

ONLINE_STORE_THEME

gid://shopify/OnlineStoreTheme/987654321098

general.search.search

fr

Search

Rechercher

Next steps

Did this answer your question?