Improve BCP 47 language tag support (extension, singleton, privateuse)

RESOLVED FIXED in mozilla14

Status

()

Core
Spelling checker
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: GPHemsley, Assigned: GPHemsley)

Tracking

(Blocks: 1 bug)

Trunk
mozilla14
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [bcp47])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
I realized that bug 730209 doesn't support BCP 47 language tags that make use of extensions or private use subtags. At present, if such a language tag is the name of a dictionary, it will (I believe) display the entire language tag raw. A better behavior, I think, would be to simply ignore the extension and privateuse subtags if they are unsupported (which they currently are).

In addition, the tests included in that bug are not as exhaustive as they could be, so that should also be improved.

(I have code for this already; patch will be attached shortly.)
(Assignee)

Comment 1

5 years ago
Created attachment 611861 [details] [diff] [review]
Improve support for extension and privateuse subtags

Updates the regexp and adds a bunch of tests.
Attachment #611861 - Flags: review?(gavin.sharp)
Comment on attachment 611861 [details] [diff] [review]
Improve support for extension and privateuse subtags

rs=me
Attachment #611861 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 3

5 years ago
Pushed to try:
https://tbpl.mozilla.org/?tree=Try&rev=ba49a841ccef
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/62e4dcb92be0
Assignee: nobody → gphemsley
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla14
(Assignee)

Comment 5

5 years ago
Ugh, I forgot to mention explicitly that this code presupposes the code for bug 716321. Since that code is not yet in m-i/m-c, I think we'll wind up with a failing test.

The test on line 106 of toolkit/content/tests/browser/browser_InlineSpellChecker.js ('es-419') should be marked as todo_is.
Depends on: 716321
Changed the test to todo_is.
https://hg.mozilla.org/integration/mozilla-inbound/rev/031f54b05818
(Assignee)

Comment 7

5 years ago
Created attachment 612041 [details] [diff] [review]
Improve support for extension and privateuse subtags (v2)

Here's the patch with the change integrated into, in case it's needed.
Attachment #611861 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/62e4dcb92be0
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
and https://hg.mozilla.org/mozilla-central/rev/031f54b05818
(Assignee)

Updated

5 years ago
No longer depends on: 716321
You need to log in before you can comment on or make changes to this bug.