blurts-server icon indicating copy to clipboard operation
blurts-server copied to clipboard

Localization issues in premium.ftl

Open flodolo opened this issue 2 years ago • 4 comments

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 avatar Jul 21 '23 06:07 flodolo

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>
  }

flodolo avatar Jul 21 '23 15:07 flodolo

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

pdehaan avatar Jul 21 '23 15:07 pdehaan

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.

flodolo avatar Jul 26 '23 17:07 flodolo

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

mathjazz avatar Jul 26 '23 18:07 mathjazz