Index: src/extensions/i18n/i18n-utils.js |
diff --git a/src/extensions/i18n/i18n-utils.js b/src/extensions/i18n/i18n-utils.js |
index 545082ecbba4d6ba9755c9639234a28ba4889cf5..d7e9486c507681c73973fb25e9bb7a39198cfc21 100644 |
--- a/src/extensions/i18n/i18n-utils.js |
+++ b/src/extensions/i18n/i18n-utils.js |
@@ -255,6 +255,8 @@ function resolveLocale(service, requestedLocales, options) { |
* lookup algorithm. |
*/ |
function lookupMatcher(service, requestedLocales) { |
+ native function NativeJSGetDefaultICULocale(); |
+ |
if (service.match(SERVICE_RE) === null) { |
throw new Error('Internal error, wrong service type: ' + service); |
} |
@@ -285,7 +287,7 @@ function lookupMatcher(service, requestedLocales) { |
// Didn't find a match, return default. |
if (DEFAULT_ICU_LOCALE === undefined) { |
- DEFAULT_ICU_LOCALE = %GetDefaultICULocale(); |
+ DEFAULT_ICU_LOCALE = NativeJSGetDefaultICULocale(); |
} |
return {'locale': DEFAULT_ICU_LOCALE, 'extension': '', 'position': -1}; |
@@ -444,12 +446,14 @@ function getOptimalLanguageTag(original, resolved) { |
// Returns Array<Object>, where each object has maximized and base properties. |
// Maximized: zh -> zh-Hans-CN |
// Base: zh-CN-u-ca-gregory -> zh-CN |
+ native function NativeJSGetLanguageTagVariants(); |
+ |
// Take care of grandfathered or simple cases. |
if (original === resolved) { |
return original; |
} |
- var locales = %GetLanguageTagVariants([original, resolved]); |
+ var locales = NativeJSGetLanguageTagVariants([original, resolved]); |
if (locales[0].maximized !== locales[1].maximized) { |
return resolved; |
} |
@@ -467,7 +471,8 @@ function getOptimalLanguageTag(original, resolved) { |
* that is supported. This is required by the spec. |
*/ |
function getAvailableLocalesOf(service) { |
- var available = %AvailableLocalesOf(service); |
+ native function NativeJSAvailableLocalesOf(); |
+ var available = NativeJSAvailableLocalesOf(service); |
for (var i in available) { |
if (available.hasOwnProperty(i)) { |