Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Shopify theme push -u breaks translations from Translate & Adapt app #1562

Closed
2 tasks done
kfalkiewicz opened this issue Mar 6, 2023 · 13 comments
Closed
2 tasks done
Assignees
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working

Comments

@kfalkiewicz
Copy link

Please confirm that you have:

  • 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.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

When store has Translate & Adapt app installed, the translations should be connected to every version of same theme. So for those created in the process bellow also.

Process:

  1. Pull latest live version of the theme - shopify theme pull
  2. Do local changes
  3. Push your changes with shopify theme push -u -t "New name"

Actual behavior

When you push local theme changes with shopify theme push -u -t "New name" the new theme is created, but it also "disconnected" from the Translate & Adapt app translations (no translations to the templates). If you instead duplicate the original theme and then push local changes with shopify theme push -t xxxxxx (xxxxxx - id of the duplicated theme) then all of the translations works fine.

Stack trace

No response

Reproduction steps

  1. Pull latest live version of the theme - shopify theme pull
  2. Do local changes
  3. Push your changes with shopify theme push -u -t "New name"
  4. Your new theme has missing translations from the Translate & Adapt app

Operating System

macOS 11.6

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

3.44.1

Shell

zsh

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

v19.4.0

What language and version are you using in your application?

No response

@kfalkiewicz kfalkiewicz added the Type: Bug Something isn't working label Mar 6, 2023
@alvaro-shopify
Copy link
Contributor

Hi, thanks for your proposal, I'll tag @Shopify/theme-developer-tools so they take a look at this.

@alvaro-shopify alvaro-shopify added the Area: @shopify/theme @shopify/theme package issues label Mar 7, 2023
@sarahsilva1
Copy link

Hi! Just wanted to say that we have a GitHub workflow that utilizes shopify theme push and this exact same issue happened to us. It seems that some translations are stored in locales, but many are not. The translations stored in locales were safe and survived the push, but all other translations were lost.

@AndreaPontrandolfo
Copy link

We are also experiencing this problem. The latest version of the CLI definitly has some problems with the translations.

@Poitrin Poitrin self-assigned this Mar 10, 2023
@Poitrin
Copy link
Contributor

Poitrin commented Mar 10, 2023

I'm sorry that you lost your precious translations.
I tried to reproduce your issue, but haven’t been able to.
Here’s what I did:

  1. That's my current store with its live theme and translations for English, German, French:
    1

  2. shopify theme list and shopify theme pull:
    2

  3. I then added some changes.

  4. shopify theme push -u -t "New name":
    3

  5. And when I open the theme preview, I still had the same German translations. I also appended /fr to the URL:
    4

Translations like Maison or Catalogue are only in the Translate & Adapt app, not in my theme code.

Is there something I missed?

@kfa-spyro
Copy link

kfa-spyro commented Mar 11, 2023

In my case, the translations added by Translate & Adapt app for the template sections weren't properly moved when I did shopify theme -u -t. Try also when pulling without --live flag.

@Poitrin
Copy link
Contributor

Poitrin commented Mar 13, 2023

Tried it again without the --live flag:
13-41-9a7uq-hactu

But I couldn't see any missing translations…
13-40-r6528-dc4g3

13-52-0y6j2-dx6fx

I also updated some translations in fr.json and created another theme, but all translations are still there.

@kfa-spyro
Copy link

From what I remember it only affected the sections inside HopePage and other templates. Main Menu or Footer was fine. So when you translate the "ImageBanner" and retry it should be not translated.

@Poitrin
Copy link
Contributor

Poitrin commented Mar 15, 2023

Right, thanks for clarifying this! I actually did have a French translation for "Image banner", which did not show up in my new theme. I think the problem was that we expected Translate & Adapt translations to be connected to the store, although they are connected to a theme.
translations
So when we theme push -u a new theme, publish it afterwards, and go to Translate & Adapt, we might be shocked because translations are not showing up.

But they are still available in the previous live theme. Here's a way how to retrieve them:
Step 1
Step 2
And then the Translate & Adapt app opens again, but with theme-specific translations.

Navigation and footer translations are store-wide though, so that explains why they were still visible.

So the current solution is to duplicate the theme and then update the theme code afterwards.

@Poitrin Poitrin closed this as completed Mar 15, 2023
@kfa-spyro
Copy link

Yes, duplicate is the solution, but still, this is the problem. When I change the Live theme then those translations are not re-attached. They are only in the situation when you duplicated theme first.

@Poitrin
Copy link
Contributor

Poitrin commented Mar 15, 2023

When I change the Live theme then those translations are not re-attached.

That's true, because theme push command only pushes the local code (including translations in locales folder) to the platform.
theme push ≠ duplicate, so it can not and should not be responsible for copy-pasting translations from live theme to the new theme.

It is unfortunate though that the current Translate & Adapt UI gives the impression that translations are attached to the store, even though they are attached to a specific theme, and that there's no way to copy-paste/export/import translations from one theme to another. I therefore invite you to submit feedback to the T&A team (there's a feedback feature in the Shopify Admin), so that the related issues get prioritised.

@MaxDesignFR
Copy link

I'm not sure this issue should be closed. It's actually a huge pain in the a**. It means Shopify Translations are not compatible with Connect from Github feature, since connecting a theme from Github creates a new version of the theme, not one originally duplicated from the live theme.

I'm really curious what workaround developers use to work with both translation and github integration within Shopify. I will open a new issue to highlight this problem.

@davidhollenbeckx
Copy link

this is still a massive issue any time we work with multilingual sites

i just manually copy pasted 250 files to avoid breaking the translations haha

@nboliver-ventureweb
Copy link

This is still very much an issue. The proposed solution of manually duplicating themes in the admin is not viable in CI/CD workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants