From c82b89acc82b66140af5167cb62562f099856d09 Mon Sep 17 00:00:00 2001 From: Kartik Mistry Date: Mon, 29 Dec 2014 16:43:09 +0530 Subject: [PATCH] Update jquery.i18n to b9906c0 Changes: * Add ability to rely on default configuration when loading messages. Change-Id: Ic2c00526c0d5b1a60cac81925e2bc24228d8767c --- lib/jquery.i18n/jquery.i18n.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jquery.i18n/jquery.i18n.js b/lib/jquery.i18n/jquery.i18n.js index 461ec94b..ccd36b4c 100644 --- a/lib/jquery.i18n/jquery.i18n.js +++ b/lib/jquery.i18n/jquery.i18n.js @@ -138,10 +138,15 @@ */ load: function ( source, locale ) { var fallbackLocales, locIndex, fallbackLocale, sourceMap = {}; - + if (!source && !locale) { + source = 'i18n/' + $.i18n().locale + '.json'; + locale = $.i18n().locale; + } if ( typeof source === 'string' && source.split('.').pop() !== 'json' ) { + // Load specified locale then check for fallbacks when directory is specified in load() + sourceMap[locale] = source + '/' + locale + '.json'; fallbackLocales = ( $.i18n.fallbacks[locale] || [] ) .concat( this.options.fallbackLocale ); for ( locIndex in fallbackLocales ) {