Prvi commit
This commit is contained in:
9
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/item/get_resolved.js
vendored
Normal file
9
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/item/get_resolved.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
var itemGetResolved = function( Cldr, path, attributes ) {
|
||||
// Resolve path
|
||||
var normalizedPath = pathNormalize( path, attributes );
|
||||
|
||||
return resourceGet( Cldr._resolved, normalizedPath );
|
||||
};
|
||||
|
||||
44
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/item/lookup.js
vendored
Normal file
44
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/item/lookup.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
var itemLookup = (function() {
|
||||
|
||||
var lookup;
|
||||
|
||||
lookup = function( Cldr, locale, path, attributes, childLocale ) {
|
||||
var normalizedPath, parent, value;
|
||||
|
||||
// 1: Finish recursion
|
||||
// 2: Avoid infinite loop
|
||||
if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Resolve path
|
||||
normalizedPath = pathNormalize( path, attributes );
|
||||
|
||||
// Check resolved (cached) data first
|
||||
// 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
|
||||
// represent its leafs in its entirety.
|
||||
value = resourceGet( Cldr._resolved, normalizedPath );
|
||||
if ( value !== undefined && typeof value !== "object" /* 1 */ ) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// Check raw data
|
||||
value = resourceGet( Cldr._raw, normalizedPath );
|
||||
|
||||
if ( value === undefined ) {
|
||||
// Or, lookup at parent locale
|
||||
parent = bundleParentLookup( Cldr, locale );
|
||||
value = lookup( Cldr, parent, path, jsonMerge( attributes, { bundle: parent }), locale );
|
||||
}
|
||||
|
||||
if ( value !== undefined ) {
|
||||
// Set resolved (cached)
|
||||
resourceSet( Cldr._resolved, normalizedPath, value );
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
return lookup;
|
||||
|
||||
}());
|
||||
Reference in New Issue
Block a user