cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: Theme translations are lost when pulling / pushing between different themes

Open nboliver-ventureweb opened this issue 1 year ago • 2 comments

Please confirm that you have:

  • [x] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • [x] Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

Using shopify theme pull with the published theme, followed by shopify theme push --unpublished should preserve theme translations in the new unpublished theme. This is particularly relevant for CI/CD, where an automation may pull the latest content changes from the published theme and queue up a new unpublished theme for a release.

Actual behavior

Translations are not preserved. The translations have to be manually exported while the original theme is published. Once the new theme is created the theme ID has to be replaced in the translation .csv. Then the new theme has to be published, and finally the translations need to be imported. This is error prone and makes CI/CD using a blue-green deployment strategy impossible.

Verbose output

n/a

Reproduction steps

  1. Use shopify theme pull to pull the published theme
  2. Merge a branch that contains a new feature you want to release
  3. Run shopify theme push --unpublished to create a new on-deck theme with your new feature, while preserving the previously published theme so you can roll back etc.
  4. See that translations are not carried over from the live theme to the new theme

Operating System

Mac OS Ventura

Shopify CLI version (check your project's package.json if you're not sure)

All

Shell

No response

Node version (run node -v if you're not sure)

No response

What language and version are you using in your application?

No response

nboliver-ventureweb avatar Sep 19 '24 19:09 nboliver-ventureweb

👋 Hey @nboliver-ventureweb,

Could you please confirm if you're using the "Shopify Translate & Adapt" app to power your translations?

If that's the case, that app has the limitation that it gets attached to the theme instance, so the new theme wouldn't really get the translations from the published one. While that's not ideal, it's the current behavior of that app, and the best way to change that is by reporting through the app.

If that's not the case, could you please share an example of a locales/* file that differs between the published and the new theme?

Thank you for reporting this! :)

karreiro avatar Sep 20 '24 08:09 karreiro

Hi @karreiro,

Thanks for the quick reply. The issue is specifically for user-provided translations of theme sections. As I understand it, those translations are stored in the same place in Shopify Admin (Settings > Languages) regardless of whether you use a CSV, or an app such as Translate & Adapt to mange them.

While those translations are attached to a specific theme instance via theme ID, when you manually duplicate a theme in Shopify Admin (... context menu > Duplicate), translations are carried over to the new theme.

Perhaps there could be a flag on the push command to facilitate this? It could allow you to pass a theme ID for a translation source, or use the published theme as the source. Something like:

shopify theme push --unpublished --copy-translations

or

shopify theme push --unpublished --copy-translations <source theme id>

nboliver-ventureweb avatar Sep 20 '24 17:09 nboliver-ventureweb

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Nov 02 '24 03:11 github-actions[bot]

Still relevant!

nboliver-ventureweb avatar Nov 04 '24 15:11 nboliver-ventureweb

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Jan 17 '25 03:01 github-actions[bot]

Still relevant!

nboliver-ventureweb avatar Jan 17 '25 16:01 nboliver-ventureweb

Still relevant!

VDPL9210 avatar Feb 06 '25 11:02 VDPL9210

Still relevant.

danilichti avatar Feb 12 '25 11:02 danilichti

Still relevant 👍 It would be incredibly helpful if newly added GitHub-connected themes could automatically inherit the published theme’s translations. Alternatively, having an option in the admin panel to select a theme and transfer translations across would be fantastic.

Currently, the only workaround I can think of is to export the language CSV, find all content matching the published theme’s ID, duplicate it, and replace those IDs with the new connected theme’s ID.

A more streamlined solution would be greatly appreciated!

craigmroberts avatar Feb 21 '25 20:02 craigmroberts

👋 Hey everyone,

I've shared this issue internally with the team that maintains the "Shopify Translate & Adapt" app to ensure they are aware of this limitation.

I also highly recommend using the support channel in the app, as it's the best way to request this enhancement.

With this in mind, I'm closing this issue, as it can't be fixed at the CLI level.

Thanks for bringing this up tho!

karreiro avatar Mar 13 '25 16:03 karreiro