Lines Matching refs:locale
77 // 2. For each element locale of requestedLocales in List order, do
80 JSMutableHandle<EcmaString> locale(thread, JSTaggedValue::Undefined());
82 locale.Update(requestedLocales->Get(thread, i));
83 // 2. a. Let noExtensionsLocale be the String value that is locale
84 // with all Unicode locale extension sequences removed.
85 intl::LocaleHelper::ParsedLocale parsedResult = intl::LocaleHelper::HandleLocale(locale);
89 // 2. c. If availableLocale is not undefined, append locale to the end of subset.
92 // 2. c. i. Set result.[[locale]] to availableLocale.
93 result.locale = availableLocale;
94 // 2. c. ii. If locale and noExtensionsLocale are not the same String value, then
95 // 2. c. ii. 1. Let extension be the String value consisting of the first substring of locale that is a
96 // Unicode locale extension sequence.
101 std::string res = result.locale + result.extension;
108 // 4. Set result.[[locale]] to defLocale.
111 result.locale = defLocale;
112 return factory->NewFromStdString(result.locale);
118 std::string locale = intl::LocaleHelper::StdStringDefaultLocale(thread);
119 icu::Locale defaultLocale = icu::Locale::forLanguageTag(locale, *status);
182 // 1. For each element locale of requestedLocales in List order, do
183 // a. Let noExtensionsLocale be the String value that is locale with all Unicode locale extension sequences
186 // c. If availableLocale is not undefined, append locale to the end of subset.
223 JSMutableHandle<EcmaString> locale(thread, JSTaggedValue::Undefined());
225 locale.Update(requestedLocales->Get(thread, i));
226 if (EcmaStringAccessor::StringsAreEqual(thread->GetEcmaVM(), locale, defaultLocale)) {
227 result->Set(thread, index++, locale.GetTaggedValue());
230 std::string localeStr = intl::LocaleHelper::ConvertToStdString(locale);
234 EcmaStringAccessor::StringsAreEqual(thread->GetEcmaVM(), locale, factory->NewFromStdString(bestFit))) {
235 result->Set(thread, index++, locale.GetTaggedValue());
344 THROW_RANGE_ERROR_AND_RETURN(thread, "Value out of range for locale options property", false);
357 THROW_RANGE_ERROR_AND_RETURN(thread, "Value out of range for locale options property", false);
473 JSMutableHandle<EcmaString> locale(thread, JSTaggedValue::Undefined());
475 locale.Update(intl::LocaleHelper::DefaultLocale(thread).GetTaggedValue());
477 locale.Update(LookupMatcher(thread, availableLocales, requestedLocales).GetTaggedValue());
480 // 4. Let foundLocale be r.[[locale]].
484 std::string foundLocale = intl::LocaleHelper::ConvertToStdString(locale);
489 result.locale = intl::LocaleHelper::ConvertToStdString(tag);
602 result.locale = foundLocale;
608 // 10. Set result.[[locale]] to foundLocale.
609 result.locale = foundLocale;
632 for (const std::string &locale : icuAvailableLocales) {
633 JSHandle<EcmaString> localeStr = factory->NewFromStdString(locale);
838 icu::Locale locale = builder->build(status);
839 locale.canonicalize(status);
843 builder->setLocale(locale);
949 JSHandle<JSLocale> JSLocale::InitializeLocale(JSThread *thread, const JSHandle<JSLocale> &locale,
956 THROW_RANGE_ERROR_AND_RETURN(thread, "apply option to tag failed", locale);
961 THROW_RANGE_ERROR_AND_RETURN(thread, "apply option to tag failed", locale);
964 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, locale);
970 THROW_RANGE_ERROR_AND_RETURN(thread, "insert or build failed", locale);
973 factory->NewJSIntlIcuData(locale, icuLocale, JSLocale::FreeIcuLocale);
974 return locale;
993 JSTaggedValue JSLocale::NormalizeKeywordValue(JSThread *thread, const JSHandle<JSLocale> &locale,
996 icu::Locale *icuLocale = locale->GetIcuLocale();
1013 JSHandle<EcmaString> JSLocale::ToString(JSThread *thread, const JSHandle<JSLocale> &locale)
1015 icu::Locale *icuLocale = locale->GetIcuLocale();