Don't break getLocaleCollation() in Firefox <54 (after a73b2403b
)
This commit is contained in:
parent
d6c36ae9a3
commit
aa05920117
1 changed files with 5 additions and 4 deletions
|
@ -1330,17 +1330,18 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
|||
}
|
||||
|
||||
if (Services.locale.getAppLocale) {
|
||||
var appLocale = Services.locale.getAppLocale();
|
||||
var locale = Services.locale.getAppLocale();
|
||||
}
|
||||
// Fx <=53
|
||||
else {
|
||||
var appLocale = Services.locale.getApplicationLocale();
|
||||
var locale = Services.locale.getApplicationLocale();
|
||||
locale = locale.getCategory('NSILOCALE_COLLATE');
|
||||
}
|
||||
|
||||
try {
|
||||
// Extract a valid language tag
|
||||
appLocale = appLocale.match(/^[a-z]{2}(\-[A-Z]{2})?/)[0];
|
||||
var collator = new Intl.Collator(appLocale, {
|
||||
locale = locale.match(/^[a-z]{2}(\-[A-Z]{2})?/)[0];
|
||||
var collator = new Intl.Collator(locale, {
|
||||
ignorePunctuation: true,
|
||||
numeric: true,
|
||||
sensitivity: 'base'
|
||||
|
|
Loading…
Reference in a new issue