diff options
Diffstat (limited to 'resources/lib/jquery.i18n/src')
4 files changed, 11 insertions, 18 deletions
diff --git a/resources/lib/jquery.i18n/src/jquery.i18n.emitter.bidi.js b/resources/lib/jquery.i18n/src/jquery.i18n.emitter.bidi.js index e245557d40dd..531f13656445 100644 --- a/resources/lib/jquery.i18n/src/jquery.i18n.emitter.bidi.js +++ b/resources/lib/jquery.i18n/src/jquery.i18n.emitter.bidi.js @@ -26,6 +26,7 @@ * Generated by UnicodeJS (see tools/strongDir) from the UCD; see * https://phabricator.wikimedia.org/diffusion/GUJS/ . */ + // eslint-disable-next-line no-misleading-character-class strongDirRegExp = new RegExp( '(?:' + '(' + diff --git a/resources/lib/jquery.i18n/src/jquery.i18n.js b/resources/lib/jquery.i18n/src/jquery.i18n.js index ef2fcc2823cb..d6c0bae611dd 100644 --- a/resources/lib/jquery.i18n/src/jquery.i18n.js +++ b/resources/lib/jquery.i18n/src/jquery.i18n.js @@ -35,8 +35,8 @@ I18N.prototype = { /** * Localize a given messageKey to a locale. - * @param {String} messageKey - * @return {String} Localized message + * @param {string} messageKey + * @return {string} Localized message */ localize: function ( messageKey ) { var localeParts, localePartIndex, locale, fallbackIndex, @@ -62,7 +62,7 @@ localePartIndex--; } while ( localePartIndex ); - if ( locale === 'en' ) { + if ( locale === this.options.fallbackLocale ) { break; } @@ -251,15 +251,9 @@ }; function getDefaultLocale() { - var nav, locale = $( 'html' ).attr( 'lang' ); - + var locale = $( 'html' ).attr( 'lang' ); if ( !locale ) { - if ( typeof window.navigator !== undefined ) { - nav = window.navigator; - locale = nav.language || nav.userLanguage || ''; - } else { - locale = ''; - } + locale = navigator.language || navigator.userLanguage || ''; } return locale; } diff --git a/resources/lib/jquery.i18n/src/jquery.i18n.language.js b/resources/lib/jquery.i18n/src/jquery.i18n.language.js index 4e34576fdbe8..daabfaf9b36b 100644 --- a/resources/lib/jquery.i18n/src/jquery.i18n.language.js +++ b/resources/lib/jquery.i18n/src/jquery.i18n.language.js @@ -474,6 +474,7 @@ lo: '໐໑໒໓໔໕໖໗໘໙', or: '୦୧୨୩୪୫୬୭୮୯', kh: '០១២៣៤៥៦៧៨៩', + nqo: '߀߁߂߃߄߅߆߇߈߉', // Note that the digits go right to left pa: '੦੧੨੩੪੫੬੭੮੯', gu: '૦૧૨૩૪૫૬૭૮૯', hi: '०१२३४५६७८९', @@ -493,6 +494,6 @@ }; $.extend( $.i18n.languages, { - 'default': language + default: language } ); }( jQuery ) ); diff --git a/resources/lib/jquery.i18n/src/jquery.i18n.messagestore.js b/resources/lib/jquery.i18n/src/jquery.i18n.messagestore.js index 350be1060e43..ba81ce523da9 100644 --- a/resources/lib/jquery.i18n/src/jquery.i18n.messagestore.js +++ b/resources/lib/jquery.i18n/src/jquery.i18n.messagestore.js @@ -61,19 +61,16 @@ */ load: function ( source, locale ) { var key = null, - deferred = null, deferreds = [], messageStore = this; if ( typeof source === 'string' ) { // This is a URL to the messages file. $.i18n.log( 'Loading messages from: ' + source ); - deferred = jsonMessageLoader( source ) - .done( function ( localization ) { - messageStore.set( locale, localization ); + return jsonMessageLoader( source ) + .then( function ( localization ) { + return messageStore.load( localization, locale ); } ); - - return deferred.promise(); } if ( locale ) { |