prvi
This commit is contained in:
38
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/lookup.js
vendored
Normal file
38
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/lookup.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
/**
|
||||
* bundleLookup( minLanguageId )
|
||||
*
|
||||
* @Cldr [Cldr class]
|
||||
*
|
||||
* @cldr [Cldr instance]
|
||||
*
|
||||
* @minLanguageId [String] requested languageId after applied remove likely subtags.
|
||||
*/
|
||||
var bundleLookup = function( Cldr, cldr, minLanguageId ) {
|
||||
var availableBundleMap = Cldr._availableBundleMap,
|
||||
availableBundleMapQueue = Cldr._availableBundleMapQueue;
|
||||
|
||||
if ( availableBundleMapQueue.length ) {
|
||||
arrayForEach( availableBundleMapQueue, function( bundle, i ) {
|
||||
var existing, maxBundle, minBundle, subtags;
|
||||
subtags = coreSubtags( bundle );
|
||||
maxBundle = coreLikelySubtags( Cldr, cldr, subtags );
|
||||
if ( maxBundle === undefined ) {
|
||||
availableBundleMapQueue.splice( i, 1 );
|
||||
throw new Error( "Could not find likelySubtags for " + bundle );
|
||||
}
|
||||
minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle );
|
||||
minBundle = minBundle.join( Cldr.localeSep );
|
||||
existing = availableBundleMap[ minBundle ];
|
||||
if ( existing && existing.length < bundle.length ) {
|
||||
return;
|
||||
}
|
||||
availableBundleMap[ minBundle ] = bundle;
|
||||
});
|
||||
Cldr._availableBundleMapQueue = [];
|
||||
}
|
||||
|
||||
return availableBundleMap[ minLanguageId ] || null;
|
||||
};
|
||||
|
||||
76
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/lookup.js.orig
vendored
Normal file
76
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/lookup.js.orig
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<<<<<<< HEAD
|
||||
define([
|
||||
"../core/likely_subtags",
|
||||
"../core/remove_likely_subtags",
|
||||
"../core/subtags",
|
||||
], function( coreLikelySubtags, coreRemoveLikelySubtags, coreSubtags ) {
|
||||
=======
|
||||
import coreLikelySubtags from "../core/likely_subtags";
|
||||
import coreRemoveLikelySubtags from "../core/remove_likely_subtags";
|
||||
import coreSubtags from "../core/subtags";
|
||||
import arrayForEach from "../util/array/for_each";
|
||||
>>>>>>> a11141a... Bundle: Enhcance bundleMapQueue logic (amend)
|
||||
|
||||
/**
|
||||
* bundleLookup( minLanguageId )
|
||||
*
|
||||
* @Cldr [Cldr class]
|
||||
*
|
||||
* @cldr [Cldr instance]
|
||||
*
|
||||
* @minLanguageId [String] requested languageId after applied remove likely subtags.
|
||||
*/
|
||||
return function( Cldr, cldr, minLanguageId ) {
|
||||
var availableBundleMap = Cldr._availableBundleMap,
|
||||
availableBundleMapQueue = Cldr._availableBundleMapQueue;
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (availableBundleMapQueue.length) {
|
||||
while (availableBundleMapQueue.length > 0) {
|
||||
const bundle = availableBundleMapQueue.shift();
|
||||
if (!bundle) {
|
||||
break;
|
||||
}
|
||||
|
||||
var existing, maxBundle, minBundle, subtags;
|
||||
subtags = coreSubtags(bundle);
|
||||
maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
|
||||
if (typeof maxBundle === "undefined") {
|
||||
throw new Error(`Could not find likelySubtags for ${bundle}`);
|
||||
}
|
||||
|
||||
minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
|
||||
minBundle = minBundle.join(Cldr.localeSep);
|
||||
existing = availableBundleMap[minBundle];
|
||||
if (existing && existing.length < bundle.length) {
|
||||
return;
|
||||
}
|
||||
availableBundleMap[minBundle] = bundle;
|
||||
}
|
||||
}
|
||||
=======
|
||||
if (availableBundleMapQueue.length) {
|
||||
arrayForEach(availableBundleMapQueue, function(bundle, i) {
|
||||
var existing, maxBundle, minBundle, subtags;
|
||||
subtags = coreSubtags(bundle);
|
||||
maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
|
||||
if (maxBundle === undefined) {
|
||||
availableBundleMapQueue.splice(i, 1);
|
||||
throw new Error(`Could not find likelySubtags for ${bundle}`);
|
||||
}
|
||||
minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
|
||||
minBundle = minBundle.join(Cldr.localeSep);
|
||||
existing = availableBundleMap[minBundle];
|
||||
if (existing && existing.length < bundle.length) {
|
||||
return;
|
||||
}
|
||||
availableBundleMap[minBundle] = bundle;
|
||||
});
|
||||
Cldr._availableBundleMapQueue = [];
|
||||
}
|
||||
>>>>>>> a11141a... Bundle: Enhcance bundleMapQueue logic (amend)
|
||||
|
||||
return availableBundleMap[ minLanguageId ] || null;
|
||||
};
|
||||
|
||||
});
|
||||
25
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/parent_lookup.js
vendored
Normal file
25
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/bundle/parent_lookup.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
var bundleParentLookup = function( Cldr, locale ) {
|
||||
var normalizedPath, parent;
|
||||
|
||||
if ( locale === "root" ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// First, try to find parent on supplemental data.
|
||||
normalizedPath = pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] );
|
||||
parent = resourceGet( Cldr._resolved, normalizedPath ) || resourceGet( Cldr._raw, normalizedPath );
|
||||
if ( parent ) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
// Or truncate locale.
|
||||
parent = locale.substr( 0, locale.lastIndexOf( Cldr.localeSep ) );
|
||||
if ( !parent ) {
|
||||
return "root";
|
||||
}
|
||||
|
||||
return parent;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user