wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.7k stars 1.12k forks source link

I18n: Some textual content remains in English when using WordPress app in PT-BR language #18161

Closed brcavallaro closed 2 years ago

brcavallaro commented 2 years ago

Expected behavior

While using the WordPress app in iOS devices configured with PT-BR language, textual content should be translated accordingly.

Actual behavior

Some textual content remains in English when using WordPress app in PT-BR language (iOS device, iPhone XS).

I just explored the content of Blog Post creation. There might be much more untranslated content. Please, let me know if you'll need me to run another session to explore this even more and provide a complete report.

Adding images Text options Paragraph placeholder Paragraph settings
Adding images Text options Paragraph placeholder Paragraph settings
Block removed toast Color labels Font sizing options General placeholders
Block removed toast IColor labels Font sizing options General placeholders

Steps to reproduce the behavior

  1. Switch the device's default language to PT-BR
  2. Navigate throughout the app exploring proper translation
Tested on iPhone XS, iOS 14.8.1, WPiOS 19.4.0.2
hypest commented 2 years ago

Thanks for opening this ticket @brcavallaro !

👋 @fluiddot, you probably have some insights on the translations side of things, can you check out this ticket? Thanks!

fluiddot commented 2 years ago

👋 @fluiddot, you probably have some insights on the translations side of things, can you check out this ticket? Thanks!

Sure, I'll take a look as soon as possible.

fluiddot commented 2 years ago

I've done a quick investigation, and the issue is related to the locale identifier used for loading the localizations in WordPress-iOS before passing them to Gutenberg (reference). For some reason, when using PT-BR language the locale identifier retrieved is PT instead of PT-BR. We have way less translations for PT language than PT-BR, so it makes sense that we see more strings untranslated.

WordPress for iOS GlotPress project:

Screenshot 2022-03-22 at 11 25 04

We should investigate further how to retrieve the proper locale identifier for this case.

hypest commented 2 years ago

Thanks for investigating @fluiddot!

Aha, sounds like we shouldn't be opting for the region-less locale if the one for the region (Brazil in this case) is in a better translation coverage, right?

fluiddot commented 2 years ago

Aha, sounds like we shouldn't be opting for the region-less locale if the one for the region (Brazil in this case) is in a better translation coverage, right?

Exactly, we should retrieve PT-BR localizations in this case. As outlined in this comment, I found it unexpected that this line returns PT even when setting the device's language to PT-BR. As far as I checked, we don't have a logic that opts for the region-less version when retrieving the localizations file, so I'm wondering if we're taking the wrong identifier for this purpose 🤔 .