* Dont silently fail setting new locale when it isnt available
Right now if the new locale being set is not available then it fails silently and just uses the existing global locale. A console warning would be useful to notify the user of such a failure.
* added missing semicolon
* Added console warn check.
* Fixed if condition.
* Add space
// moment.duration._locale = moment._locale = data;
globalLocale = data;
}
+ else {
+ if ((typeof console !== 'undefined') && console.warn) {
+ //warn user if arguments are passed but the locale could not be set
+ console.warn('Locale ' + key + ' not found. Did you forget to load it?');
+ }
+ }
}
return globalLocale._abbr;