Open Bug 1703250 Opened 4 years ago Updated 1 year ago

Consider script matching when accepting cross-locale regional preferences locales

Categories

(Core :: Internationalization, defect, P3)

Firefox 89
defect

Tracking

()

People

(Reporter: rancherko, Unassigned, Mentored)

Details

(Keywords: good-first-bug, helpwanted)

User Story

The user uses `sr` Firefox (which maximizes to `sr-Cyrl`) and has `sr-Latn-RS` set as the regional preferences locale in their Operating System.

At the moment, our logic [0] will check if the `language` subtag matches (which it does in this case) and then accept the Regional Preferences for Intl formatting.

The undesired result is that user has localization in `sr-Cyrl`, but intl formatters in `sr-Latn`. We should verify that the script is matching (using `maximize` on the app locale) before comparing.


[0] https://searchfox.org/mozilla-central/source/intl/locale/LocaleService.cpp#477

Attachments

(1 file)

Attached image Time.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36

Steps to reproduce:

Hover over "Sync Now" in the app menu when signed in to a Firefox account. The string in question: https://pontoon.mozilla.org/sr/firefox/all-resources/?string=220643

Actual results:

Text is in the Serbian Latin script.

Expected results:

Text should be in the Serbian Cyrillic script.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Additional note: at Mozilla we use sr for the Cyrillic version (sr-Cyrl).

Looks like CLDR is doing the same, so I'm not exactly sure why the mismatch
https://github.com/unicode-org/cldr-json/blob/master/cldr-json/cldr-misc-full/main/sr/characters.json

Reporter: can you share your about:support section for Localization and Internationalization?

Flags: needinfo?(rancherko)

It seems it's dependent on regional settings. When regional language is set to English, Firefox automatically switches to ["sr","en-US"]. Similar should happen when any variant of Serbian Latin is selected — ["sr"] instead of ["sr-Latn-RS"] or other, considering Mozilla products are shipped only in Serbian Cyrillic.

Flags: needinfo?(rancherko)

Can you describe what you'd expect to happen in what configuration of your regional settings?

Flags: needinfo?(rancherko)

When regional format is set to "sr-Latn-BA, sr-Latn-CS, sr-Latn-ME, sr-Latn-RS, sr-Latn-XK", Firefox should use ["sr"] instead. The code sr-Latn-CS (Serbian, Latin, Serbia and Montenegro) is deprecated, but it's still available in earlier versions of Windows and other operating systems.

Flags: needinfo?(rancherko)

I still struggle to understand the exact combination of available and regional locales you're using.

Could you paste an example table from about:support that shows a configuration in which you're receiving wrong outputs?

Flags: needinfo?(rancherko)

Sorry, I thought it's clear that my issue was fixed. The right output shows in every locale besides Serbian Latin (including English, Russian etc.).

An example with wrong outputs is below. "Regional Preferences" under "Application Settings" is what's causing issues. I'm repeating myself, but in those cases, when OS regional format is set to any of the Serbian Latin locales mentioned in the last post, it should switch to "sr".

Application Settings
Requested Locales ["sr"]
Available Locales ["sr","en-US"]
App Locales ["sr","en-US"]
Regional Preferences ["sr-Latn-RS"]
Default Locale "sr"
Operating System
System Locales ["en-US","sr-Latn-RS","sr-Cyrl-RS"]
Regional Preferences ["sr-Latn-RS"]

Flags: needinfo?(rancherko)

in those cases, when OS regional format is set to any of the Serbian Latin locales mentioned in the last post, it should switch to "sr".

Did you mean "shouldn't switch"?

In the example you showed below you are asking for sr-Latn-RS for your regional preferences, and you have sr available in Firefox (which expands to sr-Cyrl) and Firefox matches on the language alone (sr) but in result uses cyrylic script for localization, and latn script for regional preferences.

My read of that example is that it is a bug and we should not match here because of the script difference.

Am I correct in my analysis?

Flags: needinfo?(rancherko)

I think you're both saying the same thing, in two different ways

when OS regional format is set to any of the Serbian Latin locales mentioned in the last post, it should switch to "sr"

If regional settings is any of sr-Latn-* and Firefox is using sr (Cyrillic), CLDR should not be using Latin script, i.e. "switch to sr" (which uses Cyrillic script).

What Francesco said. As I already mentioned, Firefox products are available only in Serbian Cyrillic, that's why importing Latin strings shouldn't be an option.

Flags: needinfo?(rancherko)

Thank you! Locale matching is a nuanced art :)

I recognize this as a bug and I provided a way to resolve it. This is relatively easy so I'm marking it as good-first-bug, but since the impact is relatively low (mostly sr and zh users - since those two locales are most commonly operating across scripts), my team won't be able to prioritize it above P4 for now.

Happy to mentor if someone will want to try their hand at fixing it!

Mentor: zbraniecki
Severity: -- → S3
User Story: (updated)
Priority: -- → P3
Summary: Strings pulled from CLDR are in Serbian Latin instead of Cyrillic → Consider script matching when accepting cross-locale regional preferences locales

Hi my name is Leslie and I'm an Outreachy applicant. Can I work on this bug?

Flags: needinfo?(zbraniecki)

Hi Leslie,

Sorry it has taken us so long to get back to you on this.

Of course you are welcome to look into this bug if you are still interested/available to do so!

Flags: needinfo?(zbraniecki)

Any news regarding this?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: