Closed Bug 1671764 Opened 5 years ago Closed 5 years ago

Don't select random en-* dictionary when lang attribute is en, not en-US

Categories

(Core :: Spelling checker, enhancement, P3)

Unspecified
All
enhancement

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

Details

Attachments

(2 files)

From https://searchfox.org/mozilla-central/rev/40b561b9accbff54387edcba2b8b4a3c3828110e/editor/spellchecker/tests/test_bug1200533.html#126-127

When using <textarea lang="en">, our spell checker selects random en dictionary even if system or application is en-US locale. So if en-GB dictionary is installed in Firefox, we might select en-GB dictionary on lang=en even if Firefox is en-US package. I think we should select en-US dictionary in this situation.

So we should respect application locale and system locale for order of spellchecker.

Actually, our locale service doesn't use UTF-16 for locale name and it will
be ASCII. Although dictionary name of spell checker is locale/language name,
it still uses UTF-16. To use locale API, I should replace it with ACString.

When we don't match exactly dictionary name with lang attribute, we look for
language name. When looking for language name (ex. en/fr etc), we don't
consider the priority by application/system locale. So if lang=en, it may be
selected by character order. Most case is that en-GB is always selected if it
is installed.

We should respect application/system locale if language name is matched to
current content language before random selection.

Depends on D99336

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/40144f211b5d Part 1. Use ACString for dictionary language instead. r=masayuki https://hg.mozilla.org/integration/autoland/rev/221fabfedacb Part 2. Respect application/system locale if language code is matched. r=masayuki
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: