Comparing version 0.4.3 to 0.4.4
/** | ||
* CLDR JavaScript Library v0.4.3 | ||
* CLDR JavaScript Library v0.4.4 | ||
* http://jquery.com/ | ||
@@ -9,6 +9,6 @@ * | ||
* | ||
* Date: 2015-08-24T01:00Z | ||
* Date: 2016-01-18T12:25Z | ||
*/ | ||
/*! | ||
* CLDR JavaScript Library v0.4.3 2015-08-24T01:00Z MIT license © Rafael Xavier | ||
* CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier | ||
* http://git.io/h4lmVg | ||
@@ -127,3 +127,4 @@ */ | ||
sep = Cldr.localeSep, | ||
territory = subtags[ 2 ]; | ||
territory = subtags[ 2 ], | ||
variantsAndUnicodeLocaleExtensions = subtags.slice( 3, 4 ); | ||
options = options || {}; | ||
@@ -133,3 +134,3 @@ | ||
if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { | ||
return [ language, script, territory ]; | ||
return [ language, script, territory ].concat( variantsAndUnicodeLocaleExtensions ); | ||
} | ||
@@ -161,3 +162,5 @@ | ||
territory !== "ZZ" ? territory : match[ 2 ] | ||
]; | ||
].concat( | ||
variantsAndUnicodeLocaleExtensions | ||
); | ||
} else if ( options.force ) { | ||
@@ -190,3 +193,4 @@ // [3.1.2] | ||
script = maxLanguageId[ 1 ], | ||
territory = maxLanguageId[ 2 ]; | ||
territory = maxLanguageId[ 2 ], | ||
variants = maxLanguageId[ 3 ]; | ||
@@ -206,4 +210,11 @@ // [3] | ||
if ( matchFound ) { | ||
if ( variants ) { | ||
match.push( variants ); | ||
} | ||
return match; | ||
} | ||
// [4] | ||
return matchFound ? match : maxLanguageId; | ||
return maxLanguageId; | ||
}; | ||
@@ -244,10 +255,12 @@ | ||
// Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3. | ||
aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)(-[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3})*$|^(root)$/ ); | ||
aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/ ); | ||
if ( aux === null ) { | ||
return [ "und", "Zzzz", "ZZ" ]; | ||
} | ||
subtags[ 0 /* language */ ] = aux[ 9 ] /* root */ || aux[ 2 ] || "und"; | ||
subtags[ 0 /* language */ ] = aux[ 10 ] /* root */ || aux[ 2 ] || "und"; | ||
subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz"; | ||
subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ"; | ||
subtags[ 3 /* variant */ ] = aux[ 7 ]; | ||
if ( aux[ 7 ] && aux[ 7 ].length ) { | ||
subtags[ 3 /* variant */ ] = aux[ 7 ].slice( 1 ) /* remove leading "-" */; | ||
} | ||
@@ -295,3 +308,3 @@ // 0: language | ||
subtags = coreSubtags( bundle ); | ||
maxBundle = coreLikelySubtags( Cldr, cldr, subtags, { force: true } ) || subtags; | ||
maxBundle = coreLikelySubtags( Cldr, cldr, subtags ); | ||
minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle ); | ||
@@ -444,3 +457,4 @@ minBundle = minBundle.join( Cldr.localeSep ); | ||
for ( bundle in main ) { | ||
if ( main.hasOwnProperty( bundle ) && bundle !== "root" ) { | ||
if ( main.hasOwnProperty( bundle ) && bundle !== "root" && | ||
availableBundleMapQueue.indexOf( bundle ) === -1 ) { | ||
availableBundleMapQueue.push( bundle ); | ||
@@ -447,0 +461,0 @@ } |
/** | ||
* CLDR JavaScript Library v0.4.3 | ||
* CLDR JavaScript Library v0.4.4 | ||
* http://jquery.com/ | ||
@@ -9,6 +9,6 @@ * | ||
* | ||
* Date: 2015-08-24T01:00Z | ||
* Date: 2016-01-18T12:25Z | ||
*/ | ||
/*! | ||
* CLDR JavaScript Library v0.4.3 2015-08-24T01:00Z MIT license © Rafael Xavier | ||
* CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier | ||
* http://git.io/h4lmVg | ||
@@ -46,4 +46,4 @@ */ | ||
EventEmitter = (function () { | ||
/** | ||
@@ -50,0 +50,0 @@ * Class for managing events. |
/** | ||
* CLDR JavaScript Library v0.4.3 | ||
* CLDR JavaScript Library v0.4.4 | ||
* http://jquery.com/ | ||
@@ -9,6 +9,6 @@ * | ||
* | ||
* Date: 2015-08-24T01:00Z | ||
* Date: 2016-01-18T12:25Z | ||
*/ | ||
/*! | ||
* CLDR JavaScript Library v0.4.3 2015-08-24T01:00Z MIT license © Rafael Xavier | ||
* CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier | ||
* http://git.io/h4lmVg | ||
@@ -15,0 +15,0 @@ */ |
/** | ||
* CLDR JavaScript Library v0.4.3 | ||
* CLDR JavaScript Library v0.4.4 | ||
* http://jquery.com/ | ||
@@ -9,6 +9,6 @@ * | ||
* | ||
* Date: 2015-08-24T01:00Z | ||
* Date: 2016-01-18T12:25Z | ||
*/ | ||
/*! | ||
* CLDR JavaScript Library v0.4.3 2015-08-24T01:00Z MIT license © Rafael Xavier | ||
* CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier | ||
* http://git.io/h4lmVg | ||
@@ -15,0 +15,0 @@ */ |
/** | ||
* CLDR JavaScript Library v0.4.3 | ||
* CLDR JavaScript Library v0.4.4 | ||
* http://jquery.com/ | ||
@@ -9,6 +9,6 @@ * | ||
* | ||
* Date: 2015-08-24T01:00Z | ||
* Date: 2016-01-18T12:25Z | ||
*/ | ||
/*! | ||
* CLDR JavaScript Library v0.4.3 2015-08-24T01:00Z MIT license © Rafael Xavier | ||
* CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier | ||
* http://git.io/h4lmVg | ||
@@ -15,0 +15,0 @@ */ |
{ | ||
"name": "cldrjs", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Simple CLDR traverser", | ||
@@ -51,3 +51,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"cldr-data-downloader": "0.1.x", | ||
"cldr-data-downloader": "0.2.x", | ||
"grunt": "0.4.x", | ||
@@ -54,0 +54,0 @@ "grunt-compare-size": "0.4.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157476
76
3298