Lines Matching refs:locale

173 // 6.2.3 CanonicalizeUnicodeLocaleId( locale )
174 JSHandle<EcmaString> LocaleHelper::CanonicalizeUnicodeLocaleId(JSThread *thread, const JSHandle<EcmaString> &locale)
177 if (!IsStructurallyValidLanguageTag(locale)) {
178 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString());
181 if (EcmaStringAccessor(locale).GetLength() == 0 || EcmaStringAccessor(locale).IsUtf16()) {
182 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString());
185 std::string localeCStr = ConvertToStdString(locale);
195 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString());
198 // Resets the LocaleBuilder to match the locale.
201 // Canonicalize the locale ID of this object according to CLDR.
204 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString());
211 std::string LocaleHelper::ToStdStringLanguageTag(JSThread *thread, const icu::Locale &locale)
214 auto result = locale.toLanguageTag<std::string>(status);
216 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", "");
259 JSHandle<EcmaString> LocaleHelper::ToLanguageTag(JSThread *thread, const icu::Locale &locale)
262 return factory->NewFromStdString(ToStdStringLanguageTag(thread, locale));
265 // 6.2.2 IsStructurallyValidLanguageTag( locale )
309 // The abstract operation returns true if locale can be generated from the ABNF grammar in section 2.1 of the RFC,
460 icu::Locale locale(locStr.c_str());
462 if (!CheckLocales(locale, localeKey, localePath, res)) {
481 // 9.2.2 BestAvailableLocale ( availableLocales, locale )
483 const std::string &locale)
485 // 1. Let candidate be locale.
486 std::string localeCandidate = locale;