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

Block titles are not translated #3422

Closed
fluiddot opened this issue Apr 27, 2021 · 4 comments · Fixed by #3423
Closed

Block titles are not translated #3422

fluiddot opened this issue Apr 27, 2021 · 4 comments · Fixed by #3423
Assignees
Labels
i18n [Pri] High [Type] Bug Something isn't working [Type] Regression Existing functionality that got broken

Comments

@fluiddot
Copy link
Contributor

Describe the bug
The block titles are not translated, they're showing the text in English independently of the device language.

⚠️ I tried in a previous version (WPiOS 17.0.1) and the block titles are translated so looks like this is a regression bug introduced in a recent version.

To Reproduce

  1. Change the language of your device to a non-English one that is supported by the app (check this list)
  2. Open the app
  3. Tap on the ➕ button
  4. Observe that the block titles are not translated

Expected behavior
The block titles should be translated.

Screenshots

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6, Pixel 4] iPhone 8
  • OS: [e.g. iOS 8.1, Android X] iOS 14.2
  • Version [e.g. 22] 17.1
@fluiddot fluiddot added [Type] Bug Something isn't working [Type] Regression Existing functionality that got broken labels Apr 27, 2021
@fluiddot fluiddot self-assigned this Apr 27, 2021
@fluiddot fluiddot added this to Triage in Mobile Gutenberg via automation Apr 27, 2021
@fluiddot
Copy link
Contributor Author

fluiddot commented Apr 27, 2021

I've just investigated this issue and I found that this problem is caused due to not updating the i18n cache when making a release.

As an example, for the Paragraph block's title, the localization key is block title\u0004Paragraph. If you check latest localization files that we've bundled, you will see that this key is not present. However, if you run npm run core i18n-cache:force to force updating the localization files and open the file located in gutenberg/packages/react-native-editor/i18n-cache/data/es.json, you will see that the key is present.

Looks like the problem is that the scripts that we run when making a release are not assuring that we use the latest localization files. A potential solution would be to clean the localization files when we make the bundles, I saw in the npm command bundle that we invoke the command clean in the react-native-editor package so we could include there the command clean:i18n-cache to clean the localizations cache too.

EDIT: I noticed that, if we delete the i18n localization files, we should also explicitly generate the i18n localization files before generating the bundle because they're not automatically generated.

@fluiddot
Copy link
Contributor Author

I finally decided to follow a different approach, I realized that we have a prebundle command in the react-native-editor that updates the i18n localization files. So I add it to the bundle command to assure that we always bundle the most recent localization files.

@mchowning
Copy link
Contributor

mchowning commented Apr 27, 2021

I think this may actually be a duplicate of this issue: #3269. Let's just make sure we close both issues once we resolve this (if you agree).

@fluiddot
Copy link
Contributor Author

I think this may actually be a duplicate of this issue: #3269. Let's just make sure we close both issues once we resolve this (if you agree).

Yep, most likely this issue has been introduced and fixed in different versions, depending on if the release wrangler had the latest localization files 🤦 .

Mobile Gutenberg automation moved this from In progress to Done (keep clean, manually) Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n [Pri] High [Type] Bug Something isn't working [Type] Regression Existing functionality that got broken
Projects
Mobile Gutenberg
  
Done (keep clean, manually)
2 participants