Fix chrome.i18n.getAcceptLanguages to *not* replace dashes with underscores in language codes

RESOLVED FIXED in Firefox 47

Status

defect
RESOLVED FIXED
3 years ago
11 months ago

People

(Reporter: bsilverberg, Assigned: bsilverberg)

Tracking

unspecified
mozilla47
Dependency tree / graph
Bug Flags:
blocking-webextensions +

Firefox Tracking Flags

(firefox47 fixed)

Details

Attachments

(1 attachment)

As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1213450#c49 and beyond, Chrome does not replace dashes `-` with underscores `_` in the return value of getAcceptLanguages() so we should also not do that replacement.
Assignee

Updated

3 years ago
Assignee: nobody → bob.silverberg
Blocks: 1246749
Status: NEW → ASSIGNED
Iteration: --- → 47.3 - Mar 7
Flags: blocking-webextensions+
Attachment #8723634 - Flags: review?(kmaglione+bmo) → review+
Comment on attachment 8723634 [details]
MozReview Request: Bug 1251289 - Fix chrome.i18n.getAcceptLanguages to *not* replace dashes with underscores in language codes, r?kmag

https://reviewboard.mozilla.org/r/36643/#review33163

Thanks!

::: toolkit/components/extensions/ExtensionUtils.jsm:439
(Diff revision 1)
>      });

`result.trim().split(/\s*,\s*/g)` would be simpler.
Depends on: 1213450
Assignee

Comment 3

3 years ago
Comment on attachment 8723634 [details]
MozReview Request: Bug 1251289 - Fix chrome.i18n.getAcceptLanguages to *not* replace dashes with underscores in language codes, r?kmag

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/36643/diff/1-2/
Assignee

Comment 4

3 years ago
https://reviewboard.mozilla.org/r/36643/#review33163

> `result.trim().split(/\s*,\s*/g)` would be simpler.

Nice. :)  I don't think I need that initial `trim()` anymore though, do I. I wrote it without it and it seems to return what I want.
Assignee

Updated

3 years ago
Keywords: checkin-needed

Comment 7

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b0b0257a6cbe
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47

Updated

11 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.