Why did my theme update erase most translations?

Solved

Why did my theme update erase most translations?

Ogenstad
Tourist
7 0 0

I updated our theme Impulse from version 7.1 to 7.2. Most translations are now gone, albeit not all of them. Navigation, pages and product content are still there. How can the new version be missing the translations as the base language is still available to all elements? Since the reference to the correct object is there, so should the translations or is this a bug in Translate & Adapt or the underlying Shopify architecture?

 

Is there a way of copying the translations from the old version to the new?

Accepted Solution (1)
richbrown_staff
Shopify Staff
652 96 165

This is an accepted solution.

@elenalauder @Ogenstad I think I might have a short term fix for you to help copy the translations from the old theme to the new theme, based on the translations CSV. You'll need the CSV for both the old theme, with its translations in place, and the new one, without translations. Languages > Settings > Export gives you whichever theme is live at the time, so you'll need to make a theme temporarily live to do the export. Only do this for one language at a time.

 

Column G = Source content (i.e. English, if your default language is set to English)

Column H = Translations

 

  • Put both CSV exports in one Google Sheets file as separate sheets, and rename the old theme's export Sheet2 and the new one Sheet1.
  • For both sheets, delete all rows that don't have ONLINE_STORE_THEME in column A. We only want to work with theme content here. Column H in Sheet1 will be empty, column H in Sheet2 will be full (of the old translations)
  • On Sheet 1 in cell H2 (which should be the first of an empty column), paste this formula: 
    =IFERROR(VLOOKUP(G2, SORT({Sheet2!G:H, LEN(Sheet2!H:H)}, 3, FALSE), 2, FALSE), "")
  • Then auto-fill all the way down. This formula is matching based on column G default content. Where it finds a match between column G in Sheet1 and column G in Sheet2 it copies over what it finds in column H in Sheet2 to column H in Sheet1.
  • Export Sheet1 as a CSV.
  • Ensuring that the 'new' theme is live, i.e. without the translations in it, import this CSV.

This should port old theme translations to your new theme, without the need to manually copy and paste. These translations will be visible and editable in Translate & Adapt, and other Translations API compliant apps.

 

Hope that helps!

 

Rich

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 22 (22)

Transcy
Shopify Partner
285 19 86

Hello @Ogenstad ,

We are Transcy - a powerful translator and currencies converter. 

 

Sorry for the issue you're facing with, maybe there's some errors occurs while the update process is running. To copy the translation from the old version to the new, you can try:

  • Export and import the translation files: If you had previously exported the translation files for the old version of the theme, you can import these files into the new version of the theme
  • Use a translation app or plugin: If you were using a translation app or plugin to manage your translations, you can check to see if the app or plugin has an option to export and import translations
  • Copy and paste the translations: If you don't have an export of your translations or don't want to use a translation app or plugin, you can manually copy and paste the translations from the old version of the theme to the new version.

Hope these can help, please hit the Like Button or mark this as Accepted Solution to let us know, it means a lot to us.

 

Regards,

Transcy team.

 

Transcy - The #1 Translation and Currency Converter
- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Blog

richbrown_staff
Shopify Staff
652 96 165

Hey @Ogenstad, Theme translations are local to that theme. This is because themes can differ vastly and each element has a unique id - there's no easy way to port them from one theme to another unless the theme is duplicated. They will need to be manually copied to the new theme. To do that, make the old theme live briefly, export the translations CSV (Settings > Languages > Export) and then make the new theme live and do the same. Filter down to ONLNE_STORE_THEME (delete everything else) and then compare the two. Manually update column H on the new theme's CSV. Unfortunately the difference in field IDs means that this is the way to do it.

To learn more visit the Shopify Help Center or the Community Blog.

elenalauder
Tourist
8 0 2

Hi Richbrown_staff,

I have the same problem. After updating my theme to the latest version, I can't find the old translations.

 

I found out myself that the translations are not in the exported zipped theme (I searched the files with a text editor).

 

So the translation must be local on the shopify server.

 

Now can you please explain me again how I can transfer the translation from the old theme to the new one.

 

I have found the export/import function of the translation in shopify.
Can I now simply export the translation from the old theme and import it into the new theme? Is that the way to do it?

 

Do I have to do this manually, do I have to edit the .csv file in excel?
I would be very grateful if you can help me further, or do I have to ask the support? Strange I have unfortunately in the shopify FAQ no guidance found, strange also it must have nevertheless other people also this problem.


How do the professionals solve it?

Thanks a lot in advance for the effort and hard work.
Best regards, Elena

 

richbrown_staff
Shopify Staff
652 96 165

This is an accepted solution.

@elenalauder @Ogenstad I think I might have a short term fix for you to help copy the translations from the old theme to the new theme, based on the translations CSV. You'll need the CSV for both the old theme, with its translations in place, and the new one, without translations. Languages > Settings > Export gives you whichever theme is live at the time, so you'll need to make a theme temporarily live to do the export. Only do this for one language at a time.

 

Column G = Source content (i.e. English, if your default language is set to English)

Column H = Translations

 

  • Put both CSV exports in one Google Sheets file as separate sheets, and rename the old theme's export Sheet2 and the new one Sheet1.
  • For both sheets, delete all rows that don't have ONLINE_STORE_THEME in column A. We only want to work with theme content here. Column H in Sheet1 will be empty, column H in Sheet2 will be full (of the old translations)
  • On Sheet 1 in cell H2 (which should be the first of an empty column), paste this formula: 
    =IFERROR(VLOOKUP(G2, SORT({Sheet2!G:H, LEN(Sheet2!H:H)}, 3, FALSE), 2, FALSE), "")
  • Then auto-fill all the way down. This formula is matching based on column G default content. Where it finds a match between column G in Sheet1 and column G in Sheet2 it copies over what it finds in column H in Sheet2 to column H in Sheet1.
  • Export Sheet1 as a CSV.
  • Ensuring that the 'new' theme is live, i.e. without the translations in it, import this CSV.

This should port old theme translations to your new theme, without the need to manually copy and paste. These translations will be visible and editable in Translate & Adapt, and other Translations API compliant apps.

 

Hope that helps!

 

Rich

To learn more visit the Shopify Help Center or the Community Blog.

elenalauder
Tourist
8 0 2

Hello richbrown_staff, thank you for taking the time to explain in detail.
I understood everything, it all worked, but somehow the formula is not correct.
Did you maybe made a mistake, when inserting the formula in H2 in Sheet 1 I get an error in Google Sheet always "Parser error, check the formula syntax).

=IFERROR(VLOOKUP(G2, SORT({Sheet2!G:H, LEN(Sheet2!H:H)}, 3, FALSE), 2, FALSE), "")

Thanks for a reply in advance.
Kind regards, Elena

 

richbrown_staff
Shopify Staff
652 96 165

Hey @elenalauder - I sent you a direct message 👍

To learn more visit the Shopify Help Center or the Community Blog.

elenalauder
Tourist
8 0 2

Hello Richbrown_staff,
Thanks for the motivation to help me and thanks for the efforts.
I have found out the problem myself.
I had this before, the formula does not match my german interface.

The formula must be language specific for it to work.
If someone also has the same problem, here is the formula for german Google sheet:

 

 

=WENNFEHLER(SVERWEIS(G2, SORT({Sheet2!G:H, LÄNGE(Sheet2!H:H)}, 3, FALSCH), 2, FALSCH), "")

 

 

It works wonderfully, cool solution. Although in the future you will develop a better solution how to update the theme in general. Copying back and forth is already tedious.
Best regards and thanks again,
Elena

 

Edit: I understand shopify has its advantages and disadvantages. A lot of it is also price related. But yes still think some things should be implemented differently. Especially the theme update should be easy to implement I think, unlike other systems.

richbrown_staff
Shopify Staff
652 96 165

I never knew Google Sheets did formulas in different languages - thanks for
sharing!

So glad it worked for you. We'll definitely look to integrate it in natively at some point in the future. Best wishes, Rich

To learn more visit the Shopify Help Center or the Community Blog.

lasrv
Visitor
1 0 2

This is the real only solution?

Is not sustainable to be downloading, making vlookups and re-uploading this everytime a theme is updated. Shopify would need to bring a better solution for this.

richbrown_staff
Shopify Staff
652 96 165

HI @lasrv - every time you update your theme, or change your theme? Can you let me know the workflow you follow where you're finding that the ONLINE_STORE_THEME field ids are regularly changing?

To learn more visit the Shopify Help Center or the Community Blog.

TomasPesek
Shopify Partner
12 0 2

Hi @richbrown_staff ,

 

Sorry for opening an old topic, but I might need an explanation on how to properly deploy changes in themes.

When I want to create a new feature, I program it, test it and create a new theme. When that theme is ok, I click Publish. At this point, I lose some translations (ONLINE_STORE_THEME type).

 

What am I doing wrong please? I don't think this is something unique, and I don't want to accept that I should export/copy/import translation files for every change like this.

 

Thank you very much for the explanation.

richbrown_staff
Shopify Staff
652 96 165

Hey @TomasPesek , are you using Git or just doing it in the browser? You lose theme translations when the theme id changes, which happens if you make a new theme or push changes from Git. Not, though, if you duplicate the old theme

To learn more visit the Shopify Help Center or the Community Blog.

TomasPesek
Shopify Partner
12 0 2

Hello @richbrown_staff ,

 

thank you very much for your quick reply.

 

Yes, I use git. I create a new branch with a release, link that as a new theme and publish that. I found it here https://github.com/Shopify/cli/issues/1562 a while ago.

 

I mistakenly thought that translate&adapt is by default linked to a live theme and not to a specific theme.

 

Thank you very much

richbrown_staff
Shopify Staff
652 96 165

Theme translations (only) are linked to that theme. Translate & Adapt shows the translations in the current theme (unless you do this). It's the act of publishing from Git that changes the theme id I believe, which is why the translations are lost. I don't believe there's a workaround other than not using Git.

To learn more visit the Shopify Help Center or the Community Blog.

Ogenstad
Tourist
7 0 0

I've now come to the point where I'm going to try and upgrade our theme.

 

Appart from language translatations,  each product image is also translated (both from a ALT-perspective but also from a file perspective). Do I have to reuppload and remap thousands of images?

 

Being an IT-architect of enterprise systems for more than 20 years it is clear to me that Shopify is not built for international shops. Everything is fixes and additions to a single market platform. 

 

//Christer

richbrown_staff
Shopify Staff
652 96 165

Hi @Ogenstad , I'll send you a DM

To learn more visit the Shopify Help Center or the Community Blog.

Ogenstad
Tourist
7 0 0

Why do we only want to work with ONLINE_STORE_THEME, what about all COLLECTION and PRODUCT translations?

richbrown_staff
Shopify Staff
652 96 165

Translations for all resource types (see list) except ONLINE_STORE_THEME are not unique to the theme and are saved to our database via the Translations API, so persist regardless of theme. Change your theme and your COLLECTION and PRODUCT translations will stay there. As each theme is different, this is the reason theme translations behave this way, currently.

To learn more visit the Shopify Help Center or the Community Blog.

Ogenstad
Tourist
7 0 0

Seems to be working although the script needs to be ran per language, i.e. I had to make two sheets per language to get it all sorted. Still it's better than doing each manually.

 

Now there's just 4000 images and 4000 ALT-texts that need to be updated manually, one-by-one.

theskinshopqa
Visitor
1 0 0

Thank you. This worked like a charm. However, I do have some Ecomposer sections in my theme that I built and its translations are not copying over to the new theme. I have tried to search those texts within the CSVs but it seems like the translations for the Ecomposer pages arent even part of the export, hence not copying over.

I do see the ar.json file in my locales folder and it does have the Ecomposer translations too but copying this file over to the new theme didn't help.

Kinsmen
Shopify Partner
1 0 0

Good thinking! I have a site where all the fields had to be translated. Not just theONLINE_STORE_THEME translations. Here I used your system with a different formula. I'm going to take your steps and put my formula down bellow for anyone would need it 🙂


  • Put both CSV exports in one Google Sheets file as separate sheets, and rename the old theme's export Sheet2 and the new one Sheet1.
  • On Sheet 1 in cell H2 (which should be the first of an empty column), paste this formula: 

 

=IFERROR(INDEX(Sheet2!H:H, MATCH(1, (Sheet2!D:D = D7492) * (Sheet2!G:G = G7492), 0)), "")

 

 

  • Then auto-fill all the way down. This formula is matching based on column G default content. Where it finds a match between column G in Sheet1 and column G in Sheet2 it copies over what it finds in column H in Sheet2 to column H in Sheet1.
  • Export Sheet1 as a CSV.
  • Ensuring that the 'new' theme is live, i.e. without the translations in it, import this CSV.

 

Thanks again!

Rashley_LS
Shopify Partner
4 0 3

Hello @elenalauder , 

I worked on a similar scenario where we needed to upgrade a theme's version and found a quick way to solve the translation issue.

1. On language settings, export each language separately as csv. 
2. Copy the ID of the new theme version.
3. Open the CSV for each language, find the ONLINE_STORE_THEME rows, look for the old theme ID, and replace all with the new theme's ID.
4. You can delete all other rows that do not contain ONLINE_STORE_THEME.
5. Upload each CSV to Shopify language import and wait till it's done.

6. Preview and Publish your new theme with all translations carried over.


This method works only for theme updates, with same section id's.

 

Rashley | LOAD STUDIOS