| Index: ext/common.js |
| =================================================================== |
| --- a/ext/common.js |
| +++ b/ext/common.js |
| @@ -83,16 +83,16 @@ |
| let getLocaleCandidates = function(selectedLocale) |
| { |
| let candidates = []; |
| - let defaultLocale = "en-US"; |
| + let defaultLocale = "en_US"; |
| - // e.g. "ja-jp-mac" -> "ja-JP", note that the part after the second |
| + // e.g. "ja_jp_mac" -> "ja_JP", note that the part after the second |
| // dash is dropped, since we only support language and region |
| - let parts = selectedLocale.split("-"); |
| + let parts = selectedLocale.split("_"); |
|
Sebastian Noack
2017/10/12 18:10:33
This seems wrong. window.navigator.language still
saroyanm
2017/10/12 20:26:38
Noted, done.
|
| let language = parts[0]; |
| let region = (parts[1] || "").toUpperCase(); |
| if (region) |
| - candidates.push(language + "-" + region); |
| + candidates.push(language + "_" + region); |
| candidates.push(language); |
| @@ -103,7 +103,7 @@ |
| }; |
| let selectedLocale = window.navigator.language; |
| - let match = /[?&]locale=([\w-]+)/.exec(window.location.search); |
| + let match = /[?&]locale=([\w_]+)/.exec(window.location.search); |
|
Sebastian Noack
2017/10/12 18:10:33
No need to change the semantics for the ?locale ge
saroyanm
2017/10/12 20:26:38
Right, done.
|
| if (match) |
| selectedLocale = match[1]; |
| @@ -164,7 +164,7 @@ |
| chrome.i18n = { |
| getUILanguage() |
| { |
| - return locales[0].replace(/_/g, "-"); |
| + return locales[0]; |
|
Sebastian Noack
2017/10/12 18:10:33
It seems the replacement here, has been redundant
saroyanm
2017/10/12 20:26:38
Well spotted, done.
|
| }, |
| getMessage(msgId, substitutions) |
| { |