mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.15k stars 2.91k forks source link

[Experiment] Messages do not fallback to English if translations are not available #12484

Closed SoftVision-CiprianMuresan closed 1 year ago

SoftVision-CiprianMuresan commented 1 year ago

Preconditions

Steps to reproduce

  1. Install Firefox Release from TestFlight and open it.
  2. Dismiss the onboarding slides and observe the Set to Default message.

Expected behavior

Actual behavior

Device & build information

Notes

Attachments:

ACE08EA6-8417-4332-BB49-3D62B7A4B166 D8D4270C-98C6-47F0-9C5E-BC1529600C3B

┆Issue is synchronized with this Jira Task

SoftVision-CiprianMuresan commented 1 year ago

See also #12485 .

nishant2718 commented 1 year ago

Looked into this a bit, and this one isn't an issue with experiments exactly. It's a mix of a few things going wrong together.

What's happening here is that the system thinks the provided [TableValue / Key] from the experiment data IS the string to display IF there's no translation available. And so where we support messaging, you'll see the tableID/stringID shown as the text itself.

First, the system IS doing what we expect - if you look elsewhere. For example, experiment aside, switch to Romanian. Do a fresh install of the app, and observe that there are several places that DO fallback to English (toolbar CFR, Customize Homepage button text at the bottom, several items in the settings popup etc.).

The short term fix here would be to avoid using text in experiments that aren't localized yet.

We have some options for the long term fix:

dnarcese commented 1 year ago

@SoftVision-CiprianMuresan can you check again please? I believe everything is translated now so we don't have to block the experiment on this bug.

dnarcese commented 1 year ago

If all of the translations are in, then I do not see this as an experiment blocker.

nishant2718 commented 1 year ago

@jhugman Is this something we should expect GleanPlumb to handle for us? Or did we miss something on our side?

Softvision-PatriciuPop commented 1 year ago

@dnarcese I've retested this and the issue is still reproducible on the Romanian language. On the Italian one the card is correctly localized and I will try to find other untranslated languages. Tested using Firefox Release 108 (23351)

nishant2718 commented 1 year ago

unfortunately, there will always be cases in certain languages where strings haven't gotten localized. GleanPlumb isn't doing what we're expecting with the strings, so I'll reach out again to the team and see what we can do in the short term.

data-sync-user commented 1 year ago

➤ Daniela Arcese commented:

Nishant Patel any update here? Does the Nimbus team need to do something to fix this?

data-sync-user commented 1 year ago

➤ Nishant Patel commented:

I believe the right solution would be for Nimbus to have configured a fallback localization, for the times a value doesn’t exist. The alternative would mean we would have to override a user’s preferred language - I don’t think this is a safe short term fix.

data-sync-user commented 1 year ago

➤ James Hugman commented:

PR https://github.com/mozilla-mobile/firefox-ios/pull/13019 ( https://github.com/mozilla-mobile/firefox-ios/pull/13019|smart-link )

The fix here was to provide Nimbus with more resource bundles. Previously this was done in a rather obscure part of the startup sequence ( https://github.com/mozilla-mobile/firefox-ios/blame/d41dbb84eb8bc908e9b4aed1050b6d6319f038f4/Client/Experiments/Experiments.swift#L195 ).

We added a Bundle extension method ( https://github.com/mozilla/application-services/blob/c6370008f53328529e8bcf06aaa5014dffcd298b/components/nimbus/ios/Nimbus/Bundle+.swift#LL70-L78 ) to Nimbus, and put in to the list of bundles in which to look for strings and images.

SoftVision-CiprianMuresan commented 1 year ago

Marking the issue as verified as it is no longer reproducible on current builds. Verified that the messages now fall back to English when no translation is present.