From d0a5a7a0e63c1becd3c76f00d0af219458d93861 Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Wed, 3 Sep 2014 15:59:37 -0300 Subject: [PATCH] Datepicker: Use Globalize 1.0.0 - Update Globalize to 1.0.0-alpha.6 --- Gruntfile.js | 10 + bower.json | 19 +- external/cldrjs/LICENSE-MIT/LICENSE-MIT | 22 + external/cldrjs/cldr.js | 549 +++ external/cldrjs/cldr/event.js | 585 ++++ external/cldrjs/cldr/supplemental.js | 101 + external/date.js | 8 +- external/globalize/{LICENSE => LICENSE.txt} | 27 +- external/globalize/globalize.js | 1904 ++-------- external/globalize/globalize/date.js | 1254 +++++++ external/globalize/globalize/message.js | 86 + external/localization.js | 3467 ++++++++++--------- tests/unit/datepicker/datepicker.html | 38 +- ui/calendar.js | 2 +- ui/datepicker.js | 2 +- 15 files changed, 4720 insertions(+), 3354 deletions(-) create mode 100644 external/cldrjs/LICENSE-MIT/LICENSE-MIT create mode 100644 external/cldrjs/cldr.js create mode 100644 external/cldrjs/cldr/event.js create mode 100644 external/cldrjs/cldr/supplemental.js rename external/globalize/{LICENSE => LICENSE.txt} (56%) create mode 100644 external/globalize/globalize/date.js create mode 100644 external/globalize/globalize/message.js diff --git a/Gruntfile.js b/Gruntfile.js index 5d77e7393..f4c59f6d3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -276,6 +276,16 @@ grunt.initConfig({ destPrefix: "external" }, files: { + "cldrjs/cldr.js": "cldrjs/dist/cldr.js", + "cldrjs/cldr/event.js": "cldrjs/dist/cldr/event.js", + "cldrjs/cldr/supplemental.js": "cldrjs/dist/cldr/supplemental.js", + "cldrjs/LICENSE-MIT": "cldrjs/LICENSE-MIT", + + "globalize/globalize.js": "globalize/dist/globalize.js", + "globalize/globalize/date.js": "globalize/dist/globalize/date.js", + "globalize/globalize/message.js": "globalize/dist/globalize/message.js", + "globalize/LICENSE.txt": "globalize/LICENSE.txt", + "qunit/qunit.js": "qunit/qunit/qunit.js", "qunit/qunit.css": "qunit/qunit/qunit.css", "qunit/LICENSE.txt": "qunit/LICENSE.txt", diff --git a/bower.json b/bower.json index 2c8b5a6ba..ab99b8062 100644 --- a/bower.json +++ b/bower.json @@ -14,11 +14,8 @@ "jquery-mousewheel": "3.1.12", "jquery-simulate": "1.0.0", "jshint": "2.4.4", - "qunit": "1.18.0", - "qunit-assert-classes": "1.0.2", - "qunit-assert-close": "JamesMGreene/qunit-assert-close#v1.1.1", - "qunit-composite": "JamesMGreene/qunit-composite#v1.1.0", - "requirejs": "2.1.14", + "qunit": "1.17.1", + "globalize": "1.0.0-alpha.6", "jquery-1.7.0": "jquery#1.7.0", "jquery-1.7.1": "jquery#1.7.1", @@ -32,18 +29,10 @@ "jquery-1.10.0": "jquery#1.10.0", "jquery-1.10.1": "jquery#1.10.1", "jquery-1.10.2": "jquery#1.10.2", - "jquery-1.11.0": "jquery#1.11.0", - "jquery-1.11.1": "jquery#1.11.1", - "jquery-1.11.2": "jquery#1.11.2", - "jquery-1.11.3": "jquery#1.11.3", - "jquery-1.x": "jquery#1.11.3", + "jquery-1.x": "jquery#1.10.2", "jquery-2.0.0": "jquery#2.0.0", "jquery-2.0.1": "jquery#2.0.1", "jquery-2.0.2": "jquery#2.0.2", - "jquery-2.0.3": "jquery#2.0.3", - "jquery-2.1.0": "jquery#2.1.0", - "jquery-2.1.1": "jquery#2.1.1", - "jquery-2.1.2": "jquery#2.1.2", - "jquery-2.1.3": "jquery#2.1.3" + "jquery-2.0.3": "jquery#2.0.3" } } diff --git a/external/cldrjs/LICENSE-MIT/LICENSE-MIT b/external/cldrjs/LICENSE-MIT/LICENSE-MIT new file mode 100644 index 000000000..6db134a69 --- /dev/null +++ b/external/cldrjs/LICENSE-MIT/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Rafael Xavier de Souza http://rafael.xavier.blog.br + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/external/cldrjs/cldr.js b/external/cldrjs/cldr.js new file mode 100644 index 000000000..95515ba85 --- /dev/null +++ b/external/cldrjs/cldr.js @@ -0,0 +1,549 @@ +/** + * CLDR JavaScript Library v0.3.8 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-07-13T05:05Z + */ +/*! + * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( root, factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory(); + } else { + // Global + root.Cldr = factory(); + } + +}( this, function() { + + + + var arrayForEach = function( array, callback ) { + var i, length; + if ( array.forEach ) { + return array.forEach( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + callback( array[ i ], i, array ); + } + }; + + + + + var objectKeys = function( object ) { + var i, + result = []; + + if ( Object.keys ) { + return Object.keys( object ); + } + + for ( i in object ) { + result.push( i ); + } + + return result; + }; + + + + + var createError = function( code, attributes ) { + var error, message; + + message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); + error = new Error( message ); + error.code = code; + + // extend( error, attributes ); + arrayForEach( objectKeys( attributes ), function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); + + return error; + }; + + + + + var validate = function( code, check, attributes ) { + if ( !check ) { + throw createError( code, attributes ); + } + }; + + + + + var validatePresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { + name: name + }); + }; + + + + + var validateType = function( value, name, check, expected ) { + validate( "E_INVALID_PAR_TYPE", check, { + expected: expected, + name: name, + value: value + }); + }; + + + + + var arrayIsArray = Array.isArray || function( obj ) { + return Object.prototype.toString.call( obj ) === "[object Array]"; + }; + + + + + var validateTypePath = function( value, name ) { + validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); + }; + + + + + /** + * Function inspired by jQuery Core, but reduced to our use case. + */ + var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; + }; + + + + + var validateTypePlainObject = function( value, name ) { + validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); + }; + + + + + var validateTypeString = function( value, name ) { + validateType( value, name, typeof value === "string", "a string" ); + }; + + + + + var pathNormalize = function( path, attributes ) { + if ( arrayIsArray( path ) ) { + path = path.join( "/" ); + } + if ( typeof path !== "string" ) { + throw new Error( "invalid path \"" + path + "\"" ); + } + // 1: Ignore leading slash `/` + // 2: Ignore leading `cldr/` + path = path + .replace( /^\// , "" ) /* 1 */ + .replace( /^cldr\// , "" ); /* 2 */ + + // Replace {attribute}'s + path = path.replace( /{[a-zA-Z]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return attributes[ name ]; + }); + + return path.split( "/" ); + }; + + + + + var arraySome = function( array, callback ) { + var i, length; + if ( array.some ) { + return array.some( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + if ( callback( array[ i ], i, array ) ) { + return true; + } + } + return false; + }; + + + + + /** + * Return the maximized language id as defined in + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. Canonicalize. + * 1.1 Make sure the input locale is in canonical form: uses the right + * separator, and has the right casing. + * TODO Right casing? What df? It seems languages are lowercase, scripts are + * Capitalized, territory is uppercase. I am leaving this as an exercise to + * the user. + * + * 1.2 Replace any deprecated subtags with their canonical values using the + * data in supplemental metadata. Use the first value in the + * replacement list, if it exists. Language tag replacements may have multiple + * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the + * original script and/or region are retained if there is one. Thus + * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ". + * TODO What data? + * + * 1.3 If the tag is grandfathered (see in the supplemental data), then return it. + * TODO grandfathered? + * + * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur. + * 1.5 Get the components of the cleaned-up source tag (languages, scripts, + * and regions), plus any variants and extensions. + * 2. Lookup. Lookup each of the following in order, and stop on the first + * match: + * 2.1 languages_scripts_regions + * 2.2 languages_regions + * 2.3 languages_scripts + * 2.4 languages + * 2.5 und_scripts + * 3. Return + * 3.1 If there is no match, either return an error value, or the match for + * "und" (in APIs where a valid language tag is required). + * 3.2 Otherwise there is a match = languagem_scriptm_regionm + * 3.3 Let xr = xs if xs is not empty, and xm otherwise. + * 3.4 Return the language tag composed of languager _ scriptr _ regionr + + * variants + extensions. + * + * @subtags [Array] normalized language id subtags tuple (see init.js). + */ + var coreLikelySubtags = function( Cldr, cldr, subtags, options ) { + var match, matchFound, + language = subtags[ 0 ], + script = subtags[ 1 ], + sep = Cldr.localeSep, + territory = subtags[ 2 ]; + options = options || {}; + + // Skip if (language, script, territory) is not empty [3.3] + if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { + return [ language, script, territory ]; + } + + // Skip if no supplemental likelySubtags data is present + if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) { + return; + } + + // [2] + matchFound = arraySome([ + [ language, script, territory ], + [ language, territory ], + [ language, script ], + [ language ], + [ "und", script ] + ], function( test ) { + return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( sep ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( sep ) ] ); + }); + + // [3] + if ( matchFound ) { + // [3.2 .. 3.4] + match = match.split( sep ); + return [ + language !== "und" ? language : match[ 0 ], + script !== "Zzzz" ? script : match[ 1 ], + territory !== "ZZ" ? territory : match[ 2 ] + ]; + } else if ( options.force ) { + // [3.1.2] + return cldr.get( "supplemental/likelySubtags/und" ).split( sep ); + } else { + // [3.1.1] + return; + } + }; + + + + /** + * Given a locale, remove any fields that Add Likely Subtags would add. + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled, + * return it. + * 2. Remove the variants from max. + * 3. Then for trial in {language, language _ region, language _ script}. If + * AddLikelySubtags(trial) = max, then return trial + variants. + * 4. If you do not get a match, return max + variants. + * + * @maxLanguageId [Array] maxLanguageId tuple (see init.js). + */ + var coreRemoveLikelySubtags = function( Cldr, cldr, maxLanguageId ) { + var match, matchFound, + language = maxLanguageId[ 0 ], + script = maxLanguageId[ 1 ], + territory = maxLanguageId[ 2 ]; + + // [3] + matchFound = arraySome([ + [ [ language, "Zzzz", "ZZ" ], [ language ] ], + [ [ language, "Zzzz", territory ], [ language, territory ] ], + [ [ language, script, "ZZ" ], [ language, script ] ] + ], function( test ) { + var result = coreLikelySubtags( Cldr, cldr, test[ 0 ] ); + match = test[ 1 ]; + return result && result[ 0 ] === maxLanguageId[ 0 ] && + result[ 1 ] === maxLanguageId[ 1 ] && + result[ 2 ] === maxLanguageId[ 2 ]; + }); + + // [4] + return matchFound ? match : maxLanguageId; + }; + + + + + // @path: normalized path + var resourceGet = function( data, path ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + node = node[ path[ i ] ]; + if ( !node ) { + return undefined; + } + } + return node[ path[ i ] ]; + }; + + + + + var itemGetResolved = function( Cldr, path, attributes ) { + // Resolve path + var normalizedPath = pathNormalize( path, attributes ); + + return resourceGet( Cldr._resolved, normalizedPath ); + }; + + + + + var alwaysArray = function( stringOrArray ) { + return typeof stringOrArray === "string" ? [ stringOrArray ] : stringOrArray; + }; + + + var jsonMerge = (function() { + + // Returns new deeply merged JSON. + // + // Eg. + // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } ) + // -> { a: { b: 3, c: 2, d: 4 } } + // + // @arguments JSON's + // + var merge = function() { + var destination = {}, + sources = [].slice.call( arguments, 0 ); + arrayForEach( sources, function( source ) { + var prop; + for ( prop in source ) { + if ( prop in destination && arrayIsArray( destination[ prop ] ) ) { + + // Concat Arrays + destination[ prop ] = destination[ prop ].concat( source[ prop ] ); + + } else if ( prop in destination && typeof destination[ prop ] === "object" ) { + + // Merge Objects + destination[ prop ] = merge( destination[ prop ], source[ prop ] ); + + } else { + + // Set new values + destination[ prop ] = source[ prop ]; + + } + } + }); + return destination; + }; + + return merge; + +}()); + + + /** + * new Cldr() + */ + var Cldr = function( locale ) { + this.init( locale ); + }; + + // Build optimization hack to avoid duplicating functions across modules. + Cldr._alwaysArray = alwaysArray; + Cldr._createError = createError; + Cldr._itemGetResolved = itemGetResolved; + Cldr._jsonMerge = jsonMerge; + Cldr._pathNormalize = pathNormalize; + Cldr._resourceGet = resourceGet; + Cldr._validatePresence = validatePresence; + Cldr._validateType = validateType; + Cldr._validateTypePath = validateTypePath; + Cldr._validateTypePlainObject = validateTypePlainObject; + + Cldr._resolved = {}; + + // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set. + Cldr.localeSep = "-"; + + // Load resolved cldr data + // @json [JSON] + Cldr.load = function( json ) { + validatePresence( json, "json" ); + validateTypePlainObject( json, "json" ); + Cldr._resolved = jsonMerge( Cldr._resolved, json ); + }; + + /** + * .init() automatically run on instantiation/construction. + */ + Cldr.prototype.init = function( locale ) { + var language, languageId, maxLanguageId, script, territory, unicodeLanguageId, variant, + sep = Cldr.localeSep; + + validatePresence( locale, "locale" ); + validateTypeString( locale, "locale" ); + + // Normalize locale code. + // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. + // Get the variant subtags (calendar, collation, currency, etc). + // refs: + // - http://www.unicode.org/reports/tr35/#Field_Definitions + // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs + // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier + + locale = locale.replace( /-/, "_" ); + + // TODO normalize unicode locale extensions. Currently, skipped. + // unicodeLocaleExtensions = locale.split( "_u_" )[ 1 ]; + locale = locale.split( "_u_" )[ 0 ]; + + // TODO normalize transformed extensions. Currently, skipped. + // transformedExtensions = locale.split( "_t_" )[ 1 ]; + locale = locale.split( "_t_" )[ 0 ]; + + unicodeLanguageId = locale; + + // unicodeLanguageId = ... + switch ( true ) { + + // language_script_territory.. + case /^[a-z]{2,3}_[A-Z][a-z]{3}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): + language = unicodeLanguageId.split( "_" )[ 0 ]; + script = unicodeLanguageId.split( "_" )[ 1 ]; + territory = unicodeLanguageId.split( "_" )[ 2 ]; + variant = unicodeLanguageId.split( "_" )[ 3 ]; + break; + + // language_script.. + case /^[a-z]{2,3}_[A-Z][a-z]{3}(\b|_)/.test( unicodeLanguageId ): + language = unicodeLanguageId.split( "_" )[ 0 ]; + script = unicodeLanguageId.split( "_" )[ 1 ]; + territory = "ZZ"; + variant = unicodeLanguageId.split( "_" )[ 2 ]; + break; + + // language_territory.. + case /^[a-z]{2,3}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): + language = unicodeLanguageId.split( "_" )[ 0 ]; + script = "Zzzz"; + territory = unicodeLanguageId.split( "_" )[ 1 ]; + variant = unicodeLanguageId.split( "_" )[ 2 ]; + break; + + // language.., or root + case /^([a-z]{2,3}|root)(\b|_)/.test( unicodeLanguageId ): + language = unicodeLanguageId.split( "_" )[ 0 ]; + script = "Zzzz"; + territory = "ZZ"; + variant = unicodeLanguageId.split( "_" )[ 1 ]; + break; + + default: + language = "und"; + script = "Zzzz"; + territory = "ZZ"; + break; + } + + // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. + maxLanguageId = coreLikelySubtags( Cldr, this, [ language, script, territory ], { force: true } ) || unicodeLanguageId.split( "_" ); + language = maxLanguageId[ 0 ]; + script = maxLanguageId[ 1 ]; + territory = maxLanguageId[ 2 ]; + + languageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); + + // Set attributes + this.attributes = { + + // Unicode Language Id + languageId: languageId, + maxLanguageId: maxLanguageId.join( sep ), + + // Unicode Language Id Subtabs + language: language, + script: script, + territory: territory, + region: territory, /* alias */ + variant: variant + }; + + this.locale = variant ? [ languageId, variant ].join( sep ) : languageId; + }; + + /** + * .get() + */ + Cldr.prototype.get = function( path ) { + + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + return itemGetResolved( Cldr, path, this.attributes ); + }; + + /** + * .main() + */ + Cldr.prototype.main = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + path = alwaysArray( path ); + return this.get( [ "main/{languageId}" ].concat( path ) ); + }; + + return Cldr; + + + +})); diff --git a/external/cldrjs/cldr/event.js b/external/cldrjs/cldr/event.js new file mode 100644 index 000000000..46c95af53 --- /dev/null +++ b/external/cldrjs/cldr/event.js @@ -0,0 +1,585 @@ +/** + * CLDR JavaScript Library v0.3.8 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-07-13T05:05Z + */ +/*! + * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var pathNormalize = Cldr._pathNormalize, + validatePresence = Cldr._validatePresence, + validateType = Cldr._validateType; + + +/*! + * EventEmitter v4.2.7 - git.io/ee + * Oliver Caldwell + * MIT license + * @preserve + */ + +var EventEmitter; +/* jshint ignore:start */ +EventEmitter = (function () { + + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + function EventEmitter() {} + + // Shortcuts to improve speed and size + var proto = EventEmitter.prototype; + var exports = this; + var originalGlobalValue = exports.EventEmitter; + + /** + * Finds the index of the listener for the event in it's storage array. + * + * @param {Function[]} listeners Array of listeners to search through. + * @param {Function} listener Method to look for. + * @return {Number} Index of the specified listener, -1 if not found + * @api private + */ + function indexOfListener(listeners, listener) { + var i = listeners.length; + while (i--) { + if (listeners[i].listener === listener) { + return i; + } + } + + return -1; + } + + /** + * Alias a method while keeping the context correct, to allow for overwriting of target method. + * + * @param {String} name The name of the target method. + * @return {Function} The aliased method + * @api private + */ + function alias(name) { + return function aliasClosure() { + return this[name].apply(this, arguments); + }; + } + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + proto.getListeners = function getListeners(evt) { + var events = this._getEvents(); + var response; + var key; + + // Return a concatenated array of all matching events if + // the selector is a regular expression. + if (evt instanceof RegExp) { + response = {}; + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + response[key] = events[key]; + } + } + } + else { + response = events[evt] || (events[evt] = []); + } + + return response; + }; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + proto.flattenListeners = function flattenListeners(listeners) { + var flatListeners = []; + var i; + + for (i = 0; i < listeners.length; i += 1) { + flatListeners.push(listeners[i].listener); + } + + return flatListeners; + }; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in an object. + */ + proto.getListenersAsObject = function getListenersAsObject(evt) { + var listeners = this.getListeners(evt); + var response; + + if (listeners instanceof Array) { + response = {}; + response[evt] = listeners; + } + + return response || listeners; + }; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListener = function addListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var listenerIsWrapped = typeof listener === 'object'; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { + listeners[key].push(listenerIsWrapped ? listener : { + listener: listener, + once: false + }); + } + } + + return this; + }; + + /** + * Alias of addListener + */ + proto.on = alias('addListener'); + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addOnceListener = function addOnceListener(evt, listener) { + return this.addListener(evt, { + listener: listener, + once: true + }); + }; + + /** + * Alias of addOnceListener. + */ + proto.once = alias('addOnceListener'); + + /** + * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {String} evt Name of the event to create. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvent = function defineEvent(evt) { + this.getListeners(evt); + return this; + }; + + /** + * Uses defineEvent to define multiple events. + * + * @param {String[]} evts An array of event names to define. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvents = function defineEvents(evts) { + for (var i = 0; i < evts.length; i += 1) { + this.defineEvent(evts[i]); + } + return this; + }; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} evt Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListener = function removeListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var index; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + index = indexOfListener(listeners[key], listener); + + if (index !== -1) { + listeners[key].splice(index, 1); + } + } + } + + return this; + }; + + /** + * Alias of removeListener + */ + proto.off = alias('removeListener'); + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListeners = function addListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(false, evt, listeners); + }; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListeners = function removeListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(true, evt, listeners); + }; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { + var i; + var value; + var single = remove ? this.removeListener : this.addListener; + var multiple = remove ? this.removeListeners : this.addListeners; + + // If evt is an object then pass each of it's properties to this method + if (typeof evt === 'object' && !(evt instanceof RegExp)) { + for (i in evt) { + if (evt.hasOwnProperty(i) && (value = evt[i])) { + // Pass the single listener straight through to the singular method + if (typeof value === 'function') { + single.call(this, i, value); + } + else { + // Otherwise pass back to the multiple function + multiple.call(this, i, value); + } + } + } + } + else { + // So evt must be a string + // And listeners must be an array of listeners + // Loop over it and pass each one to the multiple method + i = listeners.length; + while (i--) { + single.call(this, evt, listeners[i]); + } + } + + return this; + }; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeEvent = function removeEvent(evt) { + var type = typeof evt; + var events = this._getEvents(); + var key; + + // Remove different things depending on the state of evt + if (type === 'string') { + // Remove all listeners for the specified event + delete events[evt]; + } + else if (evt instanceof RegExp) { + // Remove all events matching the regex. + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + delete events[key]; + } + } + } + else { + // Remove all listeners in all events + delete this._events; + } + + return this; + }; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + proto.removeAllListeners = alias('removeEvent'); + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emitEvent = function emitEvent(evt, args) { + var listeners = this.getListenersAsObject(evt); + var listener; + var i; + var key; + var response; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + i = listeners[key].length; + + while (i--) { + // If the listener returns true then it shall be removed from the event + // The function is executed either with a basic call or an apply if there is an args array + listener = listeners[key][i]; + + if (listener.once === true) { + this.removeListener(evt, listener.listener); + } + + response = listener.listener.apply(this, args || []); + + if (response === this._getOnceReturnValue()) { + this.removeListener(evt, listener.listener); + } + } + } + } + + return this; + }; + + /** + * Alias of emitEvent + */ + proto.trigger = alias('emitEvent'); + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {...*} Optional additional arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emit = function emit(evt) { + var args = Array.prototype.slice.call(arguments, 1); + return this.emitEvent(evt, args); + }; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {*} value The new value to check for when executing listeners. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.setOnceReturnValue = function setOnceReturnValue(value) { + this._onceReturnValue = value; + return this; + }; + + /** + * Fetches the current value to check against when executing listeners. If + * the listeners return value matches this one then it should be removed + * automatically. It will return true by default. + * + * @return {*|Boolean} The current value to check for or the default, true. + * @api private + */ + proto._getOnceReturnValue = function _getOnceReturnValue() { + if (this.hasOwnProperty('_onceReturnValue')) { + return this._onceReturnValue; + } + else { + return true; + } + }; + + /** + * Fetches the events object and creates one if required. + * + * @return {Object} The events storage object. + * @api private + */ + proto._getEvents = function _getEvents() { + return this._events || (this._events = {}); + }; + + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * + * @return {Function} Non conflicting EventEmitter class. + */ + EventEmitter.noConflict = function noConflict() { + exports.EventEmitter = originalGlobalValue; + return EventEmitter; + }; + + return EventEmitter; +}()); +/* jshint ignore:end */ + + + + var validateTypeFunction = function( value, name ) { + validateType( value, name, typeof value === "undefined" || typeof value === "function", "Function" ); + }; + + + + + var superGet, superInit, + globalEe = new EventEmitter(); + + function validateTypeEvent( value, name ) { + validateType( value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp" ); + } + + function validateThenCall( method, self ) { + return function( event, listener ) { + validatePresence( event, "event" ); + validateTypeEvent( event, "event" ); + + validatePresence( listener, "listener" ); + validateTypeFunction( listener, "listener" ); + + return self[ method ].apply( self, arguments ); + }; + } + + function off( self ) { + return validateThenCall( "off", self ); + } + + function on( self ) { + return validateThenCall( "on", self ); + } + + function once( self ) { + return validateThenCall( "once", self ); + } + + Cldr.off = off( globalEe ); + Cldr.on = on( globalEe ); + Cldr.once = once( globalEe ); + + /** + * Overload Cldr.prototype.init(). + */ + superInit = Cldr.prototype.init; + Cldr.prototype.init = function() { + var ee; + this.ee = ee = new EventEmitter(); + this.off = off( ee ); + this.on = on( ee ); + this.once = once( ee ); + superInit.apply( this, arguments ); + }; + + /** + * getOverload is encapsulated, because of cldr/unresolved. If it's loaded + * after cldr/event (and note it overwrites .get), it can trigger this + * overload again. + */ + function getOverload() { + + /** + * Overload Cldr.prototype.get(). + */ + superGet = Cldr.prototype.get; + Cldr.prototype.get = function( path ) { + var value = superGet.apply( this, arguments ); + path = pathNormalize( path, this.attributes ).join( "/" ); + globalEe.trigger( "get", [ path, value ] ); + this.ee.trigger( "get", [ path, value ] ); + return value; + }; + } + + Cldr._eventInit = getOverload; + getOverload(); + + return Cldr; + + + +})); diff --git a/external/cldrjs/cldr/supplemental.js b/external/cldrjs/cldr/supplemental.js new file mode 100644 index 000000000..989344b61 --- /dev/null +++ b/external/cldrjs/cldr/supplemental.js @@ -0,0 +1,101 @@ +/** + * CLDR JavaScript Library v0.3.8 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-07-13T05:05Z + */ +/*! + * CLDR JavaScript Library v0.3.8 2014-07-13T05:05Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var alwaysArray = Cldr._alwaysArray; + + + + + var supplementalMain = function( cldr ) { + + var prepend, supplemental; + + prepend = function( prepend ) { + return function( path ) { + path = alwaysArray( path ); + return cldr.get( [ prepend ].concat( path ) ); + }; + }; + + supplemental = prepend( "supplemental" ); + + // Week Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data + supplemental.weekData = prepend( "supplemental/weekData" ); + + supplemental.weekData.firstDay = function() { + return cldr.get( "supplemental/weekData/firstDay/{territory}" ) || + cldr.get( "supplemental/weekData/firstDay/001" ); + }; + + supplemental.weekData.minDays = function() { + var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) || + cldr.get( "supplemental/weekData/minDays/001" ); + return parseInt( minDays, 10 ); + }; + + // Time Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + supplemental.timeData = prepend( "supplemental/timeData" ); + + supplemental.timeData.allowed = function() { + return cldr.get( "supplemental/timeData/{territory}/_allowed" ) || + cldr.get( "supplemental/timeData/001/_allowed" ); + }; + + supplemental.timeData.preferred = function() { + return cldr.get( "supplemental/timeData/{territory}/_preferred" ) || + cldr.get( "supplemental/timeData/001/_preferred" ); + }; + + return supplemental; + + }; + + + + + var initSuper = Cldr.prototype.init; + + /** + * .init() automatically ran on construction. + * + * Overload .init(). + */ + Cldr.prototype.init = function() { + initSuper.apply( this, arguments ); + this.supplemental = supplementalMain( this ); + }; + + return Cldr; + + + +})); diff --git a/external/date.js b/external/date.js index 4d404efe1..6e532b008 100644 --- a/external/date.js +++ b/external/date.js @@ -121,7 +121,7 @@ $.date.prototype = { return 32 - new Date( year, month, 32 ).getDate(); }, monthName: function() { - return Globalize.format( this.dateObject, { pattern: "MMMM" } ); + return Globalize.formatDate( this.dateObject, { pattern: "MMMM" } ); }, day: function() { return this.dateObject.getDate(); @@ -157,7 +157,7 @@ $.date.prototype = { printDate = new Date( this.year(), date.getMonth(), 1 - leadDays ); for ( var row = 0; row < rows; row++ ) { var week = result[ result.length ] = { - number: Globalize.format( printDate, { pattern: "w" } ), + number: Globalize.formatDate( printDate, { pattern: "w" } ), days: [] }; for ( var dayx = 0; dayx < 7; dayx++ ) { @@ -202,7 +202,7 @@ $.date.prototype = { // TODO compare year, month, day each for better performance equal: function( other ) { function format( date ) { - return Globalize.format( date, { pattern: "yyyyMMdd" } ); + return Globalize.formatDate( date, { pattern: "yyyyMMdd" } ); } return format( this.dateObject ) === format( other ); }, @@ -210,7 +210,7 @@ $.date.prototype = { return this.dateObject; }, format: function( format ) { - return Globalize.format( this.dateObject, format || this.globalFormat ); + return Globalize.formatDate( this.dateObject, format || this.globalFormat ); } }; diff --git a/external/globalize/LICENSE b/external/globalize/LICENSE.txt similarity index 56% rename from external/globalize/LICENSE rename to external/globalize/LICENSE.txt index 9c8b02240..5dee5ca45 100644 --- a/external/globalize/LICENSE +++ b/external/globalize/LICENSE.txt @@ -1,5 +1,14 @@ -Copyright Software Freedom Conservancy, Inc. -http://jquery.org/license +Copyright 2010, 2014 jQuery Foundation and other contributors, +https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/globalize + +The following license applies to all parts of this software except as +documented below: + +==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -19,3 +28,17 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code contained within the doc directory. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. diff --git a/external/globalize/globalize.js b/external/globalize/globalize.js index 1086d339d..436729a91 100644 --- a/external/globalize/globalize.js +++ b/external/globalize/globalize.js @@ -1,1787 +1,313 @@ /*! - * Globalize v1.0.0pre + * Globalize v1.0.0-alpha.6 * * http://github.com/jquery/globalize * - * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2013-12-01T12:08Z + * Date: 2014-09-01T21:32Z */ (function( root, factory ) { + // UMD returnExports if ( typeof define === "function" && define.amd ) { - // AMD. - define( factory ); - } else if ( typeof module === "object" && typeof module.exports === "object" ) { - // Node. CommonJS. - module.exports = factory(); + + // AMD + define([ + "cldr", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ) ); } else { + // Global - root.Globalize = factory(); + root.Globalize = factory( root.Cldr ); } +}( this, function( Cldr ) { -}( this, function() { /** - * CLDR JavaScript Library v0.2.4-pre - * http://jquery.com/ - * - * Copyright 2013 Rafael Xavier de Souza - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-11-30T11:30Z - */ -/*! - * CLDR JavaScript Library v0.2.4-pre 2013-11-30T11:30Z MIT license © Rafael Xavier - * http://git.io/h4lmVg + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify */ - var Cldr = (function() { - - - - var alwaysArray = function( stringOrArray ) { - return typeof stringOrArray === "string" ? [ stringOrArray ] : stringOrArray; - }; - - - - - var common = function( Cldr ) { - - Cldr.prototype.main = function( path ) { - path = alwaysArray( path ); - return this.get( [ "main/{languageId}" ].concat( path ) ); - }; - - }; - - - - - var arrayIsArray = Array.isArray || function( obj ) { - return Object.prototype.toString.call( obj ) === "[object Array]"; - }; - - - - - var pathNormalize = function( path, attributes ) { - if ( arrayIsArray( path ) ) { - path = path.join( "/" ); - } - if ( typeof path !== "string" ) { - throw new Error( "invalid path \"" + path + "\"" ); - } - // 1: Ignore leading slash `/` - // 2: Ignore leading `cldr/` - path = path - .replace( /^\// , "" ) /* 1 */ - .replace( /^cldr\// , "" ); /* 2 */ - - // Replace {attribute}'s - path = path.replace( /{[a-zA-Z]+}/g, function( name ) { - name = name.replace( /^{([^}]*)}$/, "$1" ); - return attributes[ name ]; - }); - - return path.split( "/" ); - }; - - - - - var arraySome = function( array, callback ) { - var i, length; - if ( array.some ) { - return array.some( callback ); - } - for ( i = 0, length = array.length; i < length; i++ ) { - if ( callback( array[ i ], i, array ) ) { - return true; - } - } - return false; - }; - - - - - // Return the maximized language id as defined in - // http://www.unicode.org/reports/tr35/#Likely_Subtags - // 1. Canonicalize. - // 1.1 Make sure the input locale is in canonical form: uses the right separator, and has the right casing. - // TODO Right casing? What df? It seems languages are lowercase, scripts are Capitalized, territory is uppercase. I am leaving this as an exercise to the user. - - // 1.2 Replace any deprecated subtags with their canonical values using the data in supplemental metadata. Use the first value in the replacement list, if it exists. Language tag replacements may have multiple parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the original script and/or region are retained if there is one. Thus "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ". - // TODO What data? - - // 1.3 If the tag is grandfathered (see in the supplemental data), then return it. - // TODO grandfathered? - - // 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur. - // 1.5 Get the components of the cleaned-up source tag (languages, scripts, and regions), plus any variants and extensions. - // 2. Lookup. Lookup each of the following in order, and stop on the first match: - // 2.1 languages_scripts_regions - // 2.2 languages_regions - // 2.3 languages_scripts - // 2.4 languages - // 2.5 und_scripts - // 3. Return - // 3.1 If there is no match, either return an error value, or the match for "und" (in APIs where a valid language tag is required). - // 3.2 Otherwise there is a match = languagem_scriptm_regionm - // 3.3 Let xr = xs if xs is not empty, and xm otherwise. - // 3.4 Return the language tag composed of languager _ scriptr _ regionr + variants + extensions . - - // - // @subtags [Array] normalized language id subtags tuple (see init.js). - var likelySubtags = function( cldr, subtags, options ) { - var match, matchFound, - language = subtags[ 0 ], - script = subtags[ 1 ], - territory = subtags[ 2 ]; - options = options || {}; - - // Skip if (language, script, territory) is not empty [3.3] - if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { - return [ language, script, territory ]; - } - - // Skip if no supplemental likelySubtags data is present - if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) { - return; - } - - // [2] - matchFound = arraySome([ - [ language, script, territory ], - [ language, territory ], - [ language, script ], - [ language ], - [ "und", script ] - ], function( test ) { - return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( "_" ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( "_" ) ] ); - }); - - // [3] - if ( matchFound ) { - // [3.2 .. 3.4] - match = match.split( "_" ); - return [ - language !== "und" ? language : match[ 0 ], - script !== "Zzzz" ? script : match[ 1 ], - territory !== "ZZ" ? territory : match[ 2 ] - ]; - } else if ( options.force ) { - // [3.1.2] - return cldr.get( "supplemental/likelySubtags/und" ).split( "_" ); - } else { - // [3.1.1] - return; - } - }; - - - - // Given a locale, remove any fields that Add Likely Subtags would add. - // http://www.unicode.org/reports/tr35/#Likely_Subtags - // 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled, return it. - // 2. Remove the variants from max. - // 3. Then for trial in {language, language _ region, language _ script}. If AddLikelySubtags(trial) = max, then return trial + variants. - // 4. If you do not get a match, return max + variants. - // - // @maxLanguageId [Array] maxLanguageId tuple (see init.js). - var removeLikelySubtags = function( cldr, maxLanguageId ) { - var match, matchFound, - language = maxLanguageId[ 0 ], - script = maxLanguageId[ 1 ], - territory = maxLanguageId[ 2 ]; - - // [3] - matchFound = arraySome([ - [ [ language, "Zzzz", "ZZ" ], [ language ] ], - [ [ language, "Zzzz", territory ], [ language, territory ] ], - [ [ language, script, "ZZ" ], [ language, script ] ] - ], function( test ) { - var result = likelySubtags( cldr, test[ 0 ] ); - match = test[ 1 ]; - return result && result[ 0 ] === maxLanguageId[ 0 ] && - result[ 1 ] === maxLanguageId[ 1 ] && - result[ 2 ] === maxLanguageId[ 2 ]; - }); - - // [4] - return matchFound ? match : maxLanguageId; - }; - - - - - var supplemental = function( cldr ) { - - var prepend, supplemental; - - prepend = function( prepend ) { - return function( path ) { - path = alwaysArray( path ); - return cldr.get( [ prepend ].concat( path ) ); - }; - }; - - supplemental = prepend( "supplemental" ); - - // Week Data - // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data - supplemental.weekData = prepend( "supplemental/weekData" ); - - supplemental.weekData.firstDay = function() { - return cldr.get( "supplemental/weekData/firstDay/{territory}" ) || - cldr.get( "supplemental/weekData/firstDay/001" ); - }; - - supplemental.weekData.minDays = function() { - var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) || - cldr.get( "supplemental/weekData/minDays/001" ); - return parseInt( minDays, 10 ); - }; - - // Time Data - // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data - supplemental.timeData = prepend( "supplemental/timeData" ); - - supplemental.timeData.allowed = function() { - return cldr.get( "supplemental/timeData/{territory}/_allowed" ) || - cldr.get( "supplemental/timeData/001/_allowed" ); - }; - - supplemental.timeData.preferred = function() { - return cldr.get( "supplemental/timeData/{territory}/_preferred" ) || - cldr.get( "supplemental/timeData/001/_preferred" ); - }; - - return supplemental; - - }; - - - - - var init = function( locale ) { - var language, languageId, maxLanguageId, script, territory, unicodeLanguageId, variant; - - if ( typeof locale !== "string" ) { - throw new Error( "invalid locale type: \"" + JSON.stringify( locale ) + "\"" ); - } - - // Normalize locale code. - // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. - // Get the variant subtags (calendar, collation, currency, etc). - // refs: - // - http://www.unicode.org/reports/tr35/#Field_Definitions - // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs - // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier - - locale = locale.replace( /-/, "_" ); - - // TODO normalize unicode locale extensions. Currently, skipped. - // unicodeLocaleExtensions = locale.split( "_u_" )[ 1 ]; - locale = locale.split( "_u_" )[ 0 ]; - - // TODO normalize transformed extensions. Currently, skipped. - // transformedExtensions = locale.split( "_t_" )[ 1 ]; - locale = locale.split( "_t_" )[ 0 ]; - - unicodeLanguageId = locale; - - // unicodeLanguageId = ... - switch ( true ) { - - // language_script_territory.. - case /^[a-z]{2}_[A-Z][a-z]{3}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = unicodeLanguageId.split( "_" )[ 1 ]; - territory = unicodeLanguageId.split( "_" )[ 2 ]; - variant = unicodeLanguageId.split( "_" )[ 3 ]; - break; - - // language_script.. - case /^[a-z]{2}_[A-Z][a-z]{3}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = unicodeLanguageId.split( "_" )[ 1 ]; - territory = "ZZ"; - variant = unicodeLanguageId.split( "_" )[ 2 ]; - break; - - // language_territory.. - case /^[a-z]{2}_[A-Z0-9]{2}(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = "Zzzz"; - territory = unicodeLanguageId.split( "_" )[ 1 ]; - variant = unicodeLanguageId.split( "_" )[ 2 ]; - break; - - // language.., or root - case /^([a-z]{2}|root)(\b|_)/.test( unicodeLanguageId ): - language = unicodeLanguageId.split( "_" )[ 0 ]; - script = "Zzzz"; - territory = "ZZ"; - variant = unicodeLanguageId.split( "_" )[ 1 ]; - break; - - default: - language = "und"; - break; - } - - // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. - maxLanguageId = likelySubtags( this, [ language, script, territory ], { force: true } ) || unicodeLanguageId.split( "_" ); - language = maxLanguageId[ 0 ]; - script = maxLanguageId[ 1 ]; - territory = maxLanguageId[ 2 ]; - - // TODO json content distributed on zip file use languageId with `-` on main.. Why `-` vs. `_` ? - languageId = removeLikelySubtags( this, maxLanguageId ).join( "_" ); - - // Set attributes - this.attributes = { - - // Unicode Language Id - languageId: languageId, - maxLanguageId: maxLanguageId.join( "_" ), - - // Unicode Language Id Subtabs - language: language, - script: script, - territory: territory, - region: territory, /* alias */ - variant: variant - }; - - this.locale = variant ? [ languageId, variant ].join( "_" ) : languageId; - - // Inlcude supplemental helper - this.supplemental = supplemental( this ); - }; - - - - - // @path: normalized path - var resourceGet = function( data, path ) { - var i, - node = data, - length = path.length; - - for ( i = 0; i < length - 1; i++ ) { - node = node[ path[ i ] ]; - if ( !node ) { - return undefined; - } - } - return node[ path[ i ] ]; - }; - - - - - var bundleParentLookup = function( Cldr, locale ) { - var parent; - - if ( locale === "root" ) { - return; - } - - // First, try to find parent on supplemental data. - parent = resourceGet( Cldr._resolved, pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] ) ); - if ( parent ) { - return parent; - } - - // Or truncate locale. - parent = locale.substr( 0, locale.lastIndexOf( "_" ) ); - if ( !parent ) { - return "root"; - } - - return parent; - }; - +var toString = function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; - // @path: normalized path - var resourceSet = function( data, path, value ) { - var i, - node = data, - length = path.length; - for ( i = 0; i < length - 1; i++ ) { - if ( !node[ path[ i ] ] ) { - node[ path[ i ] ] = {}; - } - node = node[ path[ i ] ]; - } - node[ path[ i ] ] = value; - }; - - - - - var arrayForEach = function( array, callback ) { - var i, length; - if ( array.forEach ) { - return array.forEach( callback ); - } - for ( i = 0, length = array.length; i < length; i++ ) { - callback( array[ i ], i, array ); - } - }; - - - var jsonMerge = (function() { - - // Returns new deeply merged JSON. - // - // Eg. - // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } ) - // -> { a: { b: 3, c: 2, d: 4 } } - // - // @arguments JSON's - // - var merge = function() { - var destination = {}, - sources = [].slice.call( arguments, 0 ); - arrayForEach( sources, function( source ) { - var prop; - for ( prop in source ) { - if ( prop in destination && arrayIsArray( destination[ prop ] ) ) { - - // Concat Arrays - destination[ prop ] = destination[ prop ].concat( source[ prop ] ); - - } else if ( prop in destination && typeof destination[ prop ] === "object" ) { +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", 1 ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +var formatMessage = function( message, data ) { - // Merge Objects - destination[ prop ] = merge( destination[ prop ], source[ prop ] ); + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); - } else { + return message; +}; - // Set new values - destination[ prop ] = source[ prop ]; - } - } - }); - return destination; - }; - return merge; -}()); - var itemLookup = (function() { +var createError = function( code, message, attributes ) { + var error; - var lookup; + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; - lookup = function( Cldr, locale, path, attributes, childLocale ) { - var normalizedPath, parent, value; + // extend( error, attributes ); + Object.keys( attributes ).forEach(function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); - // 1: Finish recursion - // 2: Avoid infinite loop - if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) { - return; - } + return error; +}; - // Resolve path - normalizedPath = pathNormalize( path, attributes ); - // Check resolved (cached) data first - value = resourceGet( Cldr._resolved, normalizedPath ); - if ( value ) { - return value; - } - // Check raw data - value = resourceGet( Cldr._raw, normalizedPath ); - if ( !value ) { - // Or, lookup at parent locale - parent = bundleParentLookup( Cldr, locale ); - value = lookup( Cldr, parent, path, jsonMerge( attributes, { languageId: parent }), locale ); - } +var validate = function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; - // Set resolved (cached) - resourceSet( Cldr._resolved, normalizedPath, value ); - return value; - }; - return lookup; -}()); +var alwaysArray = function( stringOrArray ) { + return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : []; +}; - var itemGetResolved = function( Cldr, path, attributes ) { - // Resolve path - var normalizedPath = pathNormalize( path, attributes ); - return resourceGet( Cldr._resolved, normalizedPath ); - }; +var validateCldr = function( path, value, options ) { + var skipBoolean; + options = options || {}; + skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) { + return pathRe.test( path ); + }); + validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, { + path: path + }); +}; - var Cldr = function() { - init.apply( this, arguments ); - }; - Cldr._resolved = {}; - Cldr._raw = {}; - // Load resolved or unresolved cldr data - // @json [JSON] - Cldr.load = function( json ) { - if ( typeof json !== "object" ) { - throw new Error( "invalid json" ); - } - Cldr._raw = jsonMerge( Cldr._raw, json ); - }; - Cldr.prototype.get = function( path ) { - // Simplify locale using languageId (there are no other resource bundles) - // 1: during init(), get is called, but languageId is not defined. Use "" as a workaround in this very specific scenario. - var locale = this.attributes && this.attributes.languageId || "" /* 1 */; +var validateDefaultLocale = function( value ) { + validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.", + value !== undefined, {} ); +}; - return itemGetResolved( Cldr, path, this.attributes ) || - itemLookup( Cldr, locale, path, this.attributes ); - }; - common( Cldr ); - return Cldr; +var validateParameterPresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; -}()); - var arrayMap = function( array, callback ) { - var clone, i, length; - if ( array.map ) { - return array.map( callback ); - } - for ( clone = [], i = 0, length = array.length; i < length; i++ ) { - clone[ i ] = callback( array[ i ], i, array ); +/** + * range( value, name, minimum, maximum ) + * + * @value [Number]. + * + * @name [String] name of variable. + * + * @minimum [Number]. The lowest valid value, inclusive. + * + * @maximum [Number]. The greatest valid value, inclusive. + */ +var validateParameterRange = function( value, name, minimum, maximum ) { + validate( + "E_PAR_OUT_OF_RANGE", + "Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].", + value === undefined || value >= minimum && value <= maximum, + { + maximum: maximum, + minimum: minimum, + name: name, + value: value } - return clone; - }; + ); +}; - var objectValues = function( object ) { - var i, - result = []; - - for ( i in object ) { - result.push( object[ i ] ); +var validateParameterType = function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value } + ); +}; - return result; - }; - - - - - /** - * allPreset() - * - * @cldr [Cldr instance]. - * - * Return an Array with all (skeleton, date, time, datetime) presets. - */ - var datetimeAllPresets = function( cldr ) { - var result = []; - - // Skeleton - result = objectValues( cldr.main( "dates/calendars/gregorian/dateTimeFormats/availableFormats" ) ); - - // Time - result = result.concat( objectValues( cldr.main( "dates/calendars/gregorian/timeFormats" ) ) ); - - // Date - result = result.concat( objectValues( cldr.main( "dates/calendars/gregorian/dateFormats" ) ) ); - - // Datetime - result = result.concat( arrayMap( objectValues( cldr.main( "dates/calendars/gregorian/dateTimeFormats" ) ), function( datetimeFormat, key ) { - if ( typeof datetimeFormat !== "string" ) { - return datetimeFormat; - } - return datetimeFormat - .replace( /\{0\}/, cldr.main([ - "dates/calendars/gregorian/timeFormats", - key - ])) - .replace( /\{1\}/, cldr.main([ - "dates/calendars/gregorian/dateFormats", - key - ])); - })); - - return arrayMap( result, function( pattern ) { - return { pattern: pattern }; - }); - }; - - - - - /** - * expandPattern( pattern, cldr ) - * - * @pattern [String or Object] if String, it's considered a skeleton. Object accepts: - * - skeleton: [String] lookup availableFormat; - * - date: [String] ( "full" | "long" | "medium" | "short" ); - * - time: [String] ( "full" | "long" | "medium" | "short" ); - * - datetime: [String] ( "full" | "long" | "medium" | "short" ); - * - pattern: [String] For more info see datetime/format.js. - * - * @cldr [Cldr instance]. - * - * Return the corresponding pattern. - * Eg for "en": - * - "GyMMMd" returns "MMM d, y G"; - * - { skeleton: "GyMMMd" } returns "MMM d, y G"; - * - { date: "full" } returns "EEEE, MMMM d, y"; - * - { time: "full" } returns "h:mm:ss a zzzz"; - * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; - * - { pattern: "dd/mm" } returns "dd/mm"; - */ - var datetimeExpandPattern = function( pattern, cldr ) { - var result; - - if ( typeof pattern === "string" ) { - pattern = { skeleton: pattern }; - } - if ( typeof pattern === "object" ) { - - switch ( true ) { - case "skeleton" in pattern: - result = cldr.main([ - "dates/calendars/gregorian/dateTimeFormats/availableFormats", - pattern.skeleton - ]); - break; - - case "date" in pattern: - case "time" in pattern: - result = cldr.main([ - "dates/calendars/gregorian", - "date" in pattern ? "dateFormats" : "timeFormats", - ( pattern.date || pattern.time ) - ]); - break; - - case "datetime" in pattern: - result = cldr.main([ - "dates/calendars/gregorian/dateTimeFormats", - pattern.datetime - ]); - if ( result ) { - result = result - .replace( /\{0\}/, cldr.main([ - "dates/calendars/gregorian/timeFormats", - pattern.datetime - ])) - .replace( /\{1\}/, cldr.main([ - "dates/calendars/gregorian/dateFormats", - pattern.datetime - ])); - } - break; - - case "pattern" in pattern: - result = pattern.pattern; - break; - - default: - throw new Error( "Invalid pattern" ); - } - - } else { - throw new Error( "Invalid pattern" ); - } - - if ( !result ) { - throw new Error( "Pattern not found" ); - } - - return result; - }; +var validateParameterTypeLocale = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || value instanceof Cldr, + "String or Cldr instance" + ); +}; - var datetimeWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; - var arrayIndexOf = function( array, item ) { - if ( array.indexOf ) { - return array.indexOf( item ); - } - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[i] === item ) { - return i; - } - } - return -1; - }; - - - - - /** - * firstDayOfWeek - */ - var datetimeFirstDayOfWeek = function( cldr ) { - return arrayIndexOf( datetimeWeekDays, cldr.supplemental.weekData.firstDay() ); - }; - - - - - /** - * dayOfWeek - * - * Return the day of the week normalized by the territory's firstDay [0-6]. - * Eg for "mon": - * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); - * - return 1 if territory is US (week starts on "sun"); - * - return 2 if territory is EG (week starts on "sat"); - */ - var datetimeDayOfWeek = function( date, cldr ) { - return ( date.getDay() - datetimeFirstDayOfWeek( cldr ) + 7 ) % 7; - }; - - - - - /** - * distanceInDays( from, to ) - * - * Return the distance in days between from and to Dates. - */ - var datetimeDistanceInDays = function( from, to ) { - var inDays = 864e5; - return ( to.getTime() - from.getTime() ) / inDays; - }; - - - - - /** - * startOf - * - * Return the - */ - var datetimeStartOf = function( date, unit ) { - date = new Date( date.getTime() ); - switch( unit ) { - case "year": - date.setMonth( 0 ); - /* falls through */ - case "month": - date.setDate( 1 ); - /* falls through */ - case "day": - date.setHours( 0 ); - /* falls through */ - case "hour": - date.setMinutes( 0 ); - /* falls through */ - case "minute": - date.setSeconds( 0 ); - /* falls through */ - case "second": - date.setMilliseconds( 0 ); - } - return date; - }; - +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; - /** - * dayOfYear - * - * Return the distance in days of the date to the begin of the year [0-d]. - */ - var datetimeDayOfYear = function( date ) { - return Math.floor( datetimeDistanceInDays( datetimeStartOf( date, "year" ), date ) ); - }; +var validateParameterTypePlainObject = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ), + "Plain Object" + ); +}; - /** - * millisecondsInDay - */ - var datetimeMillisecondsInDay = function( date ) { - // TODO Handle daylight savings discontinuities - return date - datetimeStartOf( date, "day" ); - }; +var alwaysCldr = function( localeOrCldr ) { + return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr ); +}; - var datetimePatternRe = (/([a-z])\1*|'[^']+'|''|./ig); +function validateLikelySubtags( cldr ) { + cldr.once( "get", validateCldr ); + cldr.get( "supplemental/likelySubtags" ); +} - var stringPad = function( str, count, right ) { - var length; - if ( typeof str !== "string" ) { - str = String( str ); - } - for ( length = str.length; length < count; length += 1 ) { - str = ( right ? ( str + "0" ) : ( "0" + str ) ); - } - return str; - }; - - - - - /** - * format( date, pattern, cldr ) - * - * @date [Date instance]. - * - * @pattern [String] raw pattern. - * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns - * - * @cldr [Cldr instance]. - * - * TODO Support other calendar types. - * - * Disclosure: this function borrows excerpts of dojo/date/locale. - */ - var datetimeFormat = function( date, pattern, cldr ) { - var widths = [ "abbreviated", "wide", "narrow" ]; - return pattern.replace( datetimePatternRe, function( current ) { - var pad, ret, - chr = current.charAt( 0 ), - length = current.length; - - if ( chr === "j" ) { - // Locale preferred hHKk. - // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data - chr = cldr.supplemental.timeData.preferred(); - } - - switch ( chr ) { - - // Era - case "G": - ret = cldr.main([ - "dates/calendars/gregorian/eras", - length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ), - date.getFullYear() < 0 ? 0 : 1 - ]); - break; - - // Year - case "y": - // Plain year. - // The length specifies the padding, but for two letters it also specifies the maximum length. - ret = String( date.getFullYear() ); - pad = true; - if ( length === 2 ) { - ret = ret.substr( ret.length - 2 ); - } - break; - - case "Y": - // Year in "Week of Year" - // The length specifies the padding, but for two letters it also specifies the maximum length. - // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays - ret = new Date( date.getTime() ); - ret.setDate( ret.getDate() + 7 - ( datetimeDayOfWeek( date, cldr ) - datetimeFirstDayOfWeek( cldr ) ) - cldr.supplemental.weekData.minDays() ); - ret = String( ret.getFullYear() ); - pad = true; - if ( length === 2 ) { - ret = ret.substr( ret.length - 2 ); - } - break; - - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); - - // Quarter - case "Q": - case "q": - ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); - if ( length <= 2 ) { - pad = true; - } else { - // http://unicode.org/cldr/trac/ticket/6788 - ret = cldr.main([ - "dates/calendars/gregorian/quarters", - chr === "Q" ? "format" : "stand-alone", - widths[ length - 3 ], - ret - ]); - } - break; - - // Month - case "M": - case "L": - ret = date.getMonth() + 1; - if ( length <= 2 ) { - pad = true; - } else { - ret = cldr.main([ - "dates/calendars/gregorian/months", - chr === "M" ? "format" : "stand-alone", - widths[ length - 3 ], - ret - ]); - } - break; - - // Week - case "w": - // Week of Year. - // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. - // TODO should pad on ww? Not documented, but I guess so. - ret = datetimeDayOfWeek( datetimeStartOf( date, "year" ), cldr ); - ret = Math.ceil( ( datetimeDayOfYear( date ) + ret ) / 7 ) - ( 7 - ret >= cldr.supplemental.weekData.minDays() ? 0 : 1 ); - pad = true; - break; - - case "W": - // Week of Month. - // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. - ret = datetimeDayOfWeek( datetimeStartOf( date, "month" ), cldr ); - ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - ( 7 - ret >= cldr.supplemental.weekData.minDays() ? 0 : 1 ); - break; - - // Day - case "d": - ret = date.getDate(); - pad = true; - break; - - case "D": - ret = datetimeDayOfYear( date ) + 1; - pad = true; - break; - - case "F": - // Day of Week in month. eg. 2nd Wed in July. - ret = Math.floor( date.getDate() / 7 ) + 1; - break; - - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - - // Week day - case "e": - case "c": - if ( length <= 2 ) { - // Range is [1-7] (deduced by example provided on documentation) - // TODO Should pad with zeros (not specified in the docs)? - ret = datetimeDayOfWeek( date, cldr ) + 1; - pad = true; - break; - } - - /* falls through */ - case "E": - ret = datetimeWeekDays[ date.getDay() ]; - if ( length === 6 ) { - // If short day names are not explicitly specified, abbreviated day names are used instead. - // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras - // http://unicode.org/cldr/trac/ticket/6790 - ret = cldr.main([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - "short", - ret - ]) || cldr.main([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - "abbreviated", - ret - ]); - } else { - ret = cldr.main([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - widths[ length < 3 ? 0 : length - 3 ], - ret - ]); - } - break; - - // Period (AM or PM) - case "a": - ret = cldr.main([ - "dates/calendars/gregorian/dayPeriods/format/wide", - date.getHours() < 12 ? "am" : "pm" - ]); - break; - - // Hour - case "h": // 1-12 - ret = ( date.getHours() % 12 ) || 12; - pad = true; - break; - - case "H": // 0-23 - ret = date.getHours(); - pad = true; - break; - - case "K": // 0-11 - ret = date.getHours() % 12; - pad = true; - break; - - case "k": // 1-24 - ret = date.getHours() || 24; - pad = true; - break; - - // Minute - case "m": - ret = date.getMinutes(); - pad = true; - break; - - // Second - case "s": - ret = date.getSeconds(); - pad = true; - break; - - case "S": - ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); - pad = true; - break; - - case "A": - ret = Math.round( datetimeMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); - pad = true; - break; - - // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. - case "z": - case "Z": - case "O": - case "v": - case "V": - case "X": - case "x": - throw new Error( "Not implemented" ); - - // Anything else is considered a literal, including [ ,:/.'@#], chinese, japonese, and arabic characters. - default: - return current; - } - if ( pad ) { - ret = stringPad( ret, length ); - } - return ret; - }); - }; - - - - - var arrayEvery = function( array, callback ) { - var i, length; - if ( array.every ) { - return array.every( callback ); - } - for ( i = 0, length = array.length; i < length; i++ ) { - if ( !callback( array[ i ], i, array ) ) { - return false; - } - } - return true; - }; - - - - - /** - * tokenizer( value, pattern ) - * - * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": - * [{ - * type: "h", - * lexeme: "5" - * }, { - * type: "literal", - * lexeme: " " - * }, { - * type: "literal", - * lexeme: "o'clock" - * }, { - * type: "literal", - * lexeme: " " - * }, { - * type: "a", - * lexeme: "PM", - * value: "pm" - * }] - * - * OBS: lexeme's are always String and may return invalid ranges depending of the token type. Eg. "99" for month number. - * - * Return an empty Array when not successfully parsed. - */ - var datetimeTokenizer = function( value, pattern, cldr ) { - var valid, - tokens = [], - widths = [ "abbreviated", "wide", "narrow" ]; - - valid = arrayEvery( pattern.match( datetimePatternRe ), function( current ) { - var chr, length, tokenRe, - token = {}; - - function oneDigitIfLengthOne() { - if ( length === 1 ) { - return tokenRe = /\d/; - } - } - - function oneOrTwoDigitsIfLengthOne() { - if ( length === 1 ) { - return tokenRe = /\d\d?/; - } - } - - function twoDigitsIfLengthTwo() { - if ( length === 2 ) { - return tokenRe = /\d\d/; - } - } - - // Brute-force test every locale entry in an attempt to match the given value. - // Return the first found one (and set token accordingly), or null. - function lookup( path ) { - var i, re, - data = cldr.main( path ); - for ( i in data ) { - re = new RegExp( "^" + data[ i ] ); - if ( re.test( value ) ) { - token.value = i; - return tokenRe = new RegExp( data[ i ] ); - } - } - return null; - } - - token.type = current; - chr = current.charAt( 0 ), - length = current.length; - - switch ( chr ) { - - // Era - case "G": - lookup([ - "dates/calendars/gregorian/eras", - length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) - ]); - break; - - // Year - case "y": - case "Y": - // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... - if ( length === 1 ) { - tokenRe = /\d+/; - } else if ( length === 2 ) { - tokenRe = /\d\d/; - } else { - tokenRe = new RegExp( "\\d{" + length + ",}" ); - } - break; - - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); - - // Quarter - case "Q": - case "q": - // number l=1:{1}, l=2:{2}. - // lookup l=3... - oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ - "dates/calendars/gregorian/quarters", - chr === "Q" ? "format" : "stand-alone", - widths[ length - 3 ] - ]); - break; - - // Month - case "M": - case "L": - // number l=1:{1,2}, l=2:{2}. - // lookup l=3... - oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ - "dates/calendars/gregorian/months", - chr === "M" ? "format" : "stand-alone", - widths[ length - 3 ] - ]); - break; - - // Day (see d below) - case "D": - // number {l,3}. - if ( length <= 3 ) { - tokenRe = new RegExp( "\\d{" + length + ",3}" ); - } - break; - - case "W": - case "F": - // number l=1:{1}. - oneDigitIfLengthOne(); - break; - - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - - // Week day - case "e": - case "c": - // number l=1:{1}, l=2:{2}. - // lookup for length >=3. - if( length <= 2 ) { - oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); - break; - } - - /* falls through */ - case "E": - if ( length === 6 ) { - // Note: if short day names are not explicitly specified, abbreviated day names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras - lookup([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - "short" - ]) || lookup([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - "abbreviated" - ]); - } else { - lookup([ - "dates/calendars/gregorian/days", - [ chr === "c" ? "stand-alone" : "format" ], - widths[ length < 3 ? 0 : length - 3 ] - ]); - } - break; - - // Period (AM or PM) - case "a": - lookup([ - "dates/calendars/gregorian/dayPeriods/format/wide" - ]); - break; - - // Week, Day, Hour, Minute, or Second - case "w": - case "d": - case "h": - case "H": - case "K": - case "k": - case "j": - case "m": - case "s": - // number l1:{1,2}, l2:{2}. - oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); - break; - - case "S": - // number {l}. - tokenRe = new RegExp( "\\d{" + length + "}" ); - break; - - case "A": - // number {l+5}. - tokenRe = new RegExp( "\\d{" + ( length + 5 ) + "}" ); - break; - - // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. - case "z": - case "Z": - case "O": - case "v": - case "V": - case "X": - case "x": - throw new Error( "Not implemented" ); - - case "'": - token.type = "literal"; - if ( current.charAt( 1 ) === "'" ) { - tokenRe = /'/; - } else { - tokenRe = /'[^']+'/; - } - break; - - default: - token.type = "literal"; - tokenRe = /./; - } - - if ( !tokenRe ) { - return false; - } - - // Get lexeme and consume it. - value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { - token.lexeme = lexeme; - return ""; - }); - - if ( !token.lexeme ) { - return false; - } - - tokens.push( token ); - return true; - }); - - return valid ? tokens : []; - }; - - - var datetimeParse = (function() { - - function outOfRange( value, low, high ) { - return value < low || value > high; +/** + * [new] Globalize( locale|cldr ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Create a Globalize instance. + */ +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); } - /** - * parse - * - * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns - */ - return function( value, pattern, cldr ) { - var amPm, era, hour24, valid, - YEAR = 0, - MONTH = 1, - DAY = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECONDS = 6, - date = new Date(), - tokens = datetimeTokenizer( value, pattern, cldr ), - truncateAt = [], - units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; - - if ( !tokens.length ) { - return null; - } - - valid = arrayEvery( tokens, function( token ) { - var century, chr, value, length; - - if ( token.type === "literal" ) { - // continue - return true; - } - - chr = token.type.charAt( 0 ); - length = token.type.length; - - if ( chr === "j" ) { - // Locale preferred hHKk. - // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data - chr = cldr.supplemental.timeData.preferred(); - } - - switch ( chr ) { - - // Era - case "G": - truncateAt.push( YEAR ); - era = +token.value; - break; - - // Year - case "y": - value = +token.lexeme; - if ( length === 2 ) { - if ( outOfRange( value, 0, 99 ) ) { - return false; - } - // mimic dojo/date/locale: choose century to apply, according to a sliding window of 80 years before and 20 years after present year. - century = Math.floor( date.getFullYear() / 100 ) * 100; - value += century; - if ( value > date.getFullYear() + 20 ) { - value -= 100; - } - } - date.setFullYear( value ); - truncateAt.push( YEAR ); - break; - - case "Y": // Year in "Week of Year" - case "u": // Extended year. Need to be implemented. - case "U": // Cyclic year name. Need to be implemented. - throw new Error( "Not implemented" ); - - // Quarter (skip) - case "Q": - case "q": - break; - - // Month - case "M": - case "L": - if ( length <= 2 ) { - value = +token.lexeme; - } else { - value = +token.value; - } - if( outOfRange( value, 1, 12 ) ) { - return false; - } - date.setMonth( value - 1 ); - truncateAt.push( MONTH ); - break; - - // Week (skip) - case "w": // Week of Year. - case "W": // Week of Month. - break; - - // Day - case "d": - value = +token.lexeme; - if( outOfRange( value, 1, 31 ) ) { - return false; - } - date.setDate( value ); - truncateAt.push( DAY ); - break; - - case "D": - value = +token.lexeme; - if( outOfRange( value, 1, 366 ) ) { - return false; - } - date.setMonth(0); - date.setDate( value ); - truncateAt.push( DAY ); - break; - - case "F": - // Day of Week in month. eg. 2nd Wed in July. - // Skip - break; - - case "g+": - // Modified Julian day. Need to be implemented. - throw new Error( "Not implemented" ); - - // Week day - case "e": - case "c": - case "E": - // Skip. - // value = arrayIndexOf( datetimeWeekDays, token.value ); - break; - - // Period (AM or PM) - case "a": - amPm = token.value; - break; - - // Hour - case "K": // 0-11 - value = +token.lexeme + 1; - - /* falls through */ - case "h": // 1-12 - value = value || +token.lexeme; - if( outOfRange( value, 1, 12 ) ) { - return false; - } - date.setHours( value ); - truncateAt.push( HOUR ); - break; - - case "H": // 0-23 - value = +token.lexeme + 1; - - /* falls through */ - case "k": // 1-24 - hour24 = true; - value = value || +token.lexeme; - if( outOfRange( value, 1, 24 ) ) { - return false; - } - date.setHours( value ); - truncateAt.push( HOUR ); - break; - - // Minute - case "m": - value = +token.lexeme; - if( outOfRange( value, 0, 59 ) ) { - return false; - } - date.setMinutes( value ); - truncateAt.push( MINUTE ); - break; - - // Second - case "s": - value = +token.lexeme; - if( outOfRange( value, 0, 59 ) ) { - return false; - } - date.setSeconds( value ); - truncateAt.push( SECOND ); - break; - - case "A": - date.setHours( 0 ); - date.setMinutes( 0 ); - date.setSeconds( 0 ); - - /* falls through */ - case "S": - value = Math.round( +token.lexeme * Math.pow( 10, 3 - length ) ); - date.setMilliseconds( value ); - truncateAt.push( MILLISECONDS ); - break; - - // Zone - // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? - // Need to be implemented. - case "z": - case "Z": - case "O": - case "v": - case "V": - case "X": - case "x": - throw new Error( "Not implemented" ); - } - - return true; - }); - - if ( !valid || amPm && hour24 ) { - return null; - } - - if ( era === 0 ) { - // 1 BC = year 0 - date.setFullYear( date.getFullYear() * -1 + 1 ); - } - - if ( amPm === "pm" && date.getHours() !== 12 ) { - date.setHours( date.getHours() + 12 ); - } - - // Truncate date at the most precise unit defined. Eg. - // If value is "12/31", and pattern is "MM/dd": - // => new Date( , 12, 31, 0, 0, 0, 0 ); - truncateAt = Math.max.apply( null, truncateAt ); - date = datetimeStartOf( date, units[ truncateAt ] ); - - return date; - }; - -}()); - - - var arrayIsArray = Array.isArray || function( obj ) { - return Object.prototype.toString.call( obj ) === "[object Array]"; - }; - - - - - var alwaysArray = function( stringOrArray ) { - return arrayIsArray( stringOrArray ) ? stringOrArray : [ stringOrArray ]; - }; + validateParameterPresence( locale, "locale" ); + validateParameterTypeLocale( locale, "locale" ); + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); +} +/** + * Globalize.load( json ) + * + * @json [JSON] + * + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ +Globalize.load = function( json ) { + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); - var arraySome = function( array, callback ) { - var i, length; - if ( array.some ) { - return array.some( callback ); - } - for ( i = 0, length = array.length; i < length; i++ ) { - if ( callback( array[ i ], i, array ) ) { - return true; - } - } - return false; - }; - - - + Cldr.load( json ); +}; - var defaultLocale; +/** + * Globalize.locale( [locale|cldr] ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Set default Cldr instance if locale or cldr argument is passed. + * + * Return the default Cldr instance. + */ +Globalize.locale = function( locale ) { + validateParameterTypeLocale( locale, "locale" ); - function getLocale( locale ) { - return locale ? new Cldr( locale ) : defaultLocale; + if ( arguments.length ) { + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); } + return this.cldr; +}; - var Globalize = {}; - - /** - * Globalize.load( json ) - * - * @json [JSON] - * - * Load resolved or unresolved cldr data. - * Somewhat equivalent to previous Globalize.addCultureInfo(...). - */ - Globalize.load = function( json ) { - Cldr.load( json ); - }; - - /** - * Globalize.loadTranslations( locale, json ) - * - * @locale [String] - * - * @json [JSON] - * - * Load translation data per locale. - */ - Globalize.loadTranslations = function( locale, json ) { - var customData = { - "globalize-translation": {} - }; - locale = new Cldr( locale ); - customData[ "globalize-translation" ][ locale.attributes.languageId ] = json; - Cldr.load( customData ); - }; - - /** - * Globalize.locale( locale ) - * - * @locale [String] - * - * Set default locale. - * Somewhat equivalent to previous culture( selector ). - */ - Globalize.locale = function( locale ) { - if ( arguments.length ) { - defaultLocale = new Cldr( locale ); - } - return defaultLocale; - }; - - /** - * Globalize.format( value, pattern, locale ) - * - * @value [Date or Number] - * - * @pattern [String or Object] see datetime/expand_pattern for more info. - * - * @locale [String] - * - * Formats a date or number according to the given pattern string and the given locale (or the default locale if not specified). - */ - Globalize.format = function( value, pattern, locale ) { - locale = getLocale( locale ); - - if ( value instanceof Date ) { - - if ( !pattern ) { - throw new Error( "Missing pattern" ); - } - pattern = datetimeExpandPattern( pattern, locale ); - - value = datetimeFormat( value, pattern, locale ); - - } else if ( typeof value === "number" ) { - // TODO value = numberFormat( value, pattern, locale ); - throw new Error( "Number Format not implemented yet" ); - } - - return value; - }; - - /** - * Globalize.parseDate( value, patterns, locale ) - * - * @value [Date] - * - * @patterns [Array] Optional. See datetime/expand_pattern for more info about each pattern. Defaults to the list of all presets defined in the locale (see datetime/all_presets for more info). - * - * @locale [String] - * - * Return a Date instance or null. - */ - Globalize.parseDate = function( value, patterns, locale ) { - var date; - locale = getLocale( locale ); - - if ( typeof value !== "string" ) { - throw new Error( "invalid value (" + value + "), string expected" ); - } - - if ( !patterns ) { - patterns = datetimeAllPresets( locale ); - } else { - patterns = alwaysArray( patterns ); - } +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._alwaysArray = alwaysArray; +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._isPlainObject = isPlainObject; +Globalize._validate = validate; +Globalize._validateCldr = validateCldr; +Globalize._validateDefaultLocale = validateDefaultLocale; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterRange = validateParameterRange; +Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject; +Globalize._validateParameterType = validateParameterType; + +return Globalize; - arraySome( patterns, function( pattern ) { - pattern = datetimeExpandPattern( pattern, locale ); - date = datetimeParse( value, pattern, locale ); - return !!date; - }); - - return date || null; - }; - - /** - * Globalize.translate( path, locale ) - * - * @path [String or Array] - * - * @locale [String] - * - * Translate item given its path. - */ - Globalize.translate = function( path , locale ) { - locale = getLocale( locale ); - path = alwaysArray( path ); - return locale.get( [ "globalize-translation/{languageId}" ].concat( path ) ); - }; - - return Globalize; diff --git a/external/globalize/globalize/date.js b/external/globalize/globalize/date.js new file mode 100644 index 000000000..194328aeb --- /dev/null +++ b/external/globalize/globalize/date.js @@ -0,0 +1,1254 @@ +/*! + * Globalize v1.0.0-alpha.6 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-09-01T21:32Z + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + formatMessage = Globalize._formatMessage, + isPlainObject = Globalize._isPlainObject, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType; + + +var validateParameterTypeDate = function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + + + + +var validateParameterTypeDatePattern = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || isPlainObject( value ), + "String or plain Object" + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +var objectValues = function( object ) { + var i, + result = []; + + for ( i in object ) { + result.push( object[ i ] ); + } + + return result; +}; + + + + +/** + * allPreset() + * + * @cldr [Cldr instance]. + * + * Return an Array with all (skeleton, date, time, datetime) presets. + */ +var dateAllPresets = function( cldr ) { + var result = []; + + // Skeleton + result = objectValues( cldr.main( + "dates/calendars/gregorian/dateTimeFormats/availableFormats") ); + + // Time + result = result.concat( objectValues( cldr.main( "dates/calendars/gregorian/timeFormats" ) ) ); + + // Date + result = result.concat( objectValues( cldr.main( "dates/calendars/gregorian/dateFormats" ) ) ); + + // Datetime + result = result.concat( + objectValues( cldr.main( + "dates/calendars/gregorian/dateTimeFormats" + )).map(function( datetimeFormat, key ) { + if ( typeof datetimeFormat !== "string" ) { + return datetimeFormat; + } + return formatMessage( datetimeFormat, [ + cldr.main([ + "dates/calendars/gregorian/timeFormats", + key + ]), + cldr.main([ + "dates/calendars/gregorian/dateFormats", + key + ]) + ]); + }) + ); + + return result.map(function( pattern ) { + return { pattern: pattern }; + }); +}; + + + + +var createErrorInvalidParameterValue = function( name, value ) { + return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { + name: name, + value: value + }); +}; + + + + +/** + * expandPattern( pattern, cldr ) + * + * @pattern [String or Object] if String, it's considered a skeleton. Object accepts: + * - skeleton: [String] lookup availableFormat; + * - date: [String] ( "full" | "long" | "medium" | "short" ); + * - time: [String] ( "full" | "long" | "medium" | "short" ); + * - datetime: [String] ( "full" | "long" | "medium" | "short" ); + * - pattern: [String] For more info see datetime/format.js. + * + * @cldr [Cldr instance]. + * + * Return the corresponding pattern. + * Eg for "en": + * - "GyMMMd" returns "MMM d, y G"; + * - { skeleton: "GyMMMd" } returns "MMM d, y G"; + * - { date: "full" } returns "EEEE, MMMM d, y"; + * - { time: "full" } returns "h:mm:ss a zzzz"; + * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; + * - { pattern: "dd/mm" } returns "dd/mm"; + */ +var dateExpandPattern = function( pattern, cldr ) { + var result; + + if ( typeof pattern === "string" ) { + pattern = { skeleton: pattern }; + } + + switch ( true ) { + case "skeleton" in pattern: + result = cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + pattern.skeleton + ]); + break; + + case "date" in pattern: + case "time" in pattern: + result = cldr.main([ + "dates/calendars/gregorian", + "date" in pattern ? "dateFormats" : "timeFormats", + ( pattern.date || pattern.time ) + ]); + break; + + case "datetime" in pattern: + result = cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + pattern.datetime + ]); + if ( result ) { + result = formatMessage( result, [ + cldr.main([ + "dates/calendars/gregorian/timeFormats", + pattern.datetime + ]), + cldr.main([ + "dates/calendars/gregorian/dateFormats", + pattern.datetime + ]) + ]); + } + break; + + case "pattern" in pattern: + result = pattern.pattern; + break; + + default: + throw createErrorInvalidParameterValue({ + name: "pattern", + value: pattern + }); + } + + return result; +}; + + + + +var dateWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + + + + +/** + * firstDayOfWeek + */ +var dateFirstDayOfWeek = function( cldr ) { + return dateWeekDays.indexOf( cldr.supplemental.weekData.firstDay() ); +}; + + + + +/** + * dayOfWeek + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +var dateDayOfWeek = function( date, cldr ) { + return ( date.getDay() - dateFirstDayOfWeek( cldr ) + 7 ) % 7; +}; + + + + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +var dateDistanceInDays = function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + + + + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +var dateStartOf = function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + + + + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +var dateDayOfYear = function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + + + + +/** + * millisecondsInDay + */ +var dateMillisecondsInDay = function( date ) { + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + + + + +var datePatternRe = (/([a-z])\1*|'[^']+'|''|./ig); + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + +/** + * format( date, pattern, cldr ) + * + * @date [Date instance]. + * + * @pattern [String] raw pattern. + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + * + * @cldr [Cldr instance]. + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +var dateFormat = function( date, pattern, cldr ) { + var widths = [ "abbreviated", "wide", "narrow" ]; + return pattern.replace( datePatternRe, function( current ) { + var pad, ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = cldr.supplemental.timeData.preferred(); + } + + switch ( chr ) { + + // Era + case "G": + ret = cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ), + date.getFullYear() < 0 ? 0 : 1 + ]); + break; + + // Year + case "y": + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = String( date.getFullYear() ); + pad = true; + if ( length === 2 ) { + ret = ret.substr( ret.length - 2 ); + } + break; + + case "Y": + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, cldr ) - + dateFirstDayOfWeek( cldr ) - + cldr.supplemental.weekData.minDays() + ); + ret = String( ret.getFullYear() ); + pad = true; + if ( length === 2 ) { + ret = ret.substr( ret.length - 2 ); + } + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw new Error( "Not implemented" ); + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length <= 2 ) { + pad = true; + } else { + // http://unicode.org/cldr/trac/ticket/6788 + ret = cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ], + ret + ]); + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length <= 2 ) { + pad = true; + } else { + ret = cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ], + ret + ]); + } + break; + + // Week + case "w": + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), cldr ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= cldr.supplemental.weekData.minDays() ? 0 : 1 ); + pad = true; + break; + + case "W": + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), cldr ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= cldr.supplemental.weekData.minDays() ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + pad = true; + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + pad = true; + break; + + case "F": + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + case "g+": + // Modified Julian day. Need to be implemented. + throw new Error( "Not implemented" ); + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, cldr ) + 1; + pad = true; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + if ( length === 6 ) { + // If short day names are not explicitly specified, abbreviated day names are + // used instead. + // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // http://unicode.org/cldr/trac/ticket/6790 + ret = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "short", + ret + ]) || cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "abbreviated", + ret + ]); + } else { + ret = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + widths[ length < 3 ? 0 : length - 3 ], + ret + ]); + } + break; + + // Period (AM or PM) + case "a": + ret = cldr.main([ + "dates/calendars/gregorian/dayPeriods/format/wide", + date.getHours() < 12 ? "am" : "pm" + ]); + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + pad = true; + break; + + case "H": // 0-23 + ret = date.getHours(); + pad = true; + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + pad = true; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + pad = true; + break; + + // Minute + case "m": + ret = date.getMinutes(); + pad = true; + break; + + // Second + case "s": + ret = date.getSeconds(); + pad = true; + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + pad = true; + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + pad = true; + break; + + // Zone + // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? + // Need to be implemented. + case "z": + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": + throw new Error( "Not implemented" ); + + // Anything else is considered a literal, including [ ,:/.'@#], chinese, japonese, and + // arabic characters. + default: + return current; + } + if ( pad ) { + ret = stringPad( ret, length ); + } + return ret; + }); +}; + + + + +/** + * tokenizer( value, pattern ) + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +var dateTokenizer = function( value, pattern, cldr ) { + var valid, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = pattern.match( datePatternRe ).every(function( current ) { + var chr, length, tokenRe, + token = {}; + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + return tokenRe = /\d/; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + return tokenRe = /\d\d?/; + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + return tokenRe = /\d\d/; + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = cldr.main( path ); + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + switch ( chr ) { + + // Era + case "G": + lookup([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + tokenRe = /\d+/; + } else if ( length === 2 ) { + tokenRe = /\d\d/; + } else { + tokenRe = new RegExp( "\\d{" + length + ",}" ); + } + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw new Error( "Not implemented" ); + + // Quarter + case "Q": + case "q": + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day (see d below) + case "D": + // number {l,3}. + if ( length <= 3 ) { + tokenRe = new RegExp( "\\d{" + length + ",3}" ); + } + break; + + case "W": + case "F": + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + case "g+": + // Modified Julian day. Need to be implemented. + throw new Error( "Not implemented" ); + + // Week day + case "e": + case "c": + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "dates/calendars/gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + // number {l}. + tokenRe = new RegExp( "\\d{" + length + "}" ); + break; + + case "A": + // number {l+5}. + tokenRe = new RegExp( "\\d{" + ( length + 5 ) + "}" ); + break; + + // Zone + // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? + // Need to be implemented. + case "z": + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": + throw new Error( "Not implemented" ); + + case "'": + token.type = "literal"; + if ( current.charAt( 1 ) === "'" ) { + tokenRe = /'/; + } else { + tokenRe = /'[^']+'/; + } + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + return valid ? tokens : []; +}; + + + + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +var dateSetDate = function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + + + + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +var dateSetMonth = function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + + +var dateParse = (function() { + +function outOfRange( value, low, high ) { + return value < low || value > high; +} + +/** + * parse + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +return function( value, pattern, cldr ) { + var amPm, era, hour, hour12, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + tokens = dateTokenizer( value, pattern, cldr ), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = cldr.supplemental.timeData.preferred(); + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = +token.lexeme; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw new Error( "Not implemented" ); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = +token.lexeme; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + dateSetMonth( date, value - 1 ); + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + value = +token.lexeme; + if ( outOfRange( value, 1, 31 ) ) { + return false; + } + dateSetDate( date, value ); + truncateAt.push( DAY ); + break; + + case "D": + value = +token.lexeme; + if ( outOfRange( value, 1, 366 ) ) { + return false; + } + date.setMonth(0); + date.setDate( value ); + truncateAt.push( DAY ); + break; + + case "F": + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + case "g+": + // Modified Julian day. Need to be implemented. + throw new Error( "Not implemented" ); + + // Week day + case "e": + case "c": + case "E": + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = +token.lexeme; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = +token.lexeme; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = +token.lexeme; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = +token.lexeme; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = +token.lexeme; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = +token.lexeme; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( +token.lexeme * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + // see http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names ? + // Need to be implemented. + case "z": + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": + throw new Error( "Not implemented" ); + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + +}()); + + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /dates\/calendars\/gregorian\/days\/.*\/short/, + /supplemental\/timeData\/(?!001)/, + /supplemental\/weekData\/(?!001)/ + ] + }); +} + +/** + * .formatDate( value, pattern ) + * + * @value [Date] + * + * @pattern [String or Object] see date/expand_pattern for more info. + * + * Formats a date or number according to the given pattern string and the default/instance locale. + */ +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, pattern ) { + var cldr, ret; + + validateParameterPresence( value, "value" ); + validateParameterPresence( pattern, "pattern" ); + validateParameterTypeDate( value, "value" ); + validateParameterTypeDatePattern( pattern, "pattern" ); + + cldr = this.cldr; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( pattern, cldr ); + ret = dateFormat( value, pattern, cldr ); + cldr.off( "get", validateRequiredCldr ); + + return ret; +}; + +/** + * .parseDate( value, patterns ) + * + * @value [String] + * + * @patterns [Array] Optional. See date/expand_pattern for more info about each pattern. Defaults + * to the list of all presets defined in the locale (see date/all_presets for more info). + * + * Return a Date instance or null. + */ +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, patterns ) { + var cldr, date; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + cldr = this.cldr; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + + if ( !patterns ) { + patterns = dateAllPresets( cldr ); + } else { + patterns = alwaysArray( patterns ); + } + + patterns.some(function( pattern ) { + validateParameterTypeDatePattern( pattern, "patterns" ); + pattern = dateExpandPattern( pattern, cldr ); + date = dateParse( value, pattern, cldr ); + return !!date; + }); + + cldr.off( "get", validateRequiredCldr ); + + return date || null; +}; + +return Globalize; + + + + +})); diff --git a/external/globalize/globalize/message.js b/external/globalize/globalize/message.js new file mode 100644 index 000000000..e27839900 --- /dev/null +++ b/external/globalize/globalize/message.js @@ -0,0 +1,86 @@ +/*! + * Globalize v1.0.0-alpha.6 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-09-01T21:32Z + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +/** + * .loadTranslations( json ) + * + * @json [JSON] + * + * Load translation data. + */ +Globalize.loadTranslations = function( json ) { + var customData = { + "globalize-translations": json + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + Cldr.load( customData ); +}; + +/** + * .translate( path ) + * + * @path [String or Array] + * + * Translate item given its path. + */ +Globalize.translate = +Globalize.prototype.translate = function( path ) { + var cldr; + + validateParameterPresence( path, "path" ); + validateParameterType( path, "path", typeof path === "string" || Array.isArray( path ), + "a String nor an Array" ); + + path = alwaysArray( path ); + cldr = this.cldr; + + validateDefaultLocale( cldr ); + + return cldr.get( [ "globalize-translations/{languageId}" ].concat( path ) ); +}; + +return Globalize; + + + + +})); diff --git a/external/localization.js b/external/localization.js index a03fcd9b4..5ca10eea5 100644 --- a/external/localization.js +++ b/external/localization.js @@ -1,30 +1,17 @@ /** - * CLDR locale data + * CLDR data */ -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ - "globalize" - ], factory ); - } else { - - // Browser globals - factory( Globalize ); - } -}( function( Globalize ) { Globalize.load({ "main": { "en": { "identity": { "version": { - "_cldrVersion": "24", - "_number": "$Revision: 9287 $" + "_cldrVersion": "25", + "_number": "$Revision: 91 $" }, "generation": { - "_date": "$Date: 2013-08-28 21:32:04 -0500 (Wed, 28 Aug 2013) $" + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" }, "language": "en" }, @@ -245,47 +232,43 @@ Globalize.load({ "format": { "abbreviated": { "am": "AM", - "am-alt-variant": "a.m.", + "am-alt-variant": "am", "noon": "noon", "pm": "PM", - "pm-alt-variant": "p.m." + "pm-alt-variant": "pm" }, "narrow": { "am": "a", - "am-alt-variant": "a.m.", "noon": "n", - "pm": "p", - "pm-alt-variant": "p.m." + "pm": "p" }, "wide": { "am": "AM", - "am-alt-variant": "a.m.", + "am-alt-variant": "am", "noon": "noon", "pm": "PM", - "pm-alt-variant": "p.m." + "pm-alt-variant": "pm" } }, "stand-alone": { "abbreviated": { "am": "AM", - "am-alt-variant": "a.m.", + "am-alt-variant": "am", "noon": "noon", "pm": "PM", - "pm-alt-variant": "p.m." + "pm-alt-variant": "pm" }, "narrow": { "am": "a", - "am-alt-variant": "a.m.", "noon": "n", - "pm": "p", - "pm-alt-variant": "p.m." + "pm": "p" }, "wide": { "am": "AM", - "am-alt-variant": "a.m.", + "am-alt-variant": "am", "noon": "noon", "pm": "PM", - "pm-alt-variant": "p.m." + "pm-alt-variant": "pm" } } }, @@ -327,36 +310,36 @@ Globalize.load({ "medium": "{1}, {0}", "short": "{1}, {0}", "availableFormats": { - "d": "d", + "EHm": "E HH:mm", + "EHms": "E HH:mm:ss", "Ed": "d E", "Ehm": "E h:mm a", - "EHm": "E HH:mm", "Ehms": "E h:mm:ss a", - "EHms": "E HH:mm:ss", "Gy": "y G", "GyMMM": "MMM y G", - "GyMMMd": "MMM d, y G", "GyMMMEd": "E, MMM d, y G", - "h": "h a", + "GyMMMd": "MMM d, y G", "H": "HH", - "hm": "h:mm a", "Hm": "HH:mm", - "hms": "h:mm:ss a", "Hms": "HH:mm:ss", "M": "L", - "Md": "M/d", "MEd": "E, M/d", "MMM": "LLL", - "MMMd": "MMM d", "MMMEd": "E, MMM d", + "MMMd": "MMM d", + "Md": "M/d", + "d": "d", + "h": "h a", + "hm": "h:mm a", + "hms": "h:mm:ss a", "ms": "mm:ss", "y": "y", "yM": "M/y", - "yMd": "M/d/y", "yMEd": "E, M/d/y", "yMMM": "MMM y", - "yMMMd": "MMM d, y", "yMMMEd": "E, MMM d, y", + "yMMMd": "MMM d, y", + "yMd": "M/d/y", "yQQQ": "QQQ y", "yQQQQ": "QQQQ y" }, @@ -375,62 +358,62 @@ Globalize.load({ }, "intervalFormats": { "intervalFormatFallback": "{0} – {1}", - "d": { - "d": "d – d" - }, - "h": { - "a": "h a – h a", - "h": "h – h a" - }, "H": { "H": "HH – HH" }, - "hm": { - "a": "h:mm a – h:mm a", - "h": "h:mm – h:mm a", - "m": "h:mm – h:mm a" - }, "Hm": { "H": "HH:mm – HH:mm", "m": "HH:mm – HH:mm" }, - "hmv": { - "a": "h:mm a – h:mm a v", - "h": "h:mm – h:mm a v", - "m": "h:mm – h:mm a v" - }, "Hmv": { "H": "HH:mm – HH:mm v", "m": "HH:mm – HH:mm v" }, - "hv": { - "a": "h a – h a v", - "h": "h – h a v" - }, "Hv": { "H": "HH – HH v" }, "M": { "M": "M – M" }, - "Md": { - "d": "M/d – M/d", - "M": "M/d – M/d" - }, "MEd": { - "d": "E, M/d – E, M/d", - "M": "E, M/d – E, M/d" + "M": "E, M/d – E, M/d", + "d": "E, M/d – E, M/d" }, "MMM": { "M": "MMM – MMM" }, + "MMMEd": { + "M": "E, MMM d – E, MMM d", + "d": "E, MMM d – E, MMM d" + }, "MMMd": { - "d": "MMM d – d", - "M": "MMM d – MMM d" + "M": "MMM d – MMM d", + "d": "MMM d – d" }, - "MMMEd": { - "d": "E, MMM d – E, MMM d", - "M": "E, MMM d – E, MMM d" + "Md": { + "M": "M/d – M/d", + "d": "M/d – M/d" + }, + "d": { + "d": "d – d" + }, + "h": { + "a": "h a – h a", + "h": "h – h a" + }, + "hm": { + "a": "h:mm a – h:mm a", + "h": "h:mm – h:mm a", + "m": "h:mm – h:mm a" + }, + "hmv": { + "a": "h:mm a – h:mm a v", + "h": "h:mm – h:mm a v", + "m": "h:mm – h:mm a v" + }, + "hv": { + "a": "h a – h a v", + "h": "h – h a v" }, "y": { "y": "y – y" @@ -439,33 +422,33 @@ Globalize.load({ "M": "M/y – M/y", "y": "M/y – M/y" }, - "yMd": { - "d": "M/d/y – M/d/y", - "M": "M/d/y – M/d/y", - "y": "M/d/y – M/d/y" - }, "yMEd": { - "d": "E, M/d/y – E, M/d/y", "M": "E, M/d/y – E, M/d/y", + "d": "E, M/d/y – E, M/d/y", "y": "E, M/d/y – E, M/d/y" }, "yMMM": { "M": "MMM – MMM y", "y": "MMM y – MMM y" }, - "yMMMd": { - "d": "MMM d – d, y", - "M": "MMM d – MMM d, y", - "y": "MMM d, y – MMM d, y" - }, "yMMMEd": { - "d": "E, MMM d – E, MMM d, y", "M": "E, MMM d – E, MMM d, y", + "d": "E, MMM d – E, MMM d, y", "y": "E, MMM d, y – E, MMM d, y" }, "yMMMM": { "M": "MMMM – MMMM y", "y": "MMMM y – MMMM y" + }, + "yMMMd": { + "M": "MMM d – MMM d, y", + "d": "MMM d – d, y", + "y": "MMM d, y – MMM d, y" + }, + "yMd": { + "M": "M/d/y – M/d/y", + "d": "M/d/y – M/d/y", + "y": "M/d/y – M/d/y" } } } @@ -481,11 +464,11 @@ Globalize.load({ "de": { "identity": { "version": { - "_cldrVersion": "24", - "_number": "$Revision: 9287 $" + "_cldrVersion": "25", + "_number": "$Revision: 91 $" }, "generation": { - "_date": "$Date: 2013-08-28 21:32:04 -0500 (Wed, 28 Aug 2013) $" + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" }, "language": "de" }, @@ -715,14 +698,9 @@ Globalize.load({ "pm": "nachm." }, "narrow": { - "afternoon": "nachmittags", - "am": "vorm.", - "earlyMorning": "morgens", - "evening": "abends", - "morning": "vormittags", - "night": "nachts", - "noon": "Mittag", - "pm": "nachm." + "am": "a", + "noon": "n", + "pm": "p" }, "wide": { "afternoon": "nachmittags", @@ -747,14 +725,9 @@ Globalize.load({ "pm": "nachm." }, "narrow": { - "afternoon": "nachmittags", - "am": "vorm.", - "earlyMorning": "morgens", - "evening": "abends", - "morning": "vormittags", - "night": "nachts", - "noon": "Mittag", - "pm": "nachm." + "am": "a", + "noon": "n", + "pm": "p" }, "wide": { "afternoon": "Nachmittag", @@ -806,43 +779,42 @@ Globalize.load({ "medium": "{1} {0}", "short": "{1} {0}", "availableFormats": { - "d": "d", + "EHm": "E, HH:mm", + "EHms": "E, HH:mm:ss", "Ed": "E, d.", "Ehm": "E h:mm a", - "EHm": "E, HH:mm", "Ehms": "E, h:mm:ss a", - "EHms": "E, HH:mm:ss", "Gy": "y G", "GyMMM": "MMM y G", - "GyMMMd": "d. MMM y G", "GyMMMEd": "E, d. MMM y G", - "h": "h a", + "GyMMMd": "d. MMM y G", "H": "HH 'Uhr'", - "hm": "h:mm a", "Hm": "HH:mm", - "hms": "h:mm:ss a", "Hms": "HH:mm:ss", "M": "L", - "Md": "d.M.", "MEd": "E, d.M.", - "MMd": "d.MM.", - "MMdd": "dd.MM.", "MMM": "LLL", - "MMMd": "d. MMM", "MMMEd": "E, d. MMM", - "MMMMdd": "dd. MMMM", "MMMMEd": "E, d. MMMM", + "MMMd": "d. MMM", + "MMd": "d.MM.", + "MMdd": "dd.MM.", + "Md": "d.M.", + "d": "d", + "h": "h a", + "hm": "h:mm a", + "hms": "h:mm:ss a", "ms": "mm:ss", "y": "y", "yM": "M.y", - "yMd": "d.M.y", "yMEd": "E, d.M.y", "yMM": "MM.y", - "yMMdd": "dd.MM.y", "yMMM": "MMM y", - "yMMMd": "d. MMM y", "yMMMEd": "E, d. MMM y", "yMMMM": "MMMM y", + "yMMMd": "d. MMM y", + "yMMdd": "dd.MM.y", + "yMd": "d.M.y", "yQQQ": "QQQ y", "yQQQQ": "QQQQ y" }, @@ -861,66 +833,66 @@ Globalize.load({ }, "intervalFormats": { "intervalFormatFallback": "{0} - {1}", - "d": { - "d": "d.-d." - }, - "h": { - "a": "h a - h a", - "h": "h-h a" - }, "H": { "H": "HH-HH 'Uhr'" }, - "hm": { - "a": "h:mm a - h:mm a", - "h": "h:mm-h:mm a", - "m": "h:mm-h:mm a" - }, "Hm": { "H": "HH:mm-HH:mm", "m": "HH:mm-HH:mm" }, - "hmv": { - "a": "h:mm a - h:mm a v", - "h": "h:mm-h:mm a v", - "m": "h:mm-h:mm a v" - }, "Hmv": { "H": "HH:mm-HH:mm v", "m": "HH:mm-HH:mm v" }, - "hv": { - "a": "h a - h a v", - "h": "h-h a v" - }, "Hv": { "H": "HH-HH 'Uhr' v" }, "M": { "M": "M.-M." }, - "Md": { - "d": "dd.MM. - dd.MM.", - "M": "dd.MM. - dd.MM." - }, "MEd": { - "d": "E, dd.MM. - E, dd.MM.", - "M": "E, dd.MM. - E, dd.MM." + "M": "E, dd.MM. - E, dd.MM.", + "d": "E, dd.MM. - E, dd.MM." }, "MMM": { "M": "MMM-MMM" }, - "MMMd": { - "d": "d.-d. MMM", - "M": "d. MMM - d. MMM" - }, "MMMEd": { - "d": "E, d. - E, d. MMM", - "M": "E, d. MMM - E, d. MMM" + "M": "E, d. MMM - E, d. MMM", + "d": "E, d. - E, d. MMM" }, "MMMM": { "M": "LLLL-LLLL" }, + "MMMd": { + "M": "d. MMM - d. MMM", + "d": "d.-d. MMM" + }, + "Md": { + "M": "dd.MM. - dd.MM.", + "d": "dd.MM. - dd.MM." + }, + "d": { + "d": "d.-d." + }, + "h": { + "a": "h a - h a", + "h": "h-h a" + }, + "hm": { + "a": "h:mm a - h:mm a", + "h": "h:mm-h:mm a", + "m": "h:mm-h:mm a" + }, + "hmv": { + "a": "h:mm a - h:mm a v", + "h": "h:mm-h:mm a v", + "m": "h:mm-h:mm a v" + }, + "hv": { + "a": "h a - h a v", + "h": "h-h a v" + }, "y": { "y": "y-y" }, @@ -928,33 +900,33 @@ Globalize.load({ "M": "MM.y - MM.y", "y": "MM.y - MM.y" }, - "yMd": { - "d": "dd.MM.y - dd.MM.y", - "M": "dd.MM.y - dd.MM.y", - "y": "dd.MM.y - dd.MM.y" - }, "yMEd": { - "d": "E, dd.MM.y - E, dd.MM.y", "M": "E, dd.MM.y - E, dd.MM.y", + "d": "E, dd.MM.y - E, dd.MM.y", "y": "E, dd.MM.y - E, dd.MM.y" }, "yMMM": { "M": "MMM-MMM y", "y": "MMM y - MMM y" }, - "yMMMd": { - "d": "d.-d. MMM y", - "M": "d. MMM - d. MMM y", - "y": "d. MMM y - d. MMM y" - }, "yMMMEd": { - "d": "E, d. - E, d. MMM y", "M": "E, d. MMM - E, d. MMM y", + "d": "E, d. - E, d. MMM y", "y": "E, d. MMM y - E, d. MMM y" }, "yMMMM": { "M": "MMMM-MMMM y", "y": "MMMM y - MMMM y" + }, + "yMMMd": { + "M": "d. MMM - d. MMM y", + "d": "d.-d. MMM y", + "y": "d. MMM y - d. MMM y" + }, + "yMd": { + "M": "dd.MM.y - dd.MM.y", + "d": "dd.MM.y - dd.MM.y", + "y": "dd.MM.y - dd.MM.y" } } } @@ -965,1134 +937,985 @@ Globalize.load({ } }); -/** - * CLDR supplemental data - */ - -// likelySubtags Globalize.load({ - "supplemental": { - "version": { - "_cldrVersion": "24", - "_number": "$Revision: 9305 $" - }, - "generation": { - "_date": "$Date: 2013-09-04 09:50:17 -0500 (Wed, 04 Sep 2013) $" - }, - "likelySubtags": { - "aa": "aa_Latn_ET", - "ab": "ab_Cyrl_GE", - "ace": "ace_Latn_ID", - "ady": "ady_Cyrl_RU", - "af": "af_Latn_ZA", - "agq": "agq_Latn_CM", - "ak": "ak_Latn_GH", - "alt": "alt_Cyrl_RU", - "am": "am_Ethi_ET", - "amo": "amo_Latn_NG", - "ar": "ar_Arab_EG", - "as": "as_Beng_IN", - "asa": "asa_Latn_TZ", - "ast": "ast_Latn_ES", - "av": "av_Cyrl_RU", - "awa": "awa_Deva_IN", - "ay": "ay_Latn_BO", - "az": "az_Latn_AZ", - "az_Arab": "az_Arab_IR", - "az_IR": "az_Arab_IR", - "az_RU": "az_Cyrl_RU", - "ba": "ba_Cyrl_RU", - "bal": "bal_Arab_PK", - "ban": "ban_Latn_ID", - "bas": "bas_Latn_CM", - "bax": "bax_Bamu_CM", - "bbc": "bbc_Latn_ID", - "be": "be_Cyrl_BY", - "bem": "bem_Latn_ZM", - "bez": "bez_Latn_TZ", - "bfq": "bfq_Taml_IN", - "bft": "bft_Arab_PK", - "bfy": "bfy_Deva_IN", - "bg": "bg_Cyrl_BG", - "bhb": "bhb_Deva_IN", - "bho": "bho_Deva_IN", - "bi": "bi_Latn_VU", - "bik": "bik_Latn_PH", - "bin": "bin_Latn_NG", - "bjj": "bjj_Deva_IN", - "bku": "bku_Latn_PH", - "bm": "bm_Latn_ML", - "bn": "bn_Beng_BD", - "bo": "bo_Tibt_CN", - "bqv": "bqv_Latn_CI", - "br": "br_Latn_FR", - "bra": "bra_Deva_IN", - "brx": "brx_Deva_IN", - "bs": "bs_Latn_BA", - "bss": "bss_Latn_CM", - "btv": "btv_Deva_PK", - "bua": "bua_Cyrl_RU", - "buc": "buc_Latn_YT", - "bug": "bug_Latn_ID", - "bya": "bya_Latn_ID", - "byn": "byn_Ethi_ER", - "ca": "ca_Latn_ES", - "cch": "cch_Latn_NG", - "ccp": "ccp_Beng_IN", - "ce": "ce_Cyrl_RU", - "ceb": "ceb_Latn_PH", - "cgg": "cgg_Latn_UG", - "ch": "ch_Latn_GU", - "chk": "chk_Latn_FM", - "chm": "chm_Cyrl_RU", - "chp": "chp_Latn_CA", - "chr": "chr_Cher_US", - "cja": "cja_Arab_KH", - "cjm": "cjm_Cham_VN", - "ckb": "ckb_Arab_IQ", - "co": "co_Latn_FR", - "cr": "cr_Cans_CA", - "crk": "crk_Cans_CA", - "cs": "cs_Latn_CZ", - "csb": "csb_Latn_PL", - "cv": "cv_Cyrl_RU", - "cy": "cy_Latn_GB", - "da": "da_Latn_DK", - "dar": "dar_Cyrl_RU", - "dav": "dav_Latn_KE", - "de": "de_Latn_DE", - "den": "den_Latn_CA", - "dgr": "dgr_Latn_CA", - "dje": "dje_Latn_NE", - "doi": "doi_Arab_IN", - "dsb": "dsb_Latn_DE", - "dua": "dua_Latn_CM", - "dv": "dv_Thaa_MV", - "dyo": "dyo_Latn_SN", - "dyu": "dyu_Latn_BF", - "dz": "dz_Tibt_BT", - "ebu": "ebu_Latn_KE", - "ee": "ee_Latn_GH", - "efi": "efi_Latn_NG", - "el": "el_Grek_GR", - "en": "en_Latn_US", - "eo": "eo_Latn_001", - "es": "es_Latn_ES", - "et": "et_Latn_EE", - "eu": "eu_Latn_ES", - "ewo": "ewo_Latn_CM", - "fa": "fa_Arab_IR", - "fan": "fan_Latn_GQ", - "ff": "ff_Latn_SN", - "fi": "fi_Latn_FI", - "fil": "fil_Latn_PH", - "fj": "fj_Latn_FJ", - "fo": "fo_Latn_FO", - "fon": "fon_Latn_BJ", - "fr": "fr_Latn_FR", - "fur": "fur_Latn_IT", - "fy": "fy_Latn_NL", - "ga": "ga_Latn_IE", - "gaa": "gaa_Latn_GH", - "gag": "gag_Latn_MD", - "gbm": "gbm_Deva_IN", - "gcr": "gcr_Latn_GF", - "gd": "gd_Latn_GB", - "gez": "gez_Ethi_ET", - "gil": "gil_Latn_KI", - "gl": "gl_Latn_ES", - "gn": "gn_Latn_PY", - "gon": "gon_Telu_IN", - "gor": "gor_Latn_ID", - "grt": "grt_Beng_IN", - "gsw": "gsw_Latn_CH", - "gu": "gu_Gujr_IN", - "guz": "guz_Latn_KE", - "gv": "gv_Latn_IM", - "gwi": "gwi_Latn_CA", - "ha": "ha_Latn_NG", - "ha_CM": "ha_Arab_CM", - "ha_SD": "ha_Arab_SD", - "haw": "haw_Latn_US", - "he": "he_Hebr_IL", - "hi": "hi_Deva_IN", - "hil": "hil_Latn_PH", - "hne": "hne_Deva_IN", - "hnn": "hnn_Latn_PH", - "ho": "ho_Latn_PG", - "hoc": "hoc_Deva_IN", - "hoj": "hoj_Deva_IN", - "hr": "hr_Latn_HR", - "ht": "ht_Latn_HT", - "hu": "hu_Latn_HU", - "hy": "hy_Armn_AM", - "ia": "ia_Latn_FR", - "ibb": "ibb_Latn_NG", - "id": "id_Latn_ID", - "ig": "ig_Latn_NG", - "ii": "ii_Yiii_CN", - "ik": "ik_Latn_US", - "ilo": "ilo_Latn_PH", - "in": "in_Latn_ID", - "inh": "inh_Cyrl_RU", - "is": "is_Latn_IS", - "it": "it_Latn_IT", - "iu": "iu_Cans_CA", - "iw": "iw_Hebr_IL", - "ja": "ja_Jpan_JP", - "jgo": "jgo_Latn_CM", - "ji": "ji_Hebr_UA", - "jmc": "jmc_Latn_TZ", - "jv": "jv_Latn_ID", - "jw": "jw_Latn_ID", - "ka": "ka_Geor_GE", - "kaa": "kaa_Cyrl_UZ", - "kab": "kab_Latn_DZ", - "kaj": "kaj_Latn_NG", - "kam": "kam_Latn_KE", - "kbd": "kbd_Cyrl_RU", - "kcg": "kcg_Latn_NG", - "kde": "kde_Latn_TZ", - "kdt": "kdt_Thai_TH", - "kea": "kea_Latn_CV", - "ken": "ken_Latn_CM", - "kfo": "kfo_Latn_CI", - "kfr": "kfr_Deva_IN", - "kg": "kg_Latn_CD", - "kha": "kha_Latn_IN", - "khb": "khb_Talu_CN", - "khq": "khq_Latn_ML", - "kht": "kht_Mymr_IN", - "ki": "ki_Latn_KE", - "kj": "kj_Latn_NA", - "kk": "kk_Cyrl_KZ", - "kk_AF": "kk_Arab_AF", - "kk_Arab": "kk_Arab_CN", - "kk_CN": "kk_Arab_CN", - "kk_IR": "kk_Arab_IR", - "kk_MN": "kk_Arab_MN", - "kkj": "kkj_Latn_CM", - "kl": "kl_Latn_GL", - "kln": "kln_Latn_KE", - "km": "km_Khmr_KH", - "kmb": "kmb_Latn_AO", - "kn": "kn_Knda_IN", - "ko": "ko_Kore_KR", - "koi": "koi_Cyrl_RU", - "kok": "kok_Deva_IN", - "kos": "kos_Latn_FM", - "kpe": "kpe_Latn_LR", - "krc": "krc_Cyrl_RU", - "kri": "kri_Latn_SL", - "krl": "krl_Latn_RU", - "kru": "kru_Deva_IN", - "ks": "ks_Arab_IN", - "ksb": "ksb_Latn_TZ", - "ksf": "ksf_Latn_CM", - "ksh": "ksh_Latn_DE", - "ku": "ku_Latn_TR", - "ku_Arab": "ku_Arab_IQ", - "ku_LB": "ku_Arab_LB", - "kum": "kum_Cyrl_RU", - "kv": "kv_Cyrl_RU", - "kw": "kw_Latn_GB", - "ky": "ky_Cyrl_KG", - "ky_Arab": "ky_Arab_CN", - "ky_CN": "ky_Arab_CN", - "ky_Latn": "ky_Latn_TR", - "ky_TR": "ky_Latn_TR", - "la": "la_Latn_VA", - "lag": "lag_Latn_TZ", - "lah": "lah_Arab_PK", - "lb": "lb_Latn_LU", - "lbe": "lbe_Cyrl_RU", - "lcp": "lcp_Thai_CN", - "lep": "lep_Lepc_IN", - "lez": "lez_Cyrl_RU", - "lg": "lg_Latn_UG", - "li": "li_Latn_NL", - "lif": "lif_Deva_NP", - "lis": "lis_Lisu_CN", - "lki": "lki_Arab_IR", - "lkt": "lkt_Latn_US", - "lmn": "lmn_Telu_IN", - "ln": "ln_Latn_CD", - "lo": "lo_Laoo_LA", - "lol": "lol_Latn_CD", - "lt": "lt_Latn_LT", - "lu": "lu_Latn_CD", - "lua": "lua_Latn_CD", - "luo": "luo_Latn_KE", - "luy": "luy_Latn_KE", - "lv": "lv_Latn_LV", - "lwl": "lwl_Thai_TH", - "mad": "mad_Latn_ID", - "mag": "mag_Deva_IN", - "mai": "mai_Deva_IN", - "mak": "mak_Latn_ID", - "man": "man_Latn_GM", - "man_GN": "man_Nkoo_GN", - "man_Nkoo": "man_Nkoo_GN", - "mas": "mas_Latn_KE", - "mdf": "mdf_Cyrl_RU", - "mdh": "mdh_Latn_PH", - "mdr": "mdr_Latn_ID", - "men": "men_Latn_SL", - "mer": "mer_Latn_KE", - "mfe": "mfe_Latn_MU", - "mg": "mg_Latn_MG", - "mgh": "mgh_Latn_MZ", - "mgo": "mgo_Latn_CM", - "mh": "mh_Latn_MH", - "mi": "mi_Latn_NZ", - "min": "min_Latn_ID", - "mk": "mk_Cyrl_MK", - "ml": "ml_Mlym_IN", - "mn": "mn_Cyrl_MN", - "mn_CN": "mn_Mong_CN", - "mn_Mong": "mn_Mong_CN", - "mni": "mni_Beng_IN", - "mnw": "mnw_Mymr_MM", - "mo": "mo_Latn_RO", - "mos": "mos_Latn_BF", - "mr": "mr_Deva_IN", - "ms": "ms_Latn_MY", - "ms_CC": "ms_Arab_CC", - "ms_ID": "ms_Arab_ID", - "mt": "mt_Latn_MT", - "mua": "mua_Latn_CM", - "mwr": "mwr_Deva_IN", - "my": "my_Mymr_MM", - "myv": "myv_Cyrl_RU", - "na": "na_Latn_NR", - "nap": "nap_Latn_IT", - "naq": "naq_Latn_NA", - "nb": "nb_Latn_NO", - "nd": "nd_Latn_ZW", - "nds": "nds_Latn_DE", - "ne": "ne_Deva_NP", - "new": "new_Deva_NP", - "ng": "ng_Latn_NA", - "niu": "niu_Latn_NU", - "nl": "nl_Latn_NL", - "nmg": "nmg_Latn_CM", - "nn": "nn_Latn_NO", - "nnh": "nnh_Latn_CM", - "no": "no_Latn_NO", - "nod": "nod_Lana_TH", - "nr": "nr_Latn_ZA", - "nso": "nso_Latn_ZA", - "nus": "nus_Latn_SD", - "nv": "nv_Latn_US", - "ny": "ny_Latn_MW", - "nym": "nym_Latn_TZ", - "nyn": "nyn_Latn_UG", - "oc": "oc_Latn_FR", - "om": "om_Latn_ET", - "or": "or_Orya_IN", - "os": "os_Cyrl_GE", - "pa": "pa_Guru_IN", - "pa_Arab": "pa_Arab_PK", - "pa_PK": "pa_Arab_PK", - "pag": "pag_Latn_PH", - "pam": "pam_Latn_PH", - "pap": "pap_Latn_AW", - "pau": "pau_Latn_PW", - "pl": "pl_Latn_PL", - "pon": "pon_Latn_FM", - "prd": "prd_Arab_IR", - "ps": "ps_Arab_AF", - "pt": "pt_Latn_BR", - "qu": "qu_Latn_PE", - "raj": "raj_Latn_IN", - "rcf": "rcf_Latn_RE", - "rej": "rej_Latn_ID", - "rjs": "rjs_Deva_NP", - "rkt": "rkt_Beng_BD", - "rm": "rm_Latn_CH", - "rn": "rn_Latn_BI", - "ro": "ro_Latn_RO", - "rof": "rof_Latn_TZ", - "ru": "ru_Cyrl_RU", - "rw": "rw_Latn_RW", - "rwk": "rwk_Latn_TZ", - "sa": "sa_Deva_IN", - "saf": "saf_Latn_GH", - "sah": "sah_Cyrl_RU", - "saq": "saq_Latn_KE", - "sas": "sas_Latn_ID", - "sat": "sat_Latn_IN", - "saz": "saz_Saur_IN", - "sbp": "sbp_Latn_TZ", - "scn": "scn_Latn_IT", - "sco": "sco_Latn_GB", - "sd": "sd_Arab_PK", - "sd_Deva": "sd_Deva_IN", - "sdh": "sdh_Arab_IR", - "se": "se_Latn_NO", - "seh": "seh_Latn_MZ", - "ses": "ses_Latn_ML", - "sg": "sg_Latn_CF", - "shi": "shi_Tfng_MA", - "shn": "shn_Mymr_MM", - "si": "si_Sinh_LK", - "sid": "sid_Latn_ET", - "sk": "sk_Latn_SK", - "sl": "sl_Latn_SI", - "sm": "sm_Latn_WS", - "sma": "sma_Latn_SE", - "smj": "smj_Latn_SE", - "smn": "smn_Latn_FI", - "sms": "sms_Latn_FI", - "sn": "sn_Latn_ZW", - "snk": "snk_Latn_ML", - "so": "so_Latn_SO", - "sq": "sq_Latn_AL", - "sr": "sr_Cyrl_RS", - "sr_ME": "sr_Latn_ME", - "sr_RO": "sr_Latn_RO", - "sr_RU": "sr_Latn_RU", - "sr_TR": "sr_Latn_TR", - "srn": "srn_Latn_SR", - "srr": "srr_Latn_SN", - "ss": "ss_Latn_ZA", - "ssy": "ssy_Latn_ER", - "st": "st_Latn_ZA", - "su": "su_Latn_ID", - "suk": "suk_Latn_TZ", - "sus": "sus_Latn_GN", - "sv": "sv_Latn_SE", - "sw": "sw_Latn_TZ", - "swb": "swb_Arab_YT", - "swc": "swc_Latn_CD", - "syl": "syl_Beng_BD", - "syr": "syr_Syrc_IQ", - "ta": "ta_Taml_IN", - "tbw": "tbw_Latn_PH", - "tcy": "tcy_Knda_IN", - "tdd": "tdd_Tale_CN", - "te": "te_Telu_IN", - "tem": "tem_Latn_SL", - "teo": "teo_Latn_UG", - "tet": "tet_Latn_TL", - "tg": "tg_Cyrl_TJ", - "tg_Arab": "tg_Arab_PK", - "tg_PK": "tg_Arab_PK", - "th": "th_Thai_TH", - "ti": "ti_Ethi_ET", - "tig": "tig_Ethi_ER", - "tiv": "tiv_Latn_NG", - "tk": "tk_Latn_TM", - "tkl": "tkl_Latn_TK", - "tl": "tl_Latn_PH", - "tmh": "tmh_Latn_NE", - "tn": "tn_Latn_ZA", - "to": "to_Latn_TO", - "tpi": "tpi_Latn_PG", - "tr": "tr_Latn_TR", - "trv": "trv_Latn_TW", - "ts": "ts_Latn_ZA", - "tsg": "tsg_Latn_PH", - "tt": "tt_Cyrl_RU", - "tts": "tts_Thai_TH", - "tum": "tum_Latn_MW", - "tvl": "tvl_Latn_TV", - "twq": "twq_Latn_NE", - "ty": "ty_Latn_PF", - "tyv": "tyv_Cyrl_RU", - "tzm": "tzm_Latn_MA", - "udm": "udm_Cyrl_RU", - "ug": "ug_Arab_CN", - "ug_Cyrl": "ug_Cyrl_KZ", - "ug_KZ": "ug_Cyrl_KZ", - "ug_MN": "ug_Cyrl_MN", - "uk": "uk_Cyrl_UA", - "uli": "uli_Latn_FM", - "umb": "umb_Latn_AO", - "und": "en_Latn_US", - "und_AD": "ca_Latn_AD", - "und_AE": "ar_Arab_AE", - "und_AF": "fa_Arab_AF", - "und_AL": "sq_Latn_AL", - "und_AM": "hy_Armn_AM", - "und_AO": "pt_Latn_AO", - "und_AQ": "und_Latn_AQ", - "und_AR": "es_Latn_AR", - "und_Arab": "ar_Arab_EG", - "und_Arab_CC": "ms_Arab_CC", - "und_Arab_CN": "ug_Arab_CN", - "und_Arab_GB": "ks_Arab_GB", - "und_Arab_ID": "ms_Arab_ID", - "und_Arab_IN": "ur_Arab_IN", - "und_Arab_KH": "cja_Arab_KH", - "und_Arab_MN": "kk_Arab_MN", - "und_Arab_MU": "ur_Arab_MU", - "und_Arab_NG": "ha_Arab_NG", - "und_Arab_PK": "ur_Arab_PK", - "und_Arab_TJ": "fa_Arab_TJ", - "und_Arab_TR": "zza_Arab_TR", - "und_Arab_YT": "swb_Arab_YT", - "und_Armi": "arc_Armi_IR", - "und_Armn": "hy_Armn_AM", - "und_AS": "sm_Latn_AS", - "und_AT": "de_Latn_AT", - "und_Avst": "ae_Avst_IR", - "und_AW": "nl_Latn_AW", - "und_AX": "sv_Latn_AX", - "und_AZ": "az_Latn_AZ", - "und_BA": "bs_Latn_BA", - "und_Bali": "ban_Bali_ID", - "und_Bamu": "bax_Bamu_CM", - "und_Batk": "bbc_Batk_ID", - "und_BD": "bn_Beng_BD", - "und_BE": "nl_Latn_BE", - "und_Beng": "bn_Beng_BD", - "und_BF": "fr_Latn_BF", - "und_BG": "bg_Cyrl_BG", - "und_BH": "ar_Arab_BH", - "und_BI": "rn_Latn_BI", - "und_BJ": "fr_Latn_BJ", - "und_BL": "fr_Latn_BL", - "und_BN": "ms_Latn_BN", - "und_BO": "es_Latn_BO", - "und_Bopo": "zh_Bopo_TW", - "und_BQ": "pap_Latn_BQ", - "und_BR": "pt_Latn_BR", - "und_Brah": "pra_Brah_IN", - "und_Brai": "und_Brai_FR", - "und_BT": "dz_Tibt_BT", - "und_Bugi": "bug_Bugi_ID", - "und_Buhd": "bku_Buhd_PH", - "und_BV": "und_Latn_BV", - "und_BY": "be_Cyrl_BY", - "und_Cakm": "ccp_Cakm_BD", - "und_Cans": "cr_Cans_CA", - "und_Cari": "xcr_Cari_TR", - "und_CD": "sw_Latn_CD", - "und_CF": "fr_Latn_CF", - "und_CG": "fr_Latn_CG", - "und_CH": "de_Latn_CH", - "und_Cham": "cjm_Cham_VN", - "und_Cher": "chr_Cher_US", - "und_CI": "fr_Latn_CI", - "und_CL": "es_Latn_CL", - "und_CM": "fr_Latn_CM", - "und_CN": "zh_Hans_CN", - "und_CO": "es_Latn_CO", - "und_Copt": "cop_Copt_EG", - "und_CP": "und_Latn_CP", - "und_Cprt": "grc_Cprt_CY", - "und_CR": "es_Latn_CR", - "und_CU": "es_Latn_CU", - "und_CV": "pt_Latn_CV", - "und_CW": "pap_Latn_CW", - "und_CY": "el_Grek_CY", - "und_Cyrl": "ru_Cyrl_RU", - "und_Cyrl_AL": "mk_Cyrl_AL", - "und_Cyrl_BA": "sr_Cyrl_BA", - "und_Cyrl_GE": "ab_Cyrl_GE", - "und_Cyrl_GR": "mk_Cyrl_GR", - "und_Cyrl_MD": "uk_Cyrl_MD", - "und_Cyrl_PL": "be_Cyrl_PL", - "und_Cyrl_RO": "bg_Cyrl_RO", - "und_Cyrl_SK": "uk_Cyrl_SK", - "und_Cyrl_TR": "kbd_Cyrl_TR", - "und_Cyrl_XK": "sr_Cyrl_XK", - "und_CZ": "cs_Latn_CZ", - "und_DE": "de_Latn_DE", - "und_Deva": "hi_Deva_IN", - "und_Deva_BT": "ne_Deva_BT", - "und_Deva_MU": "bho_Deva_MU", - "und_Deva_PK": "btv_Deva_PK", - "und_DJ": "aa_Latn_DJ", - "und_DK": "da_Latn_DK", - "und_DO": "es_Latn_DO", - "und_DZ": "ar_Arab_DZ", - "und_EA": "es_Latn_EA", - "und_EC": "es_Latn_EC", - "und_EE": "et_Latn_EE", - "und_EG": "ar_Arab_EG", - "und_Egyp": "egy_Egyp_EG", - "und_EH": "ar_Arab_EH", - "und_ER": "ti_Ethi_ER", - "und_ES": "es_Latn_ES", - "und_ET": "am_Ethi_ET", - "und_Ethi": "am_Ethi_ET", - "und_FI": "fi_Latn_FI", - "und_FM": "chk_Latn_FM", - "und_FO": "fo_Latn_FO", - "und_FR": "fr_Latn_FR", - "und_GA": "fr_Latn_GA", - "und_GE": "ka_Geor_GE", - "und_Geor": "ka_Geor_GE", - "und_GF": "fr_Latn_GF", - "und_GH": "ak_Latn_GH", - "und_GL": "kl_Latn_GL", - "und_Glag": "cu_Glag_BG", - "und_GN": "fr_Latn_GN", - "und_Goth": "got_Goth_UA", - "und_GP": "fr_Latn_GP", - "und_GQ": "es_Latn_GQ", - "und_GR": "el_Grek_GR", - "und_Grek": "el_Grek_GR", - "und_GS": "und_Latn_GS", - "und_GT": "es_Latn_GT", - "und_Gujr": "gu_Gujr_IN", - "und_Guru": "pa_Guru_IN", - "und_GW": "pt_Latn_GW", - "und_Hang": "ko_Hang_KR", - "und_Hani": "zh_Hani_CN", - "und_Hano": "hnn_Hano_PH", - "und_Hans": "zh_Hans_CN", - "und_Hant": "zh_Hant_TW", - "und_Hebr": "he_Hebr_IL", - "und_Hebr_CA": "yi_Hebr_CA", - "und_Hebr_GB": "yi_Hebr_GB", - "und_Hebr_SE": "yi_Hebr_SE", - "und_Hebr_UA": "yi_Hebr_UA", - "und_Hebr_US": "yi_Hebr_US", - "und_Hira": "ja_Hira_JP", - "und_HK": "zh_Hant_HK", - "und_HM": "und_Latn_HM", - "und_HN": "es_Latn_HN", - "und_HR": "hr_Latn_HR", - "und_HT": "ht_Latn_HT", - "und_HU": "hu_Latn_HU", - "und_IC": "es_Latn_IC", - "und_ID": "id_Latn_ID", - "und_IL": "he_Hebr_IL", - "und_IN": "hi_Deva_IN", - "und_IQ": "ar_Arab_IQ", - "und_IR": "fa_Arab_IR", - "und_IS": "is_Latn_IS", - "und_IT": "it_Latn_IT", - "und_Ital": "ett_Ital_IT", - "und_Java": "jv_Java_ID", - "und_JO": "ar_Arab_JO", - "und_JP": "ja_Jpan_JP", - "und_Jpan": "ja_Jpan_JP", - "und_Kali": "eky_Kali_MM", - "und_Kana": "ja_Kana_JP", - "und_KG": "ky_Cyrl_KG", - "und_KH": "km_Khmr_KH", - "und_Khar": "pra_Khar_PK", - "und_Khmr": "km_Khmr_KH", - "und_KM": "ar_Arab_KM", - "und_Knda": "kn_Knda_IN", - "und_Kore": "ko_Kore_KR", - "und_KP": "ko_Kore_KP", - "und_KR": "ko_Kore_KR", - "und_Kthi": "bh_Kthi_IN", - "und_KW": "ar_Arab_KW", - "und_KZ": "ru_Cyrl_KZ", - "und_LA": "lo_Laoo_LA", - "und_Lana": "nod_Lana_TH", - "und_Laoo": "lo_Laoo_LA", - "und_Latn_AF": "tk_Latn_AF", - "und_Latn_AM": "az_Latn_AM", - "und_Latn_BG": "tr_Latn_BG", - "und_Latn_CN": "za_Latn_CN", - "und_Latn_CY": "tr_Latn_CY", - "und_Latn_DZ": "fr_Latn_DZ", - "und_Latn_ET": "en_Latn_ET", - "und_Latn_GE": "ku_Latn_GE", - "und_Latn_GR": "tr_Latn_GR", - "und_Latn_IL": "ro_Latn_IL", - "und_Latn_IR": "tk_Latn_IR", - "und_Latn_KM": "fr_Latn_KM", - "und_Latn_KZ": "de_Latn_KZ", - "und_Latn_LB": "fr_Latn_LB", - "und_Latn_MA": "fr_Latn_MA", - "und_Latn_MK": "sq_Latn_MK", - "und_Latn_MO": "pt_Latn_MO", - "und_Latn_MR": "fr_Latn_MR", - "und_Latn_RU": "krl_Latn_RU", - "und_Latn_SY": "fr_Latn_SY", - "und_Latn_TN": "fr_Latn_TN", - "und_Latn_TW": "trv_Latn_TW", - "und_Latn_UA": "pl_Latn_UA", - "und_LB": "ar_Arab_LB", - "und_Lepc": "lep_Lepc_IN", - "und_LI": "de_Latn_LI", - "und_Limb": "lif_Limb_IN", - "und_Linb": "grc_Linb_GR", - "und_Lisu": "lis_Lisu_CN", - "und_LK": "si_Sinh_LK", - "und_LS": "st_Latn_LS", - "und_LT": "lt_Latn_LT", - "und_LU": "fr_Latn_LU", - "und_LV": "lv_Latn_LV", - "und_LY": "ar_Arab_LY", - "und_Lyci": "xlc_Lyci_TR", - "und_Lydi": "xld_Lydi_TR", - "und_MA": "ar_Arab_MA", - "und_Mand": "myz_Mand_IR", - "und_MC": "fr_Latn_MC", - "und_MD": "ro_Latn_MD", - "und_ME": "sr_Latn_ME", - "und_Merc": "xmr_Merc_SD", - "und_Mero": "xmr_Mero_SD", - "und_MF": "fr_Latn_MF", - "und_MG": "mg_Latn_MG", - "und_MK": "mk_Cyrl_MK", - "und_ML": "bm_Latn_ML", - "und_Mlym": "ml_Mlym_IN", - "und_MM": "my_Mymr_MM", - "und_MN": "mn_Cyrl_MN", - "und_MO": "zh_Hant_MO", - "und_Mong": "mn_Mong_CN", - "und_MQ": "fr_Latn_MQ", - "und_MR": "ar_Arab_MR", - "und_MT": "mt_Latn_MT", - "und_Mtei": "mni_Mtei_IN", - "und_MU": "mfe_Latn_MU", - "und_MV": "dv_Thaa_MV", - "und_MX": "es_Latn_MX", - "und_MY": "ms_Latn_MY", - "und_Mymr": "my_Mymr_MM", - "und_Mymr_IN": "kht_Mymr_IN", - "und_Mymr_TH": "mnw_Mymr_TH", - "und_MZ": "pt_Latn_MZ", - "und_NA": "af_Latn_NA", - "und_NC": "fr_Latn_NC", - "und_NE": "ha_Latn_NE", - "und_NI": "es_Latn_NI", - "und_Nkoo": "man_Nkoo_GN", - "und_NL": "nl_Latn_NL", - "und_NO": "nb_Latn_NO", - "und_NP": "ne_Deva_NP", - "und_Ogam": "sga_Ogam_IE", - "und_Olck": "sat_Olck_IN", - "und_OM": "ar_Arab_OM", - "und_Orkh": "otk_Orkh_MN", - "und_Orya": "or_Orya_IN", - "und_Osma": "so_Osma_SO", - "und_PA": "es_Latn_PA", - "und_PE": "es_Latn_PE", - "und_PF": "fr_Latn_PF", - "und_PG": "tpi_Latn_PG", - "und_PH": "fil_Latn_PH", - "und_Phag": "lzh_Phag_CN", - "und_Phli": "pal_Phli_IR", - "und_Phnx": "phn_Phnx_LB", - "und_PK": "ur_Arab_PK", - "und_PL": "pl_Latn_PL", - "und_Plrd": "hmd_Plrd_CN", - "und_PM": "fr_Latn_PM", - "und_PR": "es_Latn_PR", - "und_Prti": "xpr_Prti_IR", - "und_PS": "ar_Arab_PS", - "und_PT": "pt_Latn_PT", - "und_PW": "pau_Latn_PW", - "und_PY": "gn_Latn_PY", - "und_QA": "ar_Arab_QA", - "und_RE": "fr_Latn_RE", - "und_Rjng": "rej_Rjng_ID", - "und_RO": "ro_Latn_RO", - "und_RS": "sr_Cyrl_RS", - "und_RU": "ru_Cyrl_RU", - "und_Runr": "non_Runr_SE", - "und_RW": "rw_Latn_RW", - "und_SA": "ar_Arab_SA", - "und_Samr": "smp_Samr_IL", - "und_Sarb": "xsa_Sarb_YE", - "und_Saur": "saz_Saur_IN", - "und_SC": "fr_Latn_SC", - "und_SD": "ar_Arab_SD", - "und_SE": "sv_Latn_SE", - "und_Shaw": "en_Shaw_GB", - "und_Shrd": "sa_Shrd_IN", - "und_SI": "sl_Latn_SI", - "und_Sinh": "si_Sinh_LK", - "und_SJ": "nb_Latn_SJ", - "und_SK": "sk_Latn_SK", - "und_SM": "it_Latn_SM", - "und_SN": "fr_Latn_SN", - "und_SO": "so_Latn_SO", - "und_Sora": "srb_Sora_IN", - "und_SR": "nl_Latn_SR", - "und_ST": "pt_Latn_ST", - "und_Sund": "su_Sund_ID", - "und_SV": "es_Latn_SV", - "und_SY": "ar_Arab_SY", - "und_Sylo": "syl_Sylo_BD", - "und_Syrc": "syr_Syrc_IQ", - "und_Tagb": "tbw_Tagb_PH", - "und_Takr": "doi_Takr_IN", - "und_Tale": "tdd_Tale_CN", - "und_Talu": "khb_Talu_CN", - "und_Taml": "ta_Taml_IN", - "und_Tavt": "blt_Tavt_VN", - "und_TD": "fr_Latn_TD", - "und_Telu": "te_Telu_IN", - "und_TF": "fr_Latn_TF", - "und_Tfng": "zgh_Tfng_MA", - "und_TG": "fr_Latn_TG", - "und_Tglg": "fil_Tglg_PH", - "und_TH": "th_Thai_TH", - "und_Thaa": "dv_Thaa_MV", - "und_Thai": "th_Thai_TH", - "und_Thai_CN": "lcp_Thai_CN", - "und_Thai_KH": "kdt_Thai_KH", - "und_Thai_LA": "kdt_Thai_LA", - "und_Tibt": "bo_Tibt_CN", - "und_TJ": "tg_Cyrl_TJ", - "und_TK": "tkl_Latn_TK", - "und_TL": "pt_Latn_TL", - "und_TM": "tk_Latn_TM", - "und_TN": "ar_Arab_TN", - "und_TO": "to_Latn_TO", - "und_TR": "tr_Latn_TR", - "und_TV": "tvl_Latn_TV", - "und_TW": "zh_Hant_TW", - "und_TZ": "sw_Latn_TZ", - "und_UA": "uk_Cyrl_UA", - "und_UG": "sw_Latn_UG", - "und_Ugar": "uga_Ugar_SY", - "und_UY": "es_Latn_UY", - "und_UZ": "uz_Latn_UZ", - "und_VA": "la_Latn_VA", - "und_Vaii": "vai_Vaii_LR", - "und_VE": "es_Latn_VE", - "und_VN": "vi_Latn_VN", - "und_VU": "bi_Latn_VU", - "und_WF": "fr_Latn_WF", - "und_WS": "sm_Latn_WS", - "und_XK": "sq_Latn_XK", - "und_Xpeo": "peo_Xpeo_IR", - "und_Xsux": "akk_Xsux_IQ", - "und_YE": "ar_Arab_YE", - "und_Yiii": "ii_Yiii_CN", - "und_YT": "fr_Latn_YT", - "unr": "unr_Beng_IN", - "unr_Deva": "unr_Deva_NP", - "unr_NP": "unr_Deva_NP", - "unx": "unx_Beng_IN", - "ur": "ur_Arab_PK", - "uz": "uz_Latn_UZ", - "uz_AF": "uz_Arab_AF", - "uz_Arab": "uz_Arab_AF", - "uz_CN": "uz_Cyrl_CN", - "vai": "vai_Vaii_LR", - "ve": "ve_Latn_ZA", - "vi": "vi_Latn_VN", - "vo": "vo_Latn_001", - "vun": "vun_Latn_TZ", - "wa": "wa_Latn_BE", - "wae": "wae_Latn_CH", - "wal": "wal_Ethi_ET", - "war": "war_Latn_PH", - "wo": "wo_Latn_SN", - "xh": "xh_Latn_ZA", - "xog": "xog_Latn_UG", - "xsr": "xsr_Deva_NP", - "yao": "yao_Latn_MZ", - "yap": "yap_Latn_FM", - "yav": "yav_Latn_CM", - "yi": "yi_Hebr_UA", - "yo": "yo_Latn_NG", - "za": "za_Latn_CN", - "zgh": "zgh_Tfng_MA", - "zh": "zh_Hans_CN", - "zh_AU": "zh_Hant_AU", - "zh_BN": "zh_Hant_BN", - "zh_GB": "zh_Hant_GB", - "zh_GF": "zh_Hant_GF", - "zh_Hant": "zh_Hant_TW", - "zh_HK": "zh_Hant_HK", - "zh_ID": "zh_Hant_ID", - "zh_MO": "zh_Hant_MO", - "zh_MY": "zh_Hant_MY", - "zh_PA": "zh_Hant_PA", - "zh_PF": "zh_Hant_PF", - "zh_PH": "zh_Hant_PH", - "zh_SR": "zh_Hant_SR", - "zh_TH": "zh_Hant_TH", - "zh_TW": "zh_Hant_TW", - "zh_US": "zh_Hant_US", - "zh_VN": "zh_Hant_VN", - "zu": "zu_Latn_ZA", - "zza": "zza_Arab_TR" - } + "supplemental": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "generation": { + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + }, + "likelySubtags": { + "aa": "aa-Latn-ET", + "ab": "ab-Cyrl-GE", + "ace": "ace-Latn-ID", + "ach": "ach-Latn-UG", + "ady": "ady-Cyrl-RU", + "af": "af-Latn-ZA", + "agq": "agq-Latn-CM", + "ak": "ak-Latn-GH", + "alt": "alt-Cyrl-RU", + "am": "am-Ethi-ET", + "amo": "amo-Latn-NG", + "aoz": "aoz-Latn-ID", + "ar": "ar-Arab-EG", + "as": "as-Beng-IN", + "asa": "asa-Latn-TZ", + "ast": "ast-Latn-ES", + "atj": "atj-Latn-CA", + "av": "av-Cyrl-RU", + "awa": "awa-Deva-IN", + "ay": "ay-Latn-BO", + "az": "az-Latn-AZ", + "az-Arab": "az-Arab-IR", + "az-IR": "az-Arab-IR", + "az-RU": "az-Cyrl-RU", + "ba": "ba-Cyrl-RU", + "bal": "bal-Arab-PK", + "ban": "ban-Latn-ID", + "bap": "bap-Deva-NP", + "bas": "bas-Latn-CM", + "bax": "bax-Bamu-CM", + "bbc": "bbc-Latn-ID", + "bbj": "bbj-Latn-CM", + "be": "be-Cyrl-BY", + "bem": "bem-Latn-ZM", + "bez": "bez-Latn-TZ", + "bfd": "bfd-Latn-CM", + "bfq": "bfq-Taml-IN", + "bft": "bft-Arab-PK", + "bfy": "bfy-Deva-IN", + "bg": "bg-Cyrl-BG", + "bgx": "bgx-Grek-TR", + "bhb": "bhb-Deva-IN", + "bho": "bho-Deva-IN", + "bi": "bi-Latn-VU", + "bik": "bik-Latn-PH", + "bin": "bin-Latn-NG", + "bjj": "bjj-Deva-IN", + "bkm": "bkm-Latn-CM", + "bku": "bku-Latn-PH", + "bm": "bm-Latn-ML", + "bmq": "bmq-Latn-ML", + "bn": "bn-Beng-BD", + "bo": "bo-Tibt-CN", + "bqv": "bqv-Latn-CI", + "br": "br-Latn-FR", + "bra": "bra-Deva-IN", + "brx": "brx-Deva-IN", + "bs": "bs-Latn-BA", + "bss": "bss-Latn-CM", + "bto": "bto-Latn-PH", + "btv": "btv-Deva-PK", + "bua": "bua-Cyrl-RU", + "buc": "buc-Latn-YT", + "bug": "bug-Latn-ID", + "bum": "bum-Latn-CM", + "bvb": "bvb-Latn-GQ", + "bya": "bya-Latn-ID", + "byn": "byn-Ethi-ER", + "byv": "byv-Latn-CM", + "bze": "bze-Latn-ML", + "ca": "ca-Latn-ES", + "cch": "cch-Latn-NG", + "ccp": "ccp-Beng-IN", + "ce": "ce-Cyrl-RU", + "ceb": "ceb-Latn-PH", + "cgg": "cgg-Latn-UG", + "ch": "ch-Latn-GU", + "chk": "chk-Latn-FM", + "chm": "chm-Cyrl-RU", + "chp": "chp-Latn-CA", + "chr": "chr-Cher-US", + "cja": "cja-Arab-KH", + "cjm": "cjm-Cham-VN", + "ckb": "ckb-Arab-IQ", + "co": "co-Latn-FR", + "cr": "cr-Cans-CA", + "crj": "crj-Cans-CA", + "crk": "crk-Cans-CA", + "crl": "crl-Cans-CA", + "crm": "crm-Cans-CA", + "cs": "cs-Latn-CZ", + "csb": "csb-Latn-PL", + "csw": "csw-Cans-CA", + "cu": "cu-Cyrl-RU", + "cv": "cv-Cyrl-RU", + "cy": "cy-Latn-GB", + "da": "da-Latn-DK", + "dar": "dar-Cyrl-RU", + "dav": "dav-Latn-KE", + "de": "de-Latn-DE", + "den": "den-Latn-CA", + "dgr": "dgr-Latn-CA", + "dje": "dje-Latn-NE", + "dnj": "dnj-Latn-CI", + "doi": "doi-Arab-IN", + "dsb": "dsb-Latn-DE", + "dtm": "dtm-Latn-ML", + "dua": "dua-Latn-CM", + "dv": "dv-Thaa-MV", + "dyo": "dyo-Latn-SN", + "dyu": "dyu-Latn-BF", + "dz": "dz-Tibt-BT", + "ebu": "ebu-Latn-KE", + "ee": "ee-Latn-GH", + "efi": "efi-Latn-NG", + "el": "el-Grek-GR", + "en": "en-Latn-US", + "eo": "eo-Latn-001", + "es": "es-Latn-ES", + "et": "et-Latn-EE", + "eu": "eu-Latn-ES", + "ewo": "ewo-Latn-CM", + "fa": "fa-Arab-IR", + "fan": "fan-Latn-GQ", + "ff": "ff-Latn-SN", + "fi": "fi-Latn-FI", + "fil": "fil-Latn-PH", + "fit": "fit-Latn-SE", + "fj": "fj-Latn-FJ", + "fo": "fo-Latn-FO", + "fon": "fon-Latn-BJ", + "fr": "fr-Latn-FR", + "fur": "fur-Latn-IT", + "fy": "fy-Latn-NL", + "ga": "ga-Latn-IE", + "gaa": "gaa-Latn-GH", + "gag": "gag-Latn-MD", + "gbm": "gbm-Deva-IN", + "gcr": "gcr-Latn-GF", + "gd": "gd-Latn-GB", + "gez": "gez-Ethi-ET", + "ggn": "ggn-Deva-NP", + "gil": "gil-Latn-KI", + "gjk": "gjk-Arab-PK", + "gju": "gju-Arab-PK", + "gl": "gl-Latn-ES", + "gn": "gn-Latn-PY", + "gon": "gon-Telu-IN", + "gor": "gor-Latn-ID", + "gos": "gos-Latn-NL", + "grt": "grt-Beng-IN", + "gsw": "gsw-Latn-CH", + "gu": "gu-Gujr-IN", + "gub": "gub-Latn-BR", + "guz": "guz-Latn-KE", + "gv": "gv-Latn-IM", + "gvr": "gvr-Deva-NP", + "gwi": "gwi-Latn-CA", + "ha": "ha-Latn-NG", + "ha-CM": "ha-Arab-CM", + "ha-SD": "ha-Arab-SD", + "haw": "haw-Latn-US", + "he": "he-Hebr-IL", + "hi": "hi-Deva-IN", + "hil": "hil-Latn-PH", + "hnd": "hnd-Arab-PK", + "hne": "hne-Deva-IN", + "hnn": "hnn-Latn-PH", + "ho": "ho-Latn-PG", + "hoc": "hoc-Deva-IN", + "hoj": "hoj-Deva-IN", + "hr": "hr-Latn-HR", + "hsb": "hsb-Latn-DE", + "ht": "ht-Latn-HT", + "hu": "hu-Latn-HU", + "hy": "hy-Armn-AM", + "ia": "ia-Latn-FR", + "ibb": "ibb-Latn-NG", + "id": "id-Latn-ID", + "ig": "ig-Latn-NG", + "ii": "ii-Yiii-CN", + "ik": "ik-Latn-US", + "ilo": "ilo-Latn-PH", + "in": "in-Latn-ID", + "inh": "inh-Cyrl-RU", + "is": "is-Latn-IS", + "it": "it-Latn-IT", + "iu": "iu-Cans-CA", + "iw": "iw-Hebr-IL", + "ja": "ja-Jpan-JP", + "jgo": "jgo-Latn-CM", + "ji": "ji-Hebr-UA", + "jmc": "jmc-Latn-TZ", + "jml": "jml-Deva-NP", + "jv": "jv-Latn-ID", + "jw": "jw-Latn-ID", + "ka": "ka-Geor-GE", + "kaa": "kaa-Cyrl-UZ", + "kab": "kab-Latn-DZ", + "kaj": "kaj-Latn-NG", + "kam": "kam-Latn-KE", + "kao": "kao-Latn-ML", + "kbd": "kbd-Cyrl-RU", + "kcg": "kcg-Latn-NG", + "kck": "kck-Latn-ZW", + "kde": "kde-Latn-TZ", + "kdt": "kdt-Thai-TH", + "kea": "kea-Latn-CV", + "ken": "ken-Latn-CM", + "kfo": "kfo-Latn-CI", + "kfr": "kfr-Deva-IN", + "kg": "kg-Latn-CD", + "kge": "kge-Latn-ID", + "kgp": "kgp-Latn-BR", + "kha": "kha-Latn-IN", + "khb": "khb-Talu-CN", + "khq": "khq-Latn-ML", + "kht": "kht-Mymr-IN", + "khw": "khw-Arab-PK", + "ki": "ki-Latn-KE", + "kj": "kj-Latn-NA", + "kjg": "kjg-Laoo-LA", + "kk": "kk-Cyrl-KZ", + "kk-AF": "kk-Arab-AF", + "kk-Arab": "kk-Arab-CN", + "kk-CN": "kk-Arab-CN", + "kk-IR": "kk-Arab-IR", + "kk-MN": "kk-Arab-MN", + "kkj": "kkj-Latn-CM", + "kl": "kl-Latn-GL", + "kln": "kln-Latn-KE", + "km": "km-Khmr-KH", + "kmb": "kmb-Latn-AO", + "kn": "kn-Knda-IN", + "ko": "ko-Kore-KR", + "koi": "koi-Cyrl-RU", + "kok": "kok-Deva-IN", + "kos": "kos-Latn-FM", + "kpe": "kpe-Latn-LR", + "krc": "krc-Cyrl-RU", + "kri": "kri-Latn-SL", + "krl": "krl-Latn-RU", + "kru": "kru-Deva-IN", + "ks": "ks-Arab-IN", + "ksb": "ksb-Latn-TZ", + "ksf": "ksf-Latn-CM", + "ksh": "ksh-Latn-DE", + "ku": "ku-Latn-TR", + "ku-Arab": "ku-Arab-IQ", + "ku-LB": "ku-Arab-LB", + "kum": "kum-Cyrl-RU", + "kv": "kv-Cyrl-RU", + "kvr": "kvr-Latn-ID", + "kvx": "kvx-Arab-PK", + "kw": "kw-Latn-GB", + "kxp": "kxp-Arab-PK", + "ky": "ky-Cyrl-KG", + "ky-Arab": "ky-Arab-CN", + "ky-CN": "ky-Arab-CN", + "ky-Latn": "ky-Latn-TR", + "ky-TR": "ky-Latn-TR", + "la": "la-Latn-VA", + "lag": "lag-Latn-TZ", + "lah": "lah-Arab-PK", + "lb": "lb-Latn-LU", + "lbe": "lbe-Cyrl-RU", + "lbw": "lbw-Latn-ID", + "lcp": "lcp-Thai-CN", + "lep": "lep-Lepc-IN", + "lez": "lez-Cyrl-RU", + "lg": "lg-Latn-UG", + "li": "li-Latn-NL", + "lif": "lif-Deva-NP", + "lis": "lis-Lisu-CN", + "lki": "lki-Arab-IR", + "lkt": "lkt-Latn-US", + "lmn": "lmn-Telu-IN", + "lmo": "lmo-Latn-CH", + "ln": "ln-Latn-CD", + "lo": "lo-Laoo-LA", + "lol": "lol-Latn-CD", + "loz": "loz-Latn-ZM", + "lt": "lt-Latn-LT", + "lu": "lu-Latn-CD", + "lua": "lua-Latn-CD", + "luo": "luo-Latn-KE", + "luy": "luy-Latn-KE", + "luz": "luz-Arab-IR", + "lv": "lv-Latn-LV", + "lwl": "lwl-Thai-TH", + "mad": "mad-Latn-ID", + "maf": "maf-Latn-CM", + "mag": "mag-Deva-IN", + "mai": "mai-Deva-IN", + "mak": "mak-Latn-ID", + "man": "man-Latn-GM", + "man-GN": "man-Nkoo-GN", + "man-Nkoo": "man-Nkoo-GN", + "mas": "mas-Latn-KE", + "maz": "maz-Latn-MX", + "mdf": "mdf-Cyrl-RU", + "mdh": "mdh-Latn-PH", + "mdr": "mdr-Latn-ID", + "men": "men-Latn-SL", + "mer": "mer-Latn-KE", + "mfe": "mfe-Latn-MU", + "mg": "mg-Latn-MG", + "mgh": "mgh-Latn-MZ", + "mgo": "mgo-Latn-CM", + "mgp": "mgp-Deva-NP", + "mgy": "mgy-Latn-TZ", + "mh": "mh-Latn-MH", + "mi": "mi-Latn-NZ", + "min": "min-Latn-ID", + "mk": "mk-Cyrl-MK", + "ml": "ml-Mlym-IN", + "mn": "mn-Cyrl-MN", + "mn-CN": "mn-Mong-CN", + "mn-Mong": "mn-Mong-CN", + "mni": "mni-Beng-IN", + "mnw": "mnw-Mymr-MM", + "moe": "moe-Latn-CA", + "mos": "mos-Latn-BF", + "mr": "mr-Deva-IN", + "mrd": "mrd-Deva-NP", + "mrj": "mrj-Cyrl-RU", + "ms": "ms-Latn-MY", + "ms-CC": "ms-Arab-CC", + "ms-ID": "ms-Arab-ID", + "mt": "mt-Latn-MT", + "mua": "mua-Latn-CM", + "mvy": "mvy-Arab-PK", + "mwk": "mwk-Latn-ML", + "mwr": "mwr-Deva-IN", + "mxc": "mxc-Latn-ZW", + "my": "my-Mymr-MM", + "myv": "myv-Cyrl-RU", + "na": "na-Latn-NR", + "nap": "nap-Latn-IT", + "naq": "naq-Latn-NA", + "nb": "nb-Latn-NO", + "nch": "nch-Latn-MX", + "nd": "nd-Latn-ZW", + "nds": "nds-Latn-DE", + "ne": "ne-Deva-NP", + "new": "new-Deva-NP", + "ng": "ng-Latn-NA", + "nhe": "nhe-Latn-MX", + "nhw": "nhw-Latn-MX", + "nij": "nij-Latn-ID", + "niu": "niu-Latn-NU", + "nl": "nl-Latn-NL", + "nmg": "nmg-Latn-CM", + "nn": "nn-Latn-NO", + "nnh": "nnh-Latn-CM", + "no": "no-Latn-NO", + "nod": "nod-Lana-TH", + "nr": "nr-Latn-ZA", + "nsk": "nsk-Cans-CA", + "nso": "nso-Latn-ZA", + "nus": "nus-Latn-SD", + "nv": "nv-Latn-US", + "nxq": "nxq-Latn-CN", + "ny": "ny-Latn-MW", + "nym": "nym-Latn-TZ", + "nyn": "nyn-Latn-UG", + "oc": "oc-Latn-FR", + "om": "om-Latn-ET", + "or": "or-Orya-IN", + "os": "os-Cyrl-GE", + "pa": "pa-Guru-IN", + "pa-Arab": "pa-Arab-PK", + "pa-PK": "pa-Arab-PK", + "pag": "pag-Latn-PH", + "pam": "pam-Latn-PH", + "pap": "pap-Latn-AW", + "pau": "pau-Latn-PW", + "pcm": "pcm-Latn-NG", + "pko": "pko-Latn-KE", + "pl": "pl-Latn-PL", + "pon": "pon-Latn-FM", + "prd": "prd-Arab-IR", + "prg": "prg-Latn-001", + "ps": "ps-Arab-AF", + "pt": "pt-Latn-BR", + "puu": "puu-Latn-GA", + "qu": "qu-Latn-PE", + "raj": "raj-Latn-IN", + "rcf": "rcf-Latn-RE", + "rej": "rej-Latn-ID", + "ria": "ria-Latn-IN", + "rjs": "rjs-Deva-NP", + "rkt": "rkt-Beng-BD", + "rm": "rm-Latn-CH", + "rmf": "rmf-Latn-FI", + "rmo": "rmo-Latn-CH", + "rmt": "rmt-Arab-IR", + "rmu": "rmu-Latn-SE", + "rn": "rn-Latn-BI", + "rng": "rng-Latn-MZ", + "ro": "ro-Latn-RO", + "rob": "rob-Latn-ID", + "rof": "rof-Latn-TZ", + "ru": "ru-Cyrl-RU", + "rue": "rue-Cyrl-UA", + "rw": "rw-Latn-RW", + "rwk": "rwk-Latn-TZ", + "ryu": "ryu-Kana-JP", + "sa": "sa-Deva-IN", + "saf": "saf-Latn-GH", + "sah": "sah-Cyrl-RU", + "saq": "saq-Latn-KE", + "sas": "sas-Latn-ID", + "sat": "sat-Latn-IN", + "saz": "saz-Saur-IN", + "sbp": "sbp-Latn-TZ", + "scn": "scn-Latn-IT", + "sco": "sco-Latn-GB", + "scs": "scs-Latn-CA", + "sd": "sd-Arab-PK", + "sd-Deva": "sd-Deva-IN", + "sdh": "sdh-Arab-IR", + "se": "se-Latn-NO", + "sef": "sef-Latn-CI", + "seh": "seh-Latn-MZ", + "ses": "ses-Latn-ML", + "sg": "sg-Latn-CF", + "shi": "shi-Tfng-MA", + "shn": "shn-Mymr-MM", + "si": "si-Sinh-LK", + "sid": "sid-Latn-ET", + "sk": "sk-Latn-SK", + "sl": "sl-Latn-SI", + "sm": "sm-Latn-WS", + "sma": "sma-Latn-SE", + "smj": "smj-Latn-SE", + "smn": "smn-Latn-FI", + "sms": "sms-Latn-FI", + "sn": "sn-Latn-ZW", + "snk": "snk-Latn-ML", + "so": "so-Latn-SO", + "sq": "sq-Latn-AL", + "sr": "sr-Cyrl-RS", + "sr-ME": "sr-Latn-ME", + "sr-RO": "sr-Latn-RO", + "sr-RU": "sr-Latn-RU", + "sr-TR": "sr-Latn-TR", + "srn": "srn-Latn-SR", + "srr": "srr-Latn-SN", + "srx": "srx-Deva-IN", + "ss": "ss-Latn-ZA", + "ssy": "ssy-Latn-ER", + "st": "st-Latn-ZA", + "su": "su-Latn-ID", + "suk": "suk-Latn-TZ", + "sus": "sus-Latn-GN", + "sv": "sv-Latn-SE", + "sw": "sw-Latn-TZ", + "swb": "swb-Arab-YT", + "swc": "swc-Latn-CD", + "sxn": "sxn-Latn-ID", + "syl": "syl-Beng-BD", + "syr": "syr-Syrc-IQ", + "ta": "ta-Taml-IN", + "taj": "taj-Deva-NP", + "tbw": "tbw-Latn-PH", + "tcy": "tcy-Knda-IN", + "tdd": "tdd-Tale-CN", + "tdg": "tdg-Deva-NP", + "tdh": "tdh-Deva-NP", + "te": "te-Telu-IN", + "tem": "tem-Latn-SL", + "teo": "teo-Latn-UG", + "tet": "tet-Latn-TL", + "tg": "tg-Cyrl-TJ", + "tg-Arab": "tg-Arab-PK", + "tg-PK": "tg-Arab-PK", + "th": "th-Thai-TH", + "thl": "thl-Deva-NP", + "thq": "thq-Deva-NP", + "thr": "thr-Deva-NP", + "ti": "ti-Ethi-ET", + "tig": "tig-Ethi-ER", + "tiv": "tiv-Latn-NG", + "tk": "tk-Latn-TM", + "tkl": "tkl-Latn-TK", + "tkt": "tkt-Deva-NP", + "tl": "tl-Latn-PH", + "tmh": "tmh-Latn-NE", + "tn": "tn-Latn-ZA", + "to": "to-Latn-TO", + "tpi": "tpi-Latn-PG", + "tr": "tr-Latn-TR", + "trv": "trv-Latn-TW", + "ts": "ts-Latn-ZA", + "tsf": "tsf-Deva-NP", + "tsg": "tsg-Latn-PH", + "tsj": "tsj-Tibt-BT", + "tt": "tt-Cyrl-RU", + "ttj": "ttj-Latn-UG", + "tts": "tts-Thai-TH", + "tum": "tum-Latn-MW", + "tvl": "tvl-Latn-TV", + "twq": "twq-Latn-NE", + "ty": "ty-Latn-PF", + "tyv": "tyv-Cyrl-RU", + "tzm": "tzm-Latn-MA", + "udm": "udm-Cyrl-RU", + "ug": "ug-Arab-CN", + "ug-Cyrl": "ug-Cyrl-KZ", + "ug-KZ": "ug-Cyrl-KZ", + "ug-MN": "ug-Cyrl-MN", + "uk": "uk-Cyrl-UA", + "uli": "uli-Latn-FM", + "umb": "umb-Latn-AO", + "und": "en-Latn-US", + "und-002": "en-Latn-NG", + "und-003": "en-Latn-US", + "und-005": "pt-Latn-BR", + "und-009": "en-Latn-AU", + "und-011": "en-Latn-NG", + "und-013": "es-Latn-MX", + "und-014": "en-Latn-KE", + "und-015": "ar-Arab-EG", + "und-017": "sw-Latn-CD", + "und-018": "en-Latn-ZA", + "und-019": "en-Latn-US", + "und-021": "en-Latn-US", + "und-029": "es-Latn-CU", + "und-030": "zh-Hans-CN", + "und-034": "hi-Deva-IN", + "und-035": "id-Latn-ID", + "und-039": "it-Latn-IT", + "und-053": "en-Latn-AU", + "und-054": "en-Latn-PG", + "und-057": "en-Latn-KI", + "und-061": "sm-Latn-WS", + "und-142": "zh-Hans-CN", + "und-143": "uz-Latn-UZ", + "und-145": "ar-Arab-SA", + "und-150": "ru-Cyrl-RU", + "und-151": "ru-Cyrl-RU", + "und-154": "en-Latn-GB", + "und-155": "de-Latn-DE", + "und-419": "es-Latn-419", + "und-AD": "ca-Latn-AD", + "und-AE": "ar-Arab-AE", + "und-AF": "fa-Arab-AF", + "und-AL": "sq-Latn-AL", + "und-AM": "hy-Armn-AM", + "und-AO": "pt-Latn-AO", + "und-AQ": "und-Latn-AQ", + "und-AR": "es-Latn-AR", + "und-AS": "sm-Latn-AS", + "und-AT": "de-Latn-AT", + "und-AW": "nl-Latn-AW", + "und-AX": "sv-Latn-AX", + "und-AZ": "az-Latn-AZ", + "und-Arab": "ar-Arab-EG", + "und-Arab-CC": "ms-Arab-CC", + "und-Arab-CN": "ug-Arab-CN", + "und-Arab-GB": "ks-Arab-GB", + "und-Arab-ID": "ms-Arab-ID", + "und-Arab-IN": "ur-Arab-IN", + "und-Arab-KH": "cja-Arab-KH", + "und-Arab-MN": "kk-Arab-MN", + "und-Arab-MU": "ur-Arab-MU", + "und-Arab-NG": "ha-Arab-NG", + "und-Arab-PK": "ur-Arab-PK", + "und-Arab-TJ": "fa-Arab-TJ", + "und-Arab-TR": "zza-Arab-TR", + "und-Arab-YT": "swb-Arab-YT", + "und-Armi": "arc-Armi-IR", + "und-Armn": "hy-Armn-AM", + "und-Avst": "ae-Avst-IR", + "und-BA": "bs-Latn-BA", + "und-BD": "bn-Beng-BD", + "und-BE": "nl-Latn-BE", + "und-BF": "fr-Latn-BF", + "und-BG": "bg-Cyrl-BG", + "und-BH": "ar-Arab-BH", + "und-BI": "rn-Latn-BI", + "und-BJ": "fr-Latn-BJ", + "und-BL": "fr-Latn-BL", + "und-BN": "ms-Latn-BN", + "und-BO": "es-Latn-BO", + "und-BQ": "pap-Latn-BQ", + "und-BR": "pt-Latn-BR", + "und-BT": "dz-Tibt-BT", + "und-BV": "und-Latn-BV", + "und-BY": "be-Cyrl-BY", + "und-Bali": "ban-Bali-ID", + "und-Bamu": "bax-Bamu-CM", + "und-Batk": "bbc-Batk-ID", + "und-Beng": "bn-Beng-BD", + "und-Bopo": "zh-Bopo-TW", + "und-Brah": "pra-Brah-IN", + "und-Brai": "und-Brai-FR", + "und-Bugi": "bug-Bugi-ID", + "und-Buhd": "bku-Buhd-PH", + "und-CD": "sw-Latn-CD", + "und-CF": "fr-Latn-CF", + "und-CG": "fr-Latn-CG", + "und-CH": "de-Latn-CH", + "und-CI": "fr-Latn-CI", + "und-CL": "es-Latn-CL", + "und-CM": "fr-Latn-CM", + "und-CN": "zh-Hans-CN", + "und-CO": "es-Latn-CO", + "und-CP": "und-Latn-CP", + "und-CR": "es-Latn-CR", + "und-CU": "es-Latn-CU", + "und-CV": "pt-Latn-CV", + "und-CW": "pap-Latn-CW", + "und-CY": "el-Grek-CY", + "und-CZ": "cs-Latn-CZ", + "und-Cakm": "ccp-Cakm-BD", + "und-Cans": "cr-Cans-CA", + "und-Cari": "xcr-Cari-TR", + "und-Cham": "cjm-Cham-VN", + "und-Cher": "chr-Cher-US", + "und-Copt": "cop-Copt-EG", + "und-Cprt": "grc-Cprt-CY", + "und-Cyrl": "ru-Cyrl-RU", + "und-Cyrl-AL": "mk-Cyrl-AL", + "und-Cyrl-BA": "sr-Cyrl-BA", + "und-Cyrl-GE": "ab-Cyrl-GE", + "und-Cyrl-GR": "mk-Cyrl-GR", + "und-Cyrl-MD": "uk-Cyrl-MD", + "und-Cyrl-PL": "be-Cyrl-PL", + "und-Cyrl-RO": "bg-Cyrl-RO", + "und-Cyrl-SK": "uk-Cyrl-SK", + "und-Cyrl-TR": "kbd-Cyrl-TR", + "und-Cyrl-XK": "sr-Cyrl-XK", + "und-DE": "de-Latn-DE", + "und-DJ": "aa-Latn-DJ", + "und-DK": "da-Latn-DK", + "und-DO": "es-Latn-DO", + "und-DZ": "ar-Arab-DZ", + "und-Deva": "hi-Deva-IN", + "und-Deva-BT": "ne-Deva-BT", + "und-Deva-MU": "bho-Deva-MU", + "und-Deva-PK": "btv-Deva-PK", + "und-EA": "es-Latn-EA", + "und-EC": "es-Latn-EC", + "und-EE": "et-Latn-EE", + "und-EG": "ar-Arab-EG", + "und-EH": "ar-Arab-EH", + "und-ER": "ti-Ethi-ER", + "und-ES": "es-Latn-ES", + "und-ET": "am-Ethi-ET", + "und-EU": "en-Latn-GB", + "und-Egyp": "egy-Egyp-EG", + "und-Ethi": "am-Ethi-ET", + "und-FI": "fi-Latn-FI", + "und-FM": "chk-Latn-FM", + "und-FO": "fo-Latn-FO", + "und-FR": "fr-Latn-FR", + "und-GA": "fr-Latn-GA", + "und-GE": "ka-Geor-GE", + "und-GF": "fr-Latn-GF", + "und-GH": "ak-Latn-GH", + "und-GL": "kl-Latn-GL", + "und-GN": "fr-Latn-GN", + "und-GP": "fr-Latn-GP", + "und-GQ": "es-Latn-GQ", + "und-GR": "el-Grek-GR", + "und-GS": "und-Latn-GS", + "und-GT": "es-Latn-GT", + "und-GW": "pt-Latn-GW", + "und-Geor": "ka-Geor-GE", + "und-Glag": "cu-Glag-BG", + "und-Goth": "got-Goth-UA", + "und-Grek": "el-Grek-GR", + "und-Grek-TR": "bgx-Grek-TR", + "und-Gujr": "gu-Gujr-IN", + "und-Guru": "pa-Guru-IN", + "und-HK": "zh-Hant-HK", + "und-HM": "und-Latn-HM", + "und-HN": "es-Latn-HN", + "und-HR": "hr-Latn-HR", + "und-HT": "ht-Latn-HT", + "und-HU": "hu-Latn-HU", + "und-Hang": "ko-Hang-KR", + "und-Hani": "zh-Hani-CN", + "und-Hano": "hnn-Hano-PH", + "und-Hans": "zh-Hans-CN", + "und-Hant": "zh-Hant-TW", + "und-Hebr": "he-Hebr-IL", + "und-Hebr-CA": "yi-Hebr-CA", + "und-Hebr-GB": "yi-Hebr-GB", + "und-Hebr-SE": "yi-Hebr-SE", + "und-Hebr-UA": "yi-Hebr-UA", + "und-Hebr-US": "yi-Hebr-US", + "und-Hira": "ja-Hira-JP", + "und-IC": "es-Latn-IC", + "und-ID": "id-Latn-ID", + "und-IL": "he-Hebr-IL", + "und-IN": "hi-Deva-IN", + "und-IQ": "ar-Arab-IQ", + "und-IR": "fa-Arab-IR", + "und-IS": "is-Latn-IS", + "und-IT": "it-Latn-IT", + "und-Ital": "ett-Ital-IT", + "und-JO": "ar-Arab-JO", + "und-JP": "ja-Jpan-JP", + "und-Java": "jv-Java-ID", + "und-Jpan": "ja-Jpan-JP", + "und-KG": "ky-Cyrl-KG", + "und-KH": "km-Khmr-KH", + "und-KM": "ar-Arab-KM", + "und-KP": "ko-Kore-KP", + "und-KR": "ko-Kore-KR", + "und-KW": "ar-Arab-KW", + "und-KZ": "ru-Cyrl-KZ", + "und-Kali": "eky-Kali-MM", + "und-Kana": "ja-Kana-JP", + "und-Khar": "pra-Khar-PK", + "und-Khmr": "km-Khmr-KH", + "und-Knda": "kn-Knda-IN", + "und-Kore": "ko-Kore-KR", + "und-Kthi": "bh-Kthi-IN", + "und-LA": "lo-Laoo-LA", + "und-LB": "ar-Arab-LB", + "und-LI": "de-Latn-LI", + "und-LK": "si-Sinh-LK", + "und-LS": "st-Latn-LS", + "und-LT": "lt-Latn-LT", + "und-LU": "fr-Latn-LU", + "und-LV": "lv-Latn-LV", + "und-LY": "ar-Arab-LY", + "und-Lana": "nod-Lana-TH", + "und-Laoo": "lo-Laoo-LA", + "und-Latn-AF": "tk-Latn-AF", + "und-Latn-AM": "az-Latn-AM", + "und-Latn-BG": "tr-Latn-BG", + "und-Latn-CN": "za-Latn-CN", + "und-Latn-CY": "tr-Latn-CY", + "und-Latn-DZ": "fr-Latn-DZ", + "und-Latn-ET": "en-Latn-ET", + "und-Latn-GE": "ku-Latn-GE", + "und-Latn-GR": "tr-Latn-GR", + "und-Latn-IL": "ro-Latn-IL", + "und-Latn-IR": "tk-Latn-IR", + "und-Latn-KM": "fr-Latn-KM", + "und-Latn-KZ": "de-Latn-KZ", + "und-Latn-LB": "fr-Latn-LB", + "und-Latn-MA": "fr-Latn-MA", + "und-Latn-MK": "sq-Latn-MK", + "und-Latn-MO": "pt-Latn-MO", + "und-Latn-MR": "fr-Latn-MR", + "und-Latn-RU": "krl-Latn-RU", + "und-Latn-SY": "fr-Latn-SY", + "und-Latn-TN": "fr-Latn-TN", + "und-Latn-TW": "trv-Latn-TW", + "und-Latn-UA": "pl-Latn-UA", + "und-Lepc": "lep-Lepc-IN", + "und-Limb": "lif-Limb-IN", + "und-Linb": "grc-Linb-GR", + "und-Lisu": "lis-Lisu-CN", + "und-Lyci": "xlc-Lyci-TR", + "und-Lydi": "xld-Lydi-TR", + "und-MA": "ar-Arab-MA", + "und-MC": "fr-Latn-MC", + "und-MD": "ro-Latn-MD", + "und-ME": "sr-Latn-ME", + "und-MF": "fr-Latn-MF", + "und-MG": "mg-Latn-MG", + "und-MK": "mk-Cyrl-MK", + "und-ML": "bm-Latn-ML", + "und-MM": "my-Mymr-MM", + "und-MN": "mn-Cyrl-MN", + "und-MO": "zh-Hant-MO", + "und-MQ": "fr-Latn-MQ", + "und-MR": "ar-Arab-MR", + "und-MT": "mt-Latn-MT", + "und-MU": "mfe-Latn-MU", + "und-MV": "dv-Thaa-MV", + "und-MX": "es-Latn-MX", + "und-MY": "ms-Latn-MY", + "und-MZ": "pt-Latn-MZ", + "und-Mand": "myz-Mand-IR", + "und-Merc": "xmr-Merc-SD", + "und-Mero": "xmr-Mero-SD", + "und-Mlym": "ml-Mlym-IN", + "und-Mong": "mn-Mong-CN", + "und-Mtei": "mni-Mtei-IN", + "und-Mymr": "my-Mymr-MM", + "und-Mymr-IN": "kht-Mymr-IN", + "und-Mymr-TH": "mnw-Mymr-TH", + "und-NA": "af-Latn-NA", + "und-NC": "fr-Latn-NC", + "und-NE": "ha-Latn-NE", + "und-NI": "es-Latn-NI", + "und-NL": "nl-Latn-NL", + "und-NO": "nb-Latn-NO", + "und-NP": "ne-Deva-NP", + "und-Nkoo": "man-Nkoo-GN", + "und-OM": "ar-Arab-OM", + "und-Ogam": "sga-Ogam-IE", + "und-Olck": "sat-Olck-IN", + "und-Orkh": "otk-Orkh-MN", + "und-Orya": "or-Orya-IN", + "und-Osma": "so-Osma-SO", + "und-PA": "es-Latn-PA", + "und-PE": "es-Latn-PE", + "und-PF": "fr-Latn-PF", + "und-PG": "tpi-Latn-PG", + "und-PH": "fil-Latn-PH", + "und-PK": "ur-Arab-PK", + "und-PL": "pl-Latn-PL", + "und-PM": "fr-Latn-PM", + "und-PR": "es-Latn-PR", + "und-PS": "ar-Arab-PS", + "und-PT": "pt-Latn-PT", + "und-PW": "pau-Latn-PW", + "und-PY": "gn-Latn-PY", + "und-Phag": "lzh-Phag-CN", + "und-Phli": "pal-Phli-IR", + "und-Phnx": "phn-Phnx-LB", + "und-Plrd": "hmd-Plrd-CN", + "und-Prti": "xpr-Prti-IR", + "und-QA": "ar-Arab-QA", + "und-QO": "en-Latn-IO", + "und-RE": "fr-Latn-RE", + "und-RO": "ro-Latn-RO", + "und-RS": "sr-Cyrl-RS", + "und-RU": "ru-Cyrl-RU", + "und-RW": "rw-Latn-RW", + "und-Rjng": "rej-Rjng-ID", + "und-Runr": "non-Runr-SE", + "und-SA": "ar-Arab-SA", + "und-SC": "fr-Latn-SC", + "und-SD": "ar-Arab-SD", + "und-SE": "sv-Latn-SE", + "und-SI": "sl-Latn-SI", + "und-SJ": "nb-Latn-SJ", + "und-SK": "sk-Latn-SK", + "und-SM": "it-Latn-SM", + "und-SN": "fr-Latn-SN", + "und-SO": "so-Latn-SO", + "und-SR": "nl-Latn-SR", + "und-ST": "pt-Latn-ST", + "und-SV": "es-Latn-SV", + "und-SY": "ar-Arab-SY", + "und-Samr": "smp-Samr-IL", + "und-Sarb": "xsa-Sarb-YE", + "und-Saur": "saz-Saur-IN", + "und-Shaw": "en-Shaw-GB", + "und-Shrd": "sa-Shrd-IN", + "und-Sinh": "si-Sinh-LK", + "und-Sora": "srb-Sora-IN", + "und-Sund": "su-Sund-ID", + "und-Sylo": "syl-Sylo-BD", + "und-Syrc": "syr-Syrc-IQ", + "und-TD": "fr-Latn-TD", + "und-TF": "fr-Latn-TF", + "und-TG": "fr-Latn-TG", + "und-TH": "th-Thai-TH", + "und-TJ": "tg-Cyrl-TJ", + "und-TK": "tkl-Latn-TK", + "und-TL": "pt-Latn-TL", + "und-TM": "tk-Latn-TM", + "und-TN": "ar-Arab-TN", + "und-TO": "to-Latn-TO", + "und-TR": "tr-Latn-TR", + "und-TV": "tvl-Latn-TV", + "und-TW": "zh-Hant-TW", + "und-TZ": "sw-Latn-TZ", + "und-Tagb": "tbw-Tagb-PH", + "und-Takr": "doi-Takr-IN", + "und-Tale": "tdd-Tale-CN", + "und-Talu": "khb-Talu-CN", + "und-Taml": "ta-Taml-IN", + "und-Tavt": "blt-Tavt-VN", + "und-Telu": "te-Telu-IN", + "und-Tfng": "zgh-Tfng-MA", + "und-Tglg": "fil-Tglg-PH", + "und-Thaa": "dv-Thaa-MV", + "und-Thai": "th-Thai-TH", + "und-Thai-CN": "lcp-Thai-CN", + "und-Thai-KH": "kdt-Thai-KH", + "und-Thai-LA": "kdt-Thai-LA", + "und-Tibt": "bo-Tibt-CN", + "und-UA": "uk-Cyrl-UA", + "und-UG": "sw-Latn-UG", + "und-UY": "es-Latn-UY", + "und-UZ": "uz-Latn-UZ", + "und-Ugar": "uga-Ugar-SY", + "und-VA": "la-Latn-VA", + "und-VE": "es-Latn-VE", + "und-VN": "vi-Latn-VN", + "und-VU": "bi-Latn-VU", + "und-Vaii": "vai-Vaii-LR", + "und-WF": "fr-Latn-WF", + "und-WS": "sm-Latn-WS", + "und-XK": "sq-Latn-XK", + "und-Xpeo": "peo-Xpeo-IR", + "und-Xsux": "akk-Xsux-IQ", + "und-YE": "ar-Arab-YE", + "und-YT": "fr-Latn-YT", + "und-Yiii": "ii-Yiii-CN", + "unr": "unr-Beng-IN", + "unr-Deva": "unr-Deva-NP", + "unr-NP": "unr-Deva-NP", + "unx": "unx-Beng-IN", + "ur": "ur-Arab-PK", + "uz": "uz-Latn-UZ", + "uz-AF": "uz-Arab-AF", + "uz-Arab": "uz-Arab-AF", + "uz-CN": "uz-Cyrl-CN", + "vai": "vai-Vaii-LR", + "ve": "ve-Latn-ZA", + "vi": "vi-Latn-VN", + "vic": "vic-Latn-SX", + "vo": "vo-Latn-001", + "vun": "vun-Latn-TZ", + "wa": "wa-Latn-BE", + "wae": "wae-Latn-CH", + "wal": "wal-Ethi-ET", + "war": "war-Latn-PH", + "wo": "wo-Latn-SN", + "xav": "xav-Latn-BR", + "xh": "xh-Latn-ZA", + "xog": "xog-Latn-UG", + "xsr": "xsr-Deva-NP", + "yao": "yao-Latn-MZ", + "yap": "yap-Latn-FM", + "yav": "yav-Latn-CM", + "ybb": "ybb-Latn-CM", + "yi": "yi-Hebr-UA", + "yo": "yo-Latn-NG", + "yua": "yua-Latn-MX", + "za": "za-Latn-CN", + "zea": "zea-Latn-NL", + "zgh": "zgh-Tfng-MA", + "zh": "zh-Hans-CN", + "zh-AU": "zh-Hant-AU", + "zh-BN": "zh-Hant-BN", + "zh-GB": "zh-Hant-GB", + "zh-GF": "zh-Hant-GF", + "zh-HK": "zh-Hant-HK", + "zh-Hant": "zh-Hant-TW", + "zh-ID": "zh-Hant-ID", + "zh-MO": "zh-Hant-MO", + "zh-MY": "zh-Hant-MY", + "zh-PA": "zh-Hant-PA", + "zh-PF": "zh-Hant-PF", + "zh-PH": "zh-Hant-PH", + "zh-SR": "zh-Hant-SR", + "zh-TH": "zh-Hant-TH", + "zh-TW": "zh-Hant-TW", + "zh-US": "zh-Hant-US", + "zh-VN": "zh-Hant-VN", + "zmi": "zmi-Latn-MY", + "zu": "zu-Latn-ZA", + "zza": "zza-Arab-TR" } + } }); -// weekData Globalize.load({ "supplemental": { "version": { - "_cldrVersion": "24", - "_number": "$Revision: 9270 $" + "_cldrVersion": "25", + "_number": "$Revision: 91 $" }, "generation": { - "_date": "$Date: 2013-08-25 16:44:03 -0500 (Sun, 25 Aug 2013) $" - }, - "weekData": { - "minDays": { - "001": "1", - "AD": "4", - "AN": "4", - "AT": "4", - "AX": "4", - "BE": "4", - "BG": "4", - "CH": "4", - "CZ": "4", - "DE": "4", - "DK": "4", - "EE": "4", - "ES": "4", - "FI": "4", - "FJ": "4", - "FO": "4", - "FR": "4", - "GB": "4", - "GF": "4", - "GG": "4", - "GI": "4", - "GP": "4", - "GR": "4", - "GU": "1", - "HU": "4", - "IE": "4", - "IM": "4", - "IS": "4", - "IT": "4", - "JE": "4", - "LI": "4", - "LT": "4", - "LU": "4", - "MC": "4", - "MQ": "4", - "NL": "4", - "NO": "4", - "PL": "4", - "PT": "4", - "RE": "4", - "SE": "4", - "SJ": "4", - "SK": "4", - "SM": "4", - "UM": "1", - "US": "1", - "VA": "4", - "VI": "1" - }, - "firstDay": { - "001": "mon", - "AD": "mon", - "AE": "sat", - "AF": "sat", - "AG": "sun", - "AI": "mon", - "AL": "mon", - "AM": "mon", - "AN": "mon", - "AR": "sun", - "AS": "sun", - "AT": "mon", - "AU": "sun", - "AX": "mon", - "AZ": "mon", - "BA": "mon", - "BD": "fri", - "BE": "mon", - "BG": "mon", - "BH": "sat", - "BM": "mon", - "BN": "mon", - "BR": "sun", - "BS": "sun", - "BT": "sun", - "BW": "sun", - "BY": "sun", - "BZ": "sun", - "CA": "sun", - "CH": "mon", - "CL": "mon", - "CM": "mon", - "CN": "sun", - "CO": "sun", - "CR": "mon", - "CY": "mon", - "CZ": "mon", - "DE": "mon", - "DJ": "sat", - "DK": "mon", - "DM": "sun", - "DO": "sun", - "DZ": "sat", - "EC": "mon", - "EE": "mon", - "EG": "sat", - "ES": "mon", - "ET": "sun", - "FI": "mon", - "FJ": "mon", - "FO": "mon", - "FR": "mon", - "GB": "mon", - "GE": "mon", - "GF": "mon", - "GP": "mon", - "GR": "mon", - "GT": "sun", - "GU": "sun", - "HK": "sun", - "HN": "sun", - "HR": "mon", - "HU": "mon", - "ID": "sun", - "IE": "sun", - "IL": "sun", - "IN": "sun", - "IQ": "sat", - "IR": "sat", - "IS": "mon", - "IT": "mon", - "JM": "sun", - "JO": "sat", - "JP": "sun", - "KE": "sun", - "KG": "mon", - "KH": "sun", - "KR": "sun", - "KW": "sat", - "KZ": "mon", - "LA": "sun", - "LB": "mon", - "LI": "mon", - "LK": "mon", - "LT": "mon", - "LU": "mon", - "LV": "mon", - "LY": "sat", - "MA": "sat", - "MC": "mon", - "MD": "mon", - "ME": "mon", - "MH": "sun", - "MK": "mon", - "MM": "sun", - "MN": "mon", - "MO": "sun", - "MQ": "mon", - "MT": "sun", - "MV": "fri", - "MX": "sun", - "MY": "mon", - "MZ": "sun", - "NI": "sun", - "NL": "mon", - "NO": "mon", - "NP": "sun", - "NZ": "sun", - "OM": "sat", - "PA": "sun", - "PE": "sun", - "PH": "sun", - "PK": "sun", - "PL": "mon", - "PR": "sun", - "PT": "mon", - "PY": "sun", - "QA": "sat", - "RE": "mon", - "RO": "mon", - "RS": "mon", - "RU": "mon", - "SA": "sun", - "SD": "sat", - "SE": "mon", - "SG": "sun", - "SI": "mon", - "SK": "mon", - "SM": "mon", - "SV": "sun", - "SY": "sat", - "TH": "sun", - "TJ": "mon", - "TM": "mon", - "TN": "sun", - "TR": "mon", - "TT": "sun", - "TW": "sun", - "UA": "mon", - "UM": "sun", - "US": "sun", - "UY": "mon", - "UZ": "mon", - "VA": "mon", - "VE": "sun", - "VI": "sun", - "VN": "mon", - "WS": "sun", - "XK": "mon", - "YE": "sun", - "ZA": "sun", - "ZW": "sun" - }, - "firstDay-alt-variant": { - "GB": "sun" - }, - "weekendStart": { - "001": "sat", - "AE": "fri", - "AF": "thu", - "BH": "fri", - "DZ": "thu", - "EG": "fri", - "IL": "fri", - "IN": "sun", - "IQ": "fri", - "IR": "thu", - "JO": "fri", - "KW": "fri", - "LY": "fri", - "MA": "fri", - "OM": "thu", - "QA": "fri", - "SA": "fri", - "SD": "fri", - "SY": "fri", - "TN": "fri", - "YE": "fri" - }, - "weekendEnd": { - "001": "sun", - "AE": "sat", - "AF": "fri", - "BH": "sat", - "DZ": "fri", - "EG": "sat", - "IL": "sat", - "IQ": "sat", - "IR": "fri", - "JO": "sat", - "KW": "sat", - "LY": "sat", - "MA": "sat", - "OM": "fri", - "QA": "sat", - "SA": "sat", - "SD": "sat", - "SY": "sat", - "TN": "sat", - "YE": "sat" - } - } - } -}); - -// timeData -Globalize.load({ - "supplemental": { - "version": { - "_cldrVersion": "24", - "_number": "$Revision: 9270 $" - }, - "generation": { - "_date": "$Date: 2013-08-25 16:44:03 -0500 (Sun, 25 Aug 2013) $" + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" }, "timeData": { "001": { @@ -2343,6 +2166,10 @@ Globalize.load({ "_allowed": "H", "_preferred": "H" }, + "ID": { + "_allowed": "H", + "_preferred": "H" + }, "IL": { "_allowed": "H", "_preferred": "H" @@ -2695,443 +2522,805 @@ Globalize.load({ } }); -/** - * jQuery UI translation data - */ -var regions = { - "en": { - "closeText": "Done", - "prevText": "Prev", - "nextText": "Next", - "currentText": "Today", - "weekHeader": "Wk", - "dateFormat": "d", - "datePickerRole": "date picker" - }, - "af": { - "closeText": "Selekteer", - "prevText": "Vorige", - "nextText": "Volgende", - "currentText": "Vandag", - "weekHeader": "Wk", - "dateFormat": "d" - }, - "zh-TW": { - "closeText": "\u95dc\u9589", - "prevText": "<\u4e0a\u6708", - "nextText": "\u4e0b\u6708>", - "currentText": "\u4eca\u5929", - "weekHeader": "\u5468", - "dateFormat": "d" - }, - "ar": { - "closeText": "\u0625\u063a\u0644\u0627\u0642", - "prevText": "<\u0627\u0644\u0633\u0627\u0628\u0642", - "nextText": "\u0627\u0644\u062a\u0627\u0644\u064a>", - "currentText": "\u0627\u0644\u064a\u0648\u0645", - "weekHeader": "\u0623\u0633\u0628\u0648\u0639", - "dateFormat": "d" - }, - "az": { - "closeText": "Ba\u011fla", - "prevText": "<Geri", - "nextText": "\u0130r\u0259li>", - "currentText": "Bug\u00fcn", - "weekHeader": "Hf", - "dateFormat": "d" - }, - "bg": { - "closeText": "\u0437\u0430\u0442\u0432\u043e\u0440\u0438", - "prevText": "<\u043d\u0430\u0437\u0430\u0434", - "nextText": "\u043d\u0430\u043f\u0440\u0435\u0434>", - "currentText": "\u0434\u043d\u0435\u0441", - "weekHeader": "Wk", - "dateFormat": "d" - }, - "bs": { - "closeText": "Zatvori", - "prevText": "<", - "nextText": ">", - "currentText": "Danas", - "weekHeader": "Wk", - "dateFormat": "d" - }, - "ca": { - "closeText": "Tancar", - "prevText": "<Ant", - "nextText": "Seg>", - "currentText": "Avui", - "weekHeader": "Sm", - "dateFormat": "d" - }, - "cs": { - "closeText": "Zav\u0159\u00edt", - "prevText": "<D\u0159\u00edve", - "nextText": "Pozd\u011bji>", - "currentText": "Nyn\u00ed", - "weekHeader": "T\u00fdd", - "dateFormat": "d" - }, - "da": { - "closeText": "Luk", - "prevText": "<Forrige", - "nextText": "N\u00e6ste>", - "currentText": "Idag", - "weekHeader": "Uge", - "dateFormat": "d" - }, - "de": { - "closeText": "Schlie\u00dfen", - "prevText": "<Zur\u00fcck", - "nextText": "Vor>", - "currentText": "Heute", - "weekHeader": "Wo", - "dateFormat": "d" - }, +Globalize.load({ + "supplemental": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "generation": { + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + }, + "weekData": { + "minDays": { + "001": "1", + "GU": "1", + "UM": "1", + "US": "1", + "VI": "1", + "AD": "4", + "AN": "4", + "AT": "4", + "AX": "4", + "BE": "4", + "BG": "4", + "CH": "4", + "CZ": "4", + "DE": "4", + "DK": "4", + "EE": "4", + "ES": "4", + "FI": "4", + "FJ": "4", + "FO": "4", + "FR": "4", + "GB": "4", + "GF": "4", + "GG": "4", + "GI": "4", + "GP": "4", + "GR": "4", + "HU": "4", + "IE": "4", + "IM": "4", + "IS": "4", + "IT": "4", + "JE": "4", + "LI": "4", + "LT": "4", + "LU": "4", + "MC": "4", + "MQ": "4", + "NL": "4", + "NO": "4", + "PL": "4", + "PT": "4", + "RE": "4", + "SE": "4", + "SJ": "4", + "SK": "4", + "SM": "4", + "VA": "4" + }, + "firstDay": { + "001": "mon", + "AD": "mon", + "AI": "mon", + "AL": "mon", + "AM": "mon", + "AN": "mon", + "AT": "mon", + "AX": "mon", + "AZ": "mon", + "BA": "mon", + "BE": "mon", + "BG": "mon", + "BM": "mon", + "BN": "mon", + "BY": "mon", + "CH": "mon", + "CL": "mon", + "CM": "mon", + "CR": "mon", + "CY": "mon", + "CZ": "mon", + "DE": "mon", + "DK": "mon", + "EC": "mon", + "EE": "mon", + "ES": "mon", + "FI": "mon", + "FJ": "mon", + "FO": "mon", + "FR": "mon", + "GB": "mon", + "GE": "mon", + "GF": "mon", + "GP": "mon", + "GR": "mon", + "HR": "mon", + "HU": "mon", + "IS": "mon", + "IT": "mon", + "KG": "mon", + "KZ": "mon", + "LB": "mon", + "LI": "mon", + "LK": "mon", + "LT": "mon", + "LU": "mon", + "LV": "mon", + "MC": "mon", + "MD": "mon", + "ME": "mon", + "MK": "mon", + "MN": "mon", + "MQ": "mon", + "MY": "mon", + "NL": "mon", + "NO": "mon", + "PL": "mon", + "PT": "mon", + "RE": "mon", + "RO": "mon", + "RS": "mon", + "RU": "mon", + "SE": "mon", + "SI": "mon", + "SK": "mon", + "SM": "mon", + "TJ": "mon", + "TM": "mon", + "TR": "mon", + "UA": "mon", + "UY": "mon", + "UZ": "mon", + "VA": "mon", + "VN": "mon", + "XK": "mon", + "AE": "sat", + "AF": "sat", + "BH": "sat", + "DJ": "sat", + "DZ": "sat", + "EG": "sat", + "IQ": "sat", + "IR": "sat", + "JO": "sat", + "KW": "sat", + "LY": "sat", + "MA": "sat", + "OM": "sat", + "QA": "sat", + "SD": "sat", + "SY": "sat", + "AG": "sun", + "AR": "sun", + "AS": "sun", + "AU": "sun", + "BR": "sun", + "BS": "sun", + "BT": "sun", + "BW": "sun", + "BZ": "sun", + "CA": "sun", + "CN": "sun", + "CO": "sun", + "DM": "sun", + "DO": "sun", + "ET": "sun", + "GT": "sun", + "GU": "sun", + "HK": "sun", + "HN": "sun", + "ID": "sun", + "IE": "sun", + "IL": "sun", + "IN": "sun", + "JM": "sun", + "JP": "sun", + "KE": "sun", + "KH": "sun", + "KR": "sun", + "LA": "sun", + "MH": "sun", + "MM": "sun", + "MO": "sun", + "MT": "sun", + "MX": "sun", + "MZ": "sun", + "NI": "sun", + "NP": "sun", + "NZ": "sun", + "PA": "sun", + "PE": "sun", + "PH": "sun", + "PK": "sun", + "PR": "sun", + "PY": "sun", + "SA": "sun", + "SG": "sun", + "SV": "sun", + "TH": "sun", + "TN": "sun", + "TT": "sun", + "TW": "sun", + "UM": "sun", + "US": "sun", + "VE": "sun", + "VI": "sun", + "WS": "sun", + "YE": "sun", + "ZA": "sun", + "ZW": "sun", + "BD": "fri", + "MV": "fri" + }, + "firstDay-alt-variant": { + "GB": "sun" + }, + "weekendStart": { + "001": "sat", + "AE": "fri", + "BH": "fri", + "EG": "fri", + "IL": "fri", + "IQ": "fri", + "JO": "fri", + "KW": "fri", + "LY": "fri", + "MA": "fri", + "QA": "fri", + "SA": "fri", + "SD": "fri", + "SY": "fri", + "TN": "fri", + "YE": "fri", + "AF": "thu", + "DZ": "thu", + "IR": "thu", + "OM": "thu", + "IN": "sun" + }, + "weekendEnd": { + "001": "sun", + "AE": "sat", + "BH": "sat", + "EG": "sat", + "IL": "sat", + "IQ": "sat", + "JO": "sat", + "KW": "sat", + "LY": "sat", + "MA": "sat", + "QA": "sat", + "SA": "sat", + "SD": "sat", + "SY": "sat", + "TN": "sat", + "YE": "sat", + "AF": "fri", + "DZ": "fri", + "IR": "fri", + "OM": "fri" + } + } + } +}); + +/** + * jQuery UI translation data + */ +Globalize.loadTranslations({ + "en": { + "datepicker": { + "closeText": "Done", + "prevText": "Prev", + "nextText": "Next", + "currentText": "Today", + "weekHeader": "Wk", + "dateFormat": "d", + "datePickerRole": "date picker" + } + }, + "af": { + "datepicker": { + "closeText": "Selekteer", + "prevText": "Vorige", + "nextText": "Volgende", + "currentText": "Vandag", + "weekHeader": "Wk", + "dateFormat": "d" + } + }, + "zh-TW": { + "datepicker": { + "closeText": "\u95dc\u9589", + "prevText": "<\u4e0a\u6708", + "nextText": "\u4e0b\u6708>", + "currentText": "\u4eca\u5929", + "weekHeader": "\u5468", + "dateFormat": "d" + } + }, + "ar": { + "datepicker": { + "closeText": "\u0625\u063a\u0644\u0627\u0642", + "prevText": "<\u0627\u0644\u0633\u0627\u0628\u0642", + "nextText": "\u0627\u0644\u062a\u0627\u0644\u064a>", + "currentText": "\u0627\u0644\u064a\u0648\u0645", + "weekHeader": "\u0623\u0633\u0628\u0648\u0639", + "dateFormat": "d" + } + }, + "az": { + "datepicker": { + "closeText": "Ba\u011fla", + "prevText": "<Geri", + "nextText": "\u0130r\u0259li>", + "currentText": "Bug\u00fcn", + "weekHeader": "Hf", + "dateFormat": "d" + } + }, + "bg": { + "datepicker": { + "closeText": "\u0437\u0430\u0442\u0432\u043e\u0440\u0438", + "prevText": "<\u043d\u0430\u0437\u0430\u0434", + "nextText": "\u043d\u0430\u043f\u0440\u0435\u0434>", + "currentText": "\u0434\u043d\u0435\u0441", + "weekHeader": "Wk", + "dateFormat": "d" + } + }, + "bs": { + "datepicker": { + "closeText": "Zatvori", + "prevText": "<", + "nextText": ">", + "currentText": "Danas", + "weekHeader": "Wk", + "dateFormat": "d" + } + }, + "ca": { + "datepicker": { + "closeText": "Tancar", + "prevText": "<Ant", + "nextText": "Seg>", + "currentText": "Avui", + "weekHeader": "Sm", + "dateFormat": "d" + } + }, + "cs": { + "datepicker": { + "closeText": "Zav\u0159\u00edt", + "prevText": "<D\u0159\u00edve", + "nextText": "Pozd\u011bji>", + "currentText": "Nyn\u00ed", + "weekHeader": "T\u00fdd", + "dateFormat": "d" + } + }, + "da": { + "datepicker": { + "closeText": "Luk", + "prevText": "<Forrige", + "nextText": "N\u00e6ste>", + "currentText": "Idag", + "weekHeader": "Uge", + "dateFormat": "d" + } + }, + "de": { + "datepicker": { + "closeText": "Schlie\u00dfen", + "prevText": "<Zur\u00fcck", + "nextText": "Vor>", + "currentText": "Heute", + "weekHeader": "Wo", + "dateFormat": "d" + } + }, "el": { - "closeText": "\u039a\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf", - "prevText": "\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf\u03c2", - "nextText": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf\u03c2", - "currentText": "\u03a4\u03c1\u03ad\u03c7\u03c9\u03bd \u039c\u03ae\u03bd\u03b1\u03c2", - "weekHeader": "\u0395\u03b2\u03b4", - "dateFormat": "d" + "datepicker": { + "closeText": "\u039a\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf", + "prevText": "\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf\u03c2", + "nextText": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf\u03c2", + "currentText": "\u03a4\u03c1\u03ad\u03c7\u03c9\u03bd \u039c\u03ae\u03bd\u03b1\u03c2", + "weekHeader": "\u0395\u03b2\u03b4", + "dateFormat": "d" + } }, "en-GB": { - "closeText": "Done", - "prevText": "Prev", - "nextText": "Next", - "currentText": "Today", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "Done", + "prevText": "Prev", + "nextText": "Next", + "currentText": "Today", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "eo": { - "closeText": "Fermi", - "prevText": "<Anta", - "nextText": "Sekv>", - "currentText": "Nuna", - "weekHeader": "Sb", - "dateFormat": "dd/MM/yyyy" + "datepicker": { + "closeText": "Fermi", + "prevText": "<Anta", + "nextText": "Sekv>", + "currentText": "Nuna", + "weekHeader": "Sb", + "dateFormat": "dd/MM/yyyy" + } }, "es": { - "closeText": "Cerrar", - "prevText": "<Ant", - "nextText": "Sig>", - "currentText": "Hoy", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Cerrar", + "prevText": "<Ant", + "nextText": "Sig>", + "currentText": "Hoy", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "et": { - "closeText": "Sulge", - "prevText": "Eelnev", - "nextText": "J\u00e4rgnev", - "currentText": "T\u00e4na", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Sulge", + "prevText": "Eelnev", + "nextText": "J\u00e4rgnev", + "currentText": "T\u00e4na", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "eu": { - "closeText": "Egina", - "prevText": "<Aur", - "nextText": "Hur>", - "currentText": "Gaur", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "Egina", + "prevText": "<Aur", + "nextText": "Hur>", + "currentText": "Gaur", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "fa": { - "closeText": "\u0628\u0633\u062a\u0646", - "prevText": "<\u0642\u0628\u0644\u064a", - "nextText": "\u0628\u0639\u062f\u064a>", - "currentText": "\u0627\u0645\u0631\u0648\u0632", - "weekHeader": "\u0647\u0641", - "dateFormat": "d" + "datepicker": { + "closeText": "\u0628\u0633\u062a\u0646", + "prevText": "<\u0642\u0628\u0644\u064a", + "nextText": "\u0628\u0639\u062f\u064a>", + "currentText": "\u0627\u0645\u0631\u0648\u0632", + "weekHeader": "\u0647\u0641", + "dateFormat": "d" + } }, "fi": { - "closeText": "Sulje", - "prevText": "«Edellinen", - "nextText": "Seuraava»", - "currentText": "Tänään", - "weekHeader": "Vk", - "dateFormat": "d" + "datepicker": { + "closeText": "Sulje", + "prevText": "«Edellinen", + "nextText": "Seuraava»", + "currentText": "Tänään", + "weekHeader": "Vk", + "dateFormat": "d" + } }, "fo": { - "closeText": "Lat aftur", - "prevText": "<Fyrra", - "nextText": "N\u00e6sta>", - "currentText": "\u00cd dag", - "weekHeader": "Vk", - "dateFormat": "d" + "datepicker": { + "closeText": "Lat aftur", + "prevText": "<Fyrra", + "nextText": "N\u00e6sta>", + "currentText": "\u00cd dag", + "weekHeader": "Vk", + "dateFormat": "d" + } }, "fr-CH": { - "closeText": "Fermer", - "prevText": "<Pr\u00e9c", - "nextText": "Suiv>", - "currentText": "Courant", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Fermer", + "prevText": "<Pr\u00e9c", + "nextText": "Suiv>", + "currentText": "Courant", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "fr": { - "closeText": "Fermer", - "prevText": "<Pr\u00e9c", - "nextText": "Suiv>", - "currentText": "Courant", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Fermer", + "prevText": "<Pr\u00e9c", + "nextText": "Suiv>", + "currentText": "Courant", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "he": { - "closeText": "\u05e1\u05d2\u05d5\u05e8", - "prevText": "<\u05d4\u05e7\u05d5\u05d3\u05dd", - "nextText": "\u05d4\u05d1\u05d0>", - "currentText": "\u05d4\u05d9\u05d5\u05dd", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "\u05e1\u05d2\u05d5\u05e8", + "prevText": "<\u05d4\u05e7\u05d5\u05d3\u05dd", + "nextText": "\u05d4\u05d1\u05d0>", + "currentText": "\u05d4\u05d9\u05d5\u05dd", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "hr": { - "closeText": "Zatvori", - "prevText": "<", - "nextText": ">", - "currentText": "Danas", - "weekHeader": "Tje", - "dateFormat": "d" + "datepicker": { + "closeText": "Zatvori", + "prevText": "<", + "nextText": ">", + "currentText": "Danas", + "weekHeader": "Tje", + "dateFormat": "d" + } }, "hu": { - "closeText": "bez\u00c3\u00a1r\u00c3\u00a1s", - "prevText": "« vissza", - "nextText": "el\u00c5\u2018re »", - "currentText": "ma", - "weekHeader": "H\u00c3\u00a9", - "dateFormat": "d" + "datepicker": { + "closeText": "bez\u00c3\u00a1r\u00c3\u00a1s", + "prevText": "« vissza", + "nextText": "el\u00c5\u2018re »", + "currentText": "ma", + "weekHeader": "H\u00c3\u00a9", + "dateFormat": "d" + } }, "hy": { - "closeText": "\u00d5\u201c\u00d5\u00a1\u00d5\u00af\u00d5\u00a5\u00d5\u00ac", - "prevText": "<\u00d5\u2020\u00d5\u00a1\u00d5\u00ad.", - "nextText": "\u00d5\u20ac\u00d5\u00a1\u00d5\u00bb.>", - "currentText": "\u00d4\u00b1\u00d5\u00b5\u00d5\u00bd\u00d6\u2026\u00d6\u20ac", - "weekHeader": "\u00d5\u2021\u00d4\u00b2\u00d5\u008f", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00d5\u201c\u00d5\u00a1\u00d5\u00af\u00d5\u00a5\u00d5\u00ac", + "prevText": "<\u00d5\u2020\u00d5\u00a1\u00d5\u00ad.", + "nextText": "\u00d5\u20ac\u00d5\u00a1\u00d5\u00bb.>", + "currentText": "\u00d4\u00b1\u00d5\u00b5\u00d5\u00bd\u00d6\u2026\u00d6\u20ac", + "weekHeader": "\u00d5\u2021\u00d4\u00b2\u00d5\u008f", + "dateFormat": "d" + } }, "id": { - "closeText": "Tutup", - "prevText": "<mundur", - "nextText": "maju>", - "currentText": "hari ini", - "weekHeader": "Mg", - "dateFormat": "d" + "datepicker": { + "closeText": "Tutup", + "prevText": "<mundur", + "nextText": "maju>", + "currentText": "hari ini", + "weekHeader": "Mg", + "dateFormat": "d" + } }, "is": { - "closeText": "Loka", - "prevText": "< Fyrri", - "nextText": "Næsti >", - "currentText": "Í dag", - "weekHeader": "Vika", - "dateFormat": "d" + "datepicker": { + "closeText": "Loka", + "prevText": "< Fyrri", + "nextText": "Næsti >", + "currentText": "Í dag", + "weekHeader": "Vika", + "dateFormat": "d" + } }, "it": { - "closeText": "Chiudi", - "prevText": "<Prec", - "nextText": "Succ>", - "currentText": "Oggi", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Chiudi", + "prevText": "<Prec", + "nextText": "Succ>", + "currentText": "Oggi", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "ja": { - "closeText": "\u9589\u3058\u308b", - "prevText": "<\u524d", - "nextText": "\u6b21>", - "currentText": "\u4eca\u65e5", - "weekHeader": "\u9031", - "dateFormat": "d" + "datepicker": { + "closeText": "\u9589\u3058\u308b", + "prevText": "<\u524d", + "nextText": "\u6b21>", + "currentText": "\u4eca\u65e5", + "weekHeader": "\u9031", + "dateFormat": "d" + } }, "ko": { - "closeText": "\u00eb\u2039\u00ab\u00ea\u00b8\u00b0", - "prevText": "\u00ec\u009d\u00b4\u00ec\u00a0\u201e\u00eb\u2039\u00ac", - "nextText": "\u00eb\u2039\u00a4\u00ec\u009d\u0152\u00eb\u2039\u00ac", - "currentText": "\u00ec\u02dc\u00a4\u00eb\u0160\u02dc", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00eb\u2039\u00ab\u00ea\u00b8\u00b0", + "prevText": "\u00ec\u009d\u00b4\u00ec\u00a0\u201e\u00eb\u2039\u00ac", + "nextText": "\u00eb\u2039\u00a4\u00ec\u009d\u0152\u00eb\u2039\u00ac", + "currentText": "\u00ec\u02dc\u00a4\u00eb\u0160\u02dc", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "lt": { - "closeText": "U\u00c5\u00bedaryti", - "prevText": "<Atgal", - "nextText": "Pirmyn>", - "currentText": "\u00c5\u00a0iandien", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "U\u00c5\u00bedaryti", + "prevText": "<Atgal", + "nextText": "Pirmyn>", + "currentText": "\u00c5\u00a0iandien", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "lv": { - "closeText": "Aizv\u00c4\u201crt", - "prevText": "Iepr", - "nextText": "N\u00c4\u0081ka", - "currentText": "\u00c5\u00a0odien", - "weekHeader": "Nav", - "dateFormat": "d" + "datepicker": { + "closeText": "Aizv\u00c4\u201crt", + "prevText": "Iepr", + "nextText": "N\u00c4\u0081ka", + "currentText": "\u00c5\u00a0odien", + "weekHeader": "Nav", + "dateFormat": "d" + } }, "ms": { - "closeText": "Tutup", - "prevText": "<Sebelum", - "nextText": "Selepas>", - "currentText": "hari ini", - "weekHeader": "Mg", - "dateFormat": "d" + "datepicker": { + "closeText": "Tutup", + "prevText": "<Sebelum", + "nextText": "Selepas>", + "currentText": "hari ini", + "weekHeader": "Mg", + "dateFormat": "d" + } }, "nl": { - "closeText": "Sluiten", - "prevText": "\u2190", - "nextText": "\u2192", - "currentText": "Vandaag", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "Sluiten", + "prevText": "\u2190", + "nextText": "\u2192", + "currentText": "Vandaag", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "no": { - "closeText": "Lukk", - "prevText": "«Forrige", - "nextText": "Neste»", - "currentText": "I dag", - "weekHeader": "Uke", - "dateFormat": "d" + "datepicker": { + "closeText": "Lukk", + "prevText": "«Forrige", + "nextText": "Neste»", + "currentText": "I dag", + "weekHeader": "Uke", + "dateFormat": "d" + } }, "pl": { - "closeText": "Zamknij", - "prevText": "<Poprzedni", - "nextText": "Nast\u00c4\u2122pny>", - "currentText": "Dzi\u00c5\u203a", - "weekHeader": "Tydz", - "dateFormat": "d" + "datepicker": { + "closeText": "Zamknij", + "prevText": "<Poprzedni", + "nextText": "Nast\u00c4\u2122pny>", + "currentText": "Dzi\u00c5\u203a", + "weekHeader": "Tydz", + "dateFormat": "d" + } }, "pt-BR": { - "closeText": "Fechar", - "prevText": "<Anterior", - "nextText": "Próximo>", - "currentText": "Hoje", - "weekHeader": "Sm", - "dateFormat": "d" + "datepicker": { + "closeText": "Fechar", + "prevText": "<Anterior", + "nextText": "Próximo>", + "currentText": "Hoje", + "weekHeader": "Sm", + "dateFormat": "d" + } }, "ro": { - "closeText": "\u00cenchide", - "prevText": "« Luna precedent\u0103", - "nextText": "Luna urm\u0103toare »", - "currentText": "Azi", - "weekHeader": "S\u0103pt", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00cenchide", + "prevText": "« Luna precedent\u0103", + "nextText": "Luna urm\u0103toare »", + "currentText": "Azi", + "weekHeader": "S\u0103pt", + "dateFormat": "d" + } }, "ru": { - "closeText": "\u00d0\u2014\u00d0\u00b0\u00d0\u00ba\u00d1\u20ac\u00d1\u2039\u00d1\u201a\u00d1\u0152", - "prevText": "<\u00d0\u0178\u00d1\u20ac\u00d0\u00b5\u00d0\u00b4", - "nextText": "\u00d0\u00a1\u00d0\u00bb\u00d0\u00b5\u00d0\u00b4>", - "currentText": "\u00d0\u00a1\u00d0\u00b5\u00d0\u00b3\u00d0\u00be\u00d0\u00b4\u00d0\u00bd\u00d1\u008f", - "weekHeader": "\u00d0\u009d\u00d0\u00b5", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00d0\u2014\u00d0\u00b0\u00d0\u00ba\u00d1\u20ac\u00d1\u2039\u00d1\u201a\u00d1\u0152", + "prevText": "<\u00d0\u0178\u00d1\u20ac\u00d0\u00b5\u00d0\u00b4", + "nextText": "\u00d0\u00a1\u00d0\u00bb\u00d0\u00b5\u00d0\u00b4>", + "currentText": "\u00d0\u00a1\u00d0\u00b5\u00d0\u00b3\u00d0\u00be\u00d0\u00b4\u00d0\u00bd\u00d1\u008f", + "weekHeader": "\u00d0\u009d\u00d0\u00b5", + "dateFormat": "d" + } }, "sk": { - "closeText": "Zavrie\u00c5\u00a5", - "prevText": "<Predch\u00c3\u00a1dzaj\u00c3\u00baci", - "nextText": "Nasleduj\u00c3\u00baci>", - "currentText": "Dnes", - "weekHeader": "Ty", - "dateFormat": "d" + "datepicker": { + "closeText": "Zavrie\u00c5\u00a5", + "prevText": "<Predch\u00c3\u00a1dzaj\u00c3\u00baci", + "nextText": "Nasleduj\u00c3\u00baci>", + "currentText": "Dnes", + "weekHeader": "Ty", + "dateFormat": "d" + } }, "sl": { - "closeText": "Zapri", - "prevText": "<Prejšnji", - "nextText": "Naslednji>", - "currentText": "Trenutni", - "weekHeader": "Teden", - "dateFormat": "d" + "datepicker": { + "closeText": "Zapri", + "prevText": "<Prejšnji", + "nextText": "Naslednji>", + "currentText": "Trenutni", + "weekHeader": "Teden", + "dateFormat": "d" + } }, "sq": { - "closeText": "mbylle", - "prevText": "<mbrapa", - "nextText": "P\u00ebrpara>", - "currentText": "sot", - "weekHeader": "Ja", - "dateFormat": "d" + "datepicker": { + "closeText": "mbylle", + "prevText": "<mbrapa", + "nextText": "P\u00ebrpara>", + "currentText": "sot", + "weekHeader": "Ja", + "dateFormat": "d" + } }, "sr-SR": { - "closeText": "Zatvori", - "prevText": "<", - "nextText": ">", - "currentText": "Danas", - "weekHeader": "Sed", - "dateFormat": "dd/MM/yyyy" + "datepicker": { + "closeText": "Zatvori", + "prevText": "<", + "nextText": ">", + "currentText": "Danas", + "weekHeader": "Sed", + "dateFormat": "dd/MM/yyyy" + } }, "sr": { - "closeText": "\u0417\u0430\u0442\u0432\u043e\u0440\u0438", - "prevText": "<", - "nextText": ">", - "currentText": "\u0414\u0430\u043d\u0430\u0441", - "weekHeader": "\u0421\u0435\u0434", - "dateFormat": "d" + "datepicker": { + "closeText": "\u0417\u0430\u0442\u0432\u043e\u0440\u0438", + "prevText": "<", + "nextText": ">", + "currentText": "\u0414\u0430\u043d\u0430\u0441", + "weekHeader": "\u0421\u0435\u0434", + "dateFormat": "d" + } }, "sv": { - "closeText": "St\u00e4ng", - "prevText": "«F\u00f6rra", - "nextText": "N\u00e4sta»", - "currentText": "Idag", - "weekHeader": "Ve", - "dateFormat": "d" + "datepicker": { + "closeText": "St\u00e4ng", + "prevText": "«F\u00f6rra", + "nextText": "N\u00e4sta»", + "currentText": "Idag", + "weekHeader": "Ve", + "dateFormat": "d" + } }, "ta": { - "closeText": "\u0bae\u0bc2\u0b9f\u0bc1", - "prevText": "\u0bae\u0bc1\u0ba9\u0bcd\u0ba9\u0bc8\u0baf\u0ba4\u0bc1", - "nextText": "\u0b85\u0b9f\u0bc1\u0ba4\u0bcd\u0ba4\u0ba4\u0bc1", - "currentText": "\u0b87\u0ba9\u0bcd\u0bb1\u0bc1", - "weekHeader": "\u041d\u0435", - "dateFormat": "d" + "datepicker": { + "closeText": "\u0bae\u0bc2\u0b9f\u0bc1", + "prevText": "\u0bae\u0bc1\u0ba9\u0bcd\u0ba9\u0bc8\u0baf\u0ba4\u0bc1", + "nextText": "\u0b85\u0b9f\u0bc1\u0ba4\u0bcd\u0ba4\u0ba4\u0bc1", + "currentText": "\u0b87\u0ba9\u0bcd\u0bb1\u0bc1", + "weekHeader": "\u041d\u0435", + "dateFormat": "d" + } }, "th": { - "closeText": "\u0e1b\u0e34\u0e14", - "prevText": "« \u0e22\u0e49\u0e2d\u0e19", - "nextText": "\u0e16\u0e31\u0e14\u0e44\u0e1b »", - "currentText": "\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49", - "weekHeader": "Wk", - "dateFormat": "d" + "datepicker": { + "closeText": "\u0e1b\u0e34\u0e14", + "prevText": "« \u0e22\u0e49\u0e2d\u0e19", + "nextText": "\u0e16\u0e31\u0e14\u0e44\u0e1b »", + "currentText": "\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49", + "weekHeader": "Wk", + "dateFormat": "d" + } }, "tr": { - "closeText": "kapat", - "prevText": "<geri", - "nextText": "ileri>", - "currentText": "bug\u00c3\u00bcn", - "weekHeader": "Hf", - "dateFormat": "d" + "datepicker": { + "closeText": "kapat", + "prevText": "<geri", + "nextText": "ileri>", + "currentText": "bug\u00c3\u00bcn", + "weekHeader": "Hf", + "dateFormat": "d" + } }, "uk": { - "closeText": "\u00d0\u2014\u00d0\u00b0\u00d0\u00ba\u00d1\u20ac\u00d0\u00b8\u00d1\u201a\u00d0\u00b8", - "prevText": "<", - "nextText": ">", - "currentText": "\u00d0\u00a1\u00d1\u0152\u00d0\u00be\u00d0\u00b3\u00d0\u00be\u00d0\u00b4\u00d0\u00bd\u00d1\u2013", - "weekHeader": "\u00d0\u009d\u00d0\u00b5", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00d0\u2014\u00d0\u00b0\u00d0\u00ba\u00d1\u20ac\u00d0\u00b8\u00d1\u201a\u00d0\u00b8", + "prevText": "<", + "nextText": ">", + "currentText": "\u00d0\u00a1\u00d1\u0152\u00d0\u00be\u00d0\u00b3\u00d0\u00be\u00d0\u00b4\u00d0\u00bd\u00d1\u2013", + "weekHeader": "\u00d0\u009d\u00d0\u00b5", + "dateFormat": "d" + } }, "vi": { - "closeText": "\u0110\u00f3ng", - "prevText": "<Tr\u01b0\u1edbc", - "nextText": "Ti\u1ebfp>", - "currentText": "H\u00f4m nay", - "weekHeader": "Tu", - "dateFormat": "d" + "datepicker": { + "closeText": "\u0110\u00f3ng", + "prevText": "<Tr\u01b0\u1edbc", + "nextText": "Ti\u1ebfp>", + "currentText": "H\u00f4m nay", + "weekHeader": "Tu", + "dateFormat": "d" + } }, "zh-CN": { - "closeText": "\u00e5\u2026\u00b3\u00e9\u2014\u00ad", - "prevText": "<\u00e4\u00b8\u0160\u00e6\u0153\u02c6", - "nextText": "\u00e4\u00b8\u2039\u00e6\u0153\u02c6>", - "currentText": "\u00e4\u00bb\u0160\u00e5\u00a4\u00a9", - "weekHeader": "\u00e5\u2018\u00a8", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00e5\u2026\u00b3\u00e9\u2014\u00ad", + "prevText": "<\u00e4\u00b8\u0160\u00e6\u0153\u02c6", + "nextText": "\u00e4\u00b8\u2039\u00e6\u0153\u02c6>", + "currentText": "\u00e4\u00bb\u0160\u00e5\u00a4\u00a9", + "weekHeader": "\u00e5\u2018\u00a8", + "dateFormat": "d" + } }, "zh-HK": { - "closeText": "\u00e9\u2014\u0153\u00e9\u2013\u2030", - "prevText": "<\u00e4\u00b8\u0160\u00e6\u0153\u02c6", - "nextText": "\u00e4\u00b8\u2039\u00e6\u0153\u02c6>", - "currentText": "\u00e4\u00bb\u0160\u00e5\u00a4\u00a9", - "weekHeader": "\u00e5\u2018\u00a8", - "dateFormat": "d" + "datepicker": { + "closeText": "\u00e9\u2014\u0153\u00e9\u2013\u2030", + "prevText": "<\u00e4\u00b8\u0160\u00e6\u0153\u02c6", + "nextText": "\u00e4\u00b8\u2039\u00e6\u0153\u02c6>", + "currentText": "\u00e4\u00bb\u0160\u00e5\u00a4\u00a9", + "weekHeader": "\u00e5\u2018\u00a8", + "dateFormat": "d" + } } -}; - -$.each( regions, function( name, value ) { - Globalize.loadTranslations( name, { - datepicker : value - }); }); - -return Globalize; - -} ) ); diff --git a/tests/unit/datepicker/datepicker.html b/tests/unit/datepicker/datepicker.html index 3b20272b1..be4ff7893 100644 --- a/tests/unit/datepicker/datepicker.html +++ b/tests/unit/datepicker/datepicker.html @@ -4,9 +4,41 @@ jQuery UI Datepicker Test Suite - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/calendar.js b/ui/calendar.js index a358f69a0..31de5837f 100644 --- a/ui/calendar.js +++ b/ui/calendar.js @@ -515,7 +515,7 @@ return $.widget( "ui.calendar", { if ( arguments.length ) { this.valueAsDate( Globalize.parseDate( value, this.options.dateFormat ) ); } else { - return Globalize.format( this.option( "value" ), this.options.dateFormat ); + return Globalize.formatDate( this.option( "value" ), this.options.dateFormat ); } }, diff --git a/ui/datepicker.js b/ui/datepicker.js index dc8154e32..6f4dd3c9b 100644 --- a/ui/datepicker.js +++ b/ui/datepicker.js @@ -285,7 +285,7 @@ var widget = $.widget( "ui.datepicker", { if ( arguments.length ) { if ( this.calendarInstance._isValid( value ) ) { this.calendarInstance.valueAsDate( value ); - this.element.val( Globalize.format( value, this.options.dateFormat ) ); + this.element.val( Globalize.formatDate( value, this.options.dateFormat ) ); } } else { return this._getParsedValue(); -- 2.39.5