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

Localization issues in premium.ftl #3240

Open
flodolo opened this issue Jul 21, 2023 · 4 comments
Open

Localization issues in premium.ftl #3240

flodolo opened this issue Jul 21, 2023 · 4 comments
Assignees
Labels
jira-synced Jira task created for this

Comments

@flodolo
Copy link
Collaborator

flodolo commented Jul 21, 2023

This file hasn't been consistently reviewed for localization issues, and there are a few.

exposure-chart-heading = <nr>{ $nr }</nr> <label>exposures</label>

When a string uses plurals, we should use this form to trigger the plural UI in Pontoon.

exposure-chart-heading =
  { $nr ->
     *[other] <nr>{ $nr }</nr> <label>exposures</label>
  }
modal-exposure-type-description = We search for you in all known data breaches and { $data_broker_sites_total_num } data broker sites that sell your personal info. Here are the two types of exposures we find:
modal-exposure-status-description = We search for exposures in all known data breaches and { $data_broker_sites_total_num } data broker sites that sell your personal info.
  Your exposures will have one of the following statuses: 

We keep repeating this 190 number. Can we revisit this decision and put a value (e.g. "hundreds") that is going to be valid even if the number changes? To properly translate this, we need to make it plural, which means some locales will have to translate the same sentence 6 times. And we use this 190 number a lot, more than seems necessary.

dashboard-top-banner-protect-your-data-description = We found your data in { $data_breach_total_num } data breaches and { $data_broker_total_num } sites selling your personal info. We’ll guide you on how to fix it.
dashboard-exposures-area-description = We found your information exposed { $exposures_total_num } times over { $data_breach_total_num } data breaches and { $data_broker_total_num } data broker sites that are selling your personal info.

This is not something we can translate: there is no support for multiple plurals in one strings. Content needs to be changed to only have one plural per string.

This content is broken even for English when any of the variables is 1.

@flodolo
Copy link
Collaborator Author

flodolo commented Jul 21, 2023

I double-checked with @mathjazz, and I was wrong in assuming that this would trigger Pontoon's plural UI 😞

exposure-chart-heading =
  { $nr ->
     *[other] <nr>{ $nr }</nr> <label>exposures</label>
  }

We need the full plurals, even if that doesn't make a lot of sense for English

exposure-chart-heading =
  { $nr ->
      [one] <nr>{ $nr }</nr> <label>exposure</label>
     *[other] <nr>{ $nr }</nr> <label>exposures</label>
  }

@pdehaan
Copy link
Collaborator

pdehaan commented Jul 21, 2023

This is a super-sketchy chain of cursed greps, but we might have about 8 spots where we only have an *[other] value in our .ftl files:

git grep -In -B1 "\*\[other\]" -- locales/en locales-pending/ | grep -A1 -E "\->$"
locales-pending/onboarding.ftl-18-    $dataBrokerTotalCount ->
locales-pending/onboarding.ftl:19:        *[other] With just a few key pieces of information, we’ll search for you in all known data breaches and { $dataBrokerTotalCount } major data broker sites. All users get the first scan free.
--
locales-pending/onboarding.ftl-58-    $breachesTotalCount ->
locales-pending/onboarding.ftl:59:        *[other] { $breachesScannedCount } of { $breachesTotalCount } known data breaches
--
locales-pending/onboarding.ftl-65-    $dataBrokerTotalCount ->
locales-pending/onboarding.ftl:66:        *[other] { $dataBrokerScannedCount } of { $dataBrokerTotalCount } data broker sites
--
locales-pending/premium.ftl-96-  { $exposure_num ->
locales-pending/premium.ftl:97:     *[other] { $exposure_num } found
--
locales/en/app.ftl-388-  { $breachCount ->
locales/en/app.ftl:389:   *[other] This email appeared in { $breachCount } known data breaches, including { $breachName }.
--
locales/en/app.ftl-637-  { $numAffectedEmails ->
locales/en/app.ftl:638:    *[other] { $numAffectedEmails } of your email addresses appeared in this breach. <a>What to do next</a>
--
locales/en/app.ftl-692-  { $numResolvedBreaches ->
locales/en/app.ftl:693:     *[other] { $numResolvedBreaches } Resolved
--
locales/en/app.ftl-704-  { $numTotalBreaches ->
locales/en/app.ftl:705:     *[other] { $numResolvedBreaches } out of { $numTotalBreaches } breaches marked as resolved

@flodolo
Copy link
Collaborator Author

flodolo commented Jul 26, 2023

Update: apparently, I got the incorrect answer :-(

https://pontoon.mozilla.org/af/firefox/all-resources/?string=219592

This is an example showing that having other is enough to trigger the Pontoon UI

exposure-chart-heading =
  { $nr ->
     *[other] <nr>{ $nr }</nr> <label>exposures</label>
  }

Having a singular form (that is unused) is not bad, just not necessary.

@mathjazz
Copy link
Contributor

Sorry for causing the confusion - I misinterpreted the question. 🤦

@EMMLynch EMMLynch added the jira-synced Jira task created for this label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-synced Jira task created for this
Projects
None yet
Development

No branches or pull requests

5 participants