Home
last modified time | relevance | path

Searched refs:locale (Results 1 - 25 of 47) sorted by relevance

12

/arkcompiler/ets_runtime/ecmascript/builtins/
H A Dbuiltins_locale.cpp38 // 6. Let locale be ? OrdinaryCreateFromConstructor(NewTarget, %LocalePrototype%, internalSlotsList). in LocaleConstructor()
42 JSHandle<JSLocale> locale =JSHandle<JSLocale>::Cast(newObject); in LocaleConstructor() local
76 JSHandle<JSLocale> result = JSLocale::InitializeLocale(thread, locale, localeString, optionsObj); in LocaleConstructor()
91 THROW_TYPE_ERROR_AND_RETURN(thread, "not locale", JSTaggedValue::Exception()); in Maximize()
95 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in Maximize() local
96 icu::Locale source(*(locale->GetIcuLocale())); in Maximize()
123 THROW_TYPE_ERROR_AND_RETURN(thread, "not locale", JSTaggedValue::Exception()); in Minimize()
128 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in Minimize() local
129 icu::Locale source(*(locale->GetIcuLocale())); in Minimize()
157 THROW_TYPE_ERROR_AND_RETURN(thread, "not locale", JSTaggedValu in ToString()
177 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetBaseName() local
196 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetCalendar() local
214 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetCaseFirst() local
231 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetCollation() local
248 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetHourCycle() local
266 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetNumeric() local
286 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetNumberingSystem() local
304 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetLanguage() local
330 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetScript() local
361 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); GetRegion() local
[all...]
/arkcompiler/ets_runtime/ecmascript/builtins/tests/
H A Dbuiltins_list_format_first_test.cpp69 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-GB")); in HWTEST_F_L0()
72 JSHandle<JSListFormat>(thread, BuiltTestUtil::JSListFormatCreateWithOptionTest(thread, locale, typeValue)); in HWTEST_F_L0()
90 JSHandle<EcmaString> CommonTest(JSThread* thread, JSHandle<JSTaggedValue>& locale, JSHandle<JSTaggedValue>& typeValue, in CommonTest() argument
95 JSHandle<JSListFormat>(thread, BuiltTestUtil::JSListFormatCreateWithOptionTest(thread, locale, typeValue)); in CommonTest()
116 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-GB")); in HWTEST_F_L0()
119 JSHandle<EcmaString> handleEcmaStr = CommonTest(thread, locale, typeValue, listVal); in HWTEST_F_L0()
127 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-GB")); in HWTEST_F_L0()
130 JSHandle<EcmaString> handleEcmaStr = CommonTest(thread, locale, typeValue, listVal); in HWTEST_F_L0()
138 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh-cn")); in HWTEST_F_L0()
142 JSHandle<EcmaString> handleEcmaStr = CommonTest(thread, locale, typeValu in HWTEST_F_L0()
[all...]
H A Dbuiltins_segmenter_test.cpp30 static JSTaggedValue JSSegmenterCreateWithLocaleTest(JSThread *thread, JSHandle<JSTaggedValue> &locale) in JSSegmenterCreateWithLocaleTest() argument
39 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in JSSegmenterCreateWithLocaleTest()
48 static JSTaggedValue JSSegmenterCreateWithLocaleAndOptionsTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSSegmenterCreateWithLocaleAndOptionsTest() argument
64 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in JSSegmenterCreateWithLocaleAndOptionsTest()
74 static JSTaggedValue JSSegmentsCreateTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSSegmentsCreateTest() argument
78 JSHandle<JSSegmenter>(thread, JSSegmenterCreateWithLocaleAndOptionsTest(thread, locale, granularity)); in JSSegmentsCreateTest()
117 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh-cn")); in HWTEST_F_L0()
121 JSHandle<JSSegmenter>(thread, JSSegmenterCreateWithLocaleAndOptionsTest(thread, locale, granularity)); in HWTEST_F_L0()
145 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("id-u-co-pinyin-de-ID")); in HWTEST_F_L0()
151 ecmaRuntimeCallInfo->SetCallArg(0, locale in HWTEST_F_L0()
[all...]
H A Dbuiltins_list_format_second_test.cpp31 JSTaggedValue CommonTest(JSThread* thread, JSHandle<JSTaggedValue>& locale, JSHandle<JSTaggedValue>& typeValue, in CommonTest() argument
36 JSHandle<JSListFormat>(thread, BuiltTestUtil::JSListFormatCreateWithOptionTest(thread, locale, typeValue)); in CommonTest()
62 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("de-DE")); in HWTEST_F_L0()
65 JSHandle<JSListFormat>(thread, BuiltTestUtil::JSListFormatCreateWithOptionTest(thread, locale, typeValue)); in HWTEST_F_L0()
84 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-GB")); in HWTEST_F_L0()
88 JSTaggedValue result = CommonTest(thread, locale, typeValue, vals); in HWTEST_F_L0()
99 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-GB")); in HWTEST_F_L0()
103 JSTaggedValue result = CommonTest(thread, locale, typeValue, vals); in HWTEST_F_L0()
116 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh-cn")); in HWTEST_F_L0()
120 JSTaggedValue result = CommonTest(thread, locale, typeValu in HWTEST_F_L0()
[all...]
H A Dbuiltins_relative_time_format_test.cpp51 static JSTaggedValue JSRelativeTimeFormatCreateWithLocaleTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSRelativeTimeFormatCreateWithLocaleTest() argument
63 JSHandle<JSTaggedValue> localesString = locale; in JSRelativeTimeFormatCreateWithLocaleTest()
97 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
101 thread, locale, numericValue)); in HWTEST_F_L0()
114 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
118 thread, locale, numericValue)); in HWTEST_F_L0()
131 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
135 thread, locale, numericValue)); in HWTEST_F_L0()
149 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
153 thread, locale, numericValu in HWTEST_F_L0()
[all...]
H A Dbuiltins_date_time_format_first_test.cpp35 // new DateTimeFormat(locale)
105 JSHandle<JSTaggedValue> locale(factory->NewFromASCII(localeStr)); in FormatCommon()
107 JSHandle<JSDateTimeFormat>(thread, BuiltTestUtil::JSDateTimeFormatCreateWithLocaleTest(thread, locale)); in FormatCommon()
149 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-US")); in HWTEST_F_L0()
151 JSHandle<JSDateTimeFormat>(thread, BuiltTestUtil::JSDateTimeFormatCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
165 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh")); in HWTEST_F_L0()
167 JSHandle<JSDateTimeFormat>(thread, BuiltTestUtil::JSDateTimeFormatCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
186 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-US")); in HWTEST_F_L0()
188 JSHandle<JSDateTimeFormat>(thread, BuiltTestUtil::JSDateTimeFormatCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
206 JSHandle<JSTaggedValue> locale(factor in HWTEST_F_L0()
[all...]
H A Dbuiltins_displaynames_test.cpp28 static JSTaggedValue JSDisplayNamesCreateWithOptionTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSDisplayNamesCreateWithOptionTest() argument
40 JSHandle<JSTaggedValue> localesString = locale; in JSDisplayNamesCreateWithOptionTest()
87 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
90 JSHandle<JSDisplayNames>(thread, JSDisplayNamesCreateWithOptionTest(thread, locale, typeValue)); in HWTEST_F_L0()
111 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
114 JSHandle<JSDisplayNames>(thread, JSDisplayNamesCreateWithOptionTest(thread, locale, typeValue)); in HWTEST_F_L0()
135 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en")); in HWTEST_F_L0()
138 JSHandle<JSDisplayNames>(thread, JSDisplayNamesCreateWithOptionTest(thread, locale, typeValue)); in HWTEST_F_L0()
176 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("id-u-co-pinyin-de-ID")); in HWTEST_F_L0()
181 ecmaRuntimeCallInfo->SetCallArg(0, locale in HWTEST_F_L0()
[all...]
H A Dbuiltins_collator_test.cpp129 static JSTaggedValue JSCollatorCreateWithLocaleTest(JSThread *thread, JSHandle<JSTaggedValue> &locale) in JSCollatorCreateWithLocaleTest() argument
134 JSHandle<JSTaggedValue> localesString = locale; in JSCollatorCreateWithLocaleTest()
142 static JSTaggedValue JSCollatorCreateWithLocaleAndOptionsTest(JSThread *thread, JSHandle<JSTaggedValue> &locale) in JSCollatorCreateWithLocaleAndOptionsTest() argument
149 JSHandle<JSTaggedValue> localesString = locale; in JSCollatorCreateWithLocaleAndOptionsTest()
170 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("de")); in HWTEST_F_L0()
171 JSHandle<JSCollator> jsCollator = JSHandle<JSCollator>(thread, JSCollatorCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
208 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("sv")); in HWTEST_F_L0()
209 JSHandle<JSCollator> jsCollator = JSHandle<JSCollator>(thread, JSCollatorCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
248 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("sv")); in HWTEST_F_L0()
250 JSHandle<JSCollator>(thread, JSCollatorCreateWithLocaleAndOptionsTest(thread, locale)); in HWTEST_F_L0()
[all...]
H A Dbuiltins_plural_rules_test.cpp51 static JSTaggedValue JSPluralRulesCreateWithLocaleTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSPluralRulesCreateWithLocaleTest() argument
63 JSHandle<JSTaggedValue> localesString = locale; in JSPluralRulesCreateWithLocaleTest()
78 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-US")); in SelectTest()
81 JSHandle<JSPluralRules>(thread, JSPluralRulesCreateWithLocaleTest(thread, locale, typeValue)); in SelectTest()
144 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("id-u-co-pinyin-de-ID")); in HWTEST_F_L0()
149 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in HWTEST_F_L0()
168 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("en-US")); in HWTEST_F_L0()
171 JSHandle<JSPluralRules>(thread, JSPluralRulesCreateWithLocaleTest(thread, locale, typeValue)); in HWTEST_F_L0()
H A Dbuiltins_date_time_format_second_test.cpp39 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("de-ID")); in HWTEST_F_L0()
41 JSHandle<JSDateTimeFormat>(thread, BuiltTestUtil::JSDateTimeFormatCreateWithLocaleTest(thread, locale)); in HWTEST_F_L0()
68 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("id-u-co-pinyin-de-ID")); in HWTEST_F_L0()
73 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in HWTEST_F_L0()
97 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("id-u-co-pinyin-de-DE")); in HWTEST_F_L0()
106 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in HWTEST_F_L0()
H A Dbuiltin_test_util.h186 static JSTaggedValue JSDateTimeFormatCreateWithLocaleTest(JSThread *thread, JSHandle<JSTaggedValue> &locale) in JSDateTimeFormatCreateWithLocaleTest() argument
192 JSHandle<JSTaggedValue> localesString = locale; in JSDateTimeFormatCreateWithLocaleTest()
206 static JSTaggedValue JSListFormatCreateWithOptionTest(JSThread *thread, JSHandle<JSTaggedValue> &locale, in JSListFormatCreateWithOptionTest() argument
221 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in JSListFormatCreateWithOptionTest()
H A Dbuiltins_number_format_test.cpp53 JSHandle<JSTaggedValue> &number, JSHandle<JSTaggedValue> &locale) in BuiltinsFormatTest()
61 ecmaRuntimeCallInfo1->SetCallArg(0, locale.GetTaggedValue()); in BuiltinsFormatTest()
212 JSHandle<JSTaggedValue> &locale) in NumberFormatCreateTest()
220 ecmaRuntimeCallInfo->SetCallArg(0, locale.GetTaggedValue()); in NumberFormatCreateTest()
52 BuiltinsFormatTest(JSThread *thread, JSHandle<JSObject> &options, JSHandle<JSTaggedValue> &number, JSHandle<JSTaggedValue> &locale) BuiltinsFormatTest() argument
211 NumberFormatCreateTest(JSThread *thread, JSHandle<JSObject> &options, JSHandle<JSTaggedValue> &locale) NumberFormatCreateTest() argument
/arkcompiler/ets_runtime/ecmascript/intl/
H A Dlocale_helper.h40 // 6.2.3 CanonicalizeUnicodeLocaleId ( locale )
41 static JSHandle<EcmaString> CanonicalizeUnicodeLocaleId(JSThread *thread, const JSHandle<EcmaString> &locale);
42 static std::string ToStdStringLanguageTag(JSThread *thread, const icu::Locale &locale);
43 static JSHandle<EcmaString> ToLanguageTag(JSThread *thread, const icu::Locale &locale);
46 // 9.2.2 BestAvailableLocale ( availableLocales, locale )
48 const std::string &locale);
158 static bool ValidateOtherTags(const icu::Locale &locale, const char *packageName, const char *key, bool &res) in ValidateOtherTags() argument
160 const char *localeCountry = locale.getCountry(); in ValidateOtherTags()
161 const char *localeScript = locale.getScript(); in ValidateOtherTags()
163 std::string removeCountry = locale in ValidateOtherTags()
175 CheckLocales(const icu::Locale &locale, const char *key, const char *packageName, bool &res) CheckLocales() argument
[all...]
H A Dlocale_helper.cpp173 // 6.2.3 CanonicalizeUnicodeLocaleId( locale )
174 JSHandle<EcmaString> LocaleHelper::CanonicalizeUnicodeLocaleId(JSThread *thread, const JSHandle<EcmaString> &locale) in CanonicalizeUnicodeLocaleId() argument
177 if (!IsStructurallyValidLanguageTag(locale)) { in CanonicalizeUnicodeLocaleId()
178 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString()); in CanonicalizeUnicodeLocaleId()
181 if (EcmaStringAccessor(locale).GetLength() == 0 || EcmaStringAccessor(locale).IsUtf16()) { in CanonicalizeUnicodeLocaleId()
182 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString()); in CanonicalizeUnicodeLocaleId()
185 std::string localeCStr = ConvertToStdString(locale); in CanonicalizeUnicodeLocaleId()
195 THROW_RANGE_ERROR_AND_RETURN(thread, "invalid locale", factory->GetEmptyString()); in CanonicalizeUnicodeLocaleId()
198 // Resets the LocaleBuilder to match the locale in CanonicalizeUnicodeLocaleId()
211 ToStdStringLanguageTag(JSThread *thread, const icu::Locale &locale) ToStdStringLanguageTag() argument
259 ToLanguageTag(JSThread *thread, const icu::Locale &locale) ToLanguageTag() argument
482 BestAvailableLocale(const std::vector<std::string> &availableLocales, const std::string &locale) BestAvailableLocale() argument
[all...]
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/native/core/
H A DIntlNumberFormat.cpp41 const icu::number::LocalizedNumberFormatter &FormattersCacheInvalidation(EtsEnv *env, ets_string locale) in FormattersCacheInvalidation() argument
45 const char *localeCharString = env->GetStringUTFChars(locale, nullptr); in FormattersCacheInvalidation()
47 env->ReleaseStringUTFChars(locale, localeCharString); in FormattersCacheInvalidation()
71 ets_string IcuFormatDouble(EtsEnv *env, [[maybe_unused]] ets_class klass, ets_string locale, ets_double value) in IcuFormatDouble() argument
73 const icu::number::LocalizedNumberFormatter &formatter = FormattersCacheInvalidation(env, locale); in IcuFormatDouble()
85 ets_string IcuFormatDecimal(EtsEnv *env, [[maybe_unused]] ets_class klass, ets_string locale, ets_string value) in IcuFormatDecimal() argument
91 const icu::number::LocalizedNumberFormatter &formatter = FormattersCacheInvalidation(env, locale); in IcuFormatDecimal()
/arkcompiler/ets_runtime/ecmascript/
H A Djs_locale.cpp77 // 2. For each element locale of requestedLocales in List order, do in LookupMatcher()
80 JSMutableHandle<EcmaString> locale(thread, JSTaggedValue::Undefined()); in LookupMatcher()
82 locale.Update(requestedLocales->Get(thread, i)); in LookupMatcher()
83 // 2. a. Let noExtensionsLocale be the String value that is locale in LookupMatcher()
84 // with all Unicode locale extension sequences removed. in LookupMatcher()
85 intl::LocaleHelper::ParsedLocale parsedResult = intl::LocaleHelper::HandleLocale(locale); in LookupMatcher()
89 // 2. c. If availableLocale is not undefined, append locale to the end of subset. in LookupMatcher()
92 // 2. c. i. Set result.[[locale]] to availableLocale. in LookupMatcher()
93 result.locale = availableLocale; in LookupMatcher()
94 // 2. c. ii. If locale an in LookupMatcher()
118 std::string locale = intl::LocaleHelper::StdStringDefaultLocale(thread); BuildLocaleMatcher() local
838 icu::Locale locale = builder->build(status); BuildOptionsTags() local
949 InitializeLocale(JSThread *thread, const JSHandle<JSLocale> &locale, const JSHandle<EcmaString> &localeString, const JSHandle<JSObject> &options) InitializeLocale() argument
993 NormalizeKeywordValue(JSThread *thread, const JSHandle<JSLocale> &locale, const std::string &key) NormalizeKeywordValue() argument
1013 ToString(JSThread *thread, const JSHandle<JSLocale> &locale) ToString() argument
[all...]
H A Djs_locale.h127 std::string locale {};
133 std::string locale;
348 static bool IsWellCollation(const icu::Locale &locale, const std::string &value) in IsWellCollation() argument
353 return IsWellExtension<icu::Collator>(locale, "collation", value); in IsWellCollation()
356 static bool IsWellCalendar(const icu::Locale &locale, const std::string &value) in IsWellCalendar() argument
358 return IsWellExtension<icu::Calendar>(locale, "calendar", value); in IsWellCalendar()
362 static bool IsWellExtension(const icu::Locale &locale, const char *key, const std::string &value) in IsWellExtension() argument
369 icu::StringEnumeration *sequence = T::getKeywordValuesForLocale(key, icu::Locale(locale.getBaseName()), in IsWellExtension()
443 static bool ValidateOtherTags(const icu::Locale &locale, const char *packageName, const char *key, bool &res) in ValidateOtherTags() argument
445 const char *localeCountry = locale in ValidateOtherTags()
461 CheckLocales(const icu::Locale &locale, const char *key, const char *packageName, bool &res) CheckLocales() argument
[all...]
H A Decma_context.h331 void SetDefaultLocale(const std::string& locale) in SetDefaultLocale() argument
333 defaultLocale_ = locale; in SetDefaultLocale()
377 void SetIcuFormatterToCache(IcuFormatterType type, const std::string &locale, void *icuObj, in SetIcuFormatterToCache() argument
380 EcmaContext::IcuFormatter icuFormatter = IcuFormatter(locale, icuObj, deleteEntry); in SetIcuFormatterToCache()
384 ARK_INLINE void *GetIcuFormatterFromCache(IcuFormatterType type, std::string &locale) in GetIcuFormatterFromCache() argument
387 if (icuFormatter.locale == locale) { in GetIcuFormatterFromCache()
732 std::string locale; member
737 IcuFormatter(const std::string &locale, void *icuObj, NativePointerCallback deleteEntry = nullptr) in IcuFormatter()
738 : locale(local in IcuFormatter()
[all...]
H A Djs_plural_rules.cpp108 for (const std::string &locale : icuAvailableLocales) { in BuildLocaleSet()
109 JSHandle<EcmaString> localeStr = factory->NewFromStdString(locale); in BuildLocaleSet()
118 const char *locale = nullptr; in GetNextLocale() local
119 locale = locales->next(len, status); in GetNextLocale()
120 if (!U_SUCCESS(status) || locale == nullptr) { in GetNextLocale()
124 localeStr = std::string(locale); in GetNextLocale()
202 // Get ICU numberFormatter with given locale in InitializePluralRules()
259 // 12. Set pluralRules.[[Locale]] to the value of r.[[locale]]. in InitializePluralRules()
312 JSHandle<EcmaString> locale(thread, pluralRules->GetLocale()); in ResolvedOptions()
313 PropertyDescriptor localeDesc(thread, JSHandle<JSTaggedValue>::Cast(locale), tru in ResolvedOptions()
[all...]
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/
H A Dstd_core_String.cpp282 EtsString *ToLowerCase(EtsString *thisStr, const icu::Locale &locale) in ToLowerCase() argument
294 auto res = utf16Str.toLower(locale); in ToLowerCase()
298 EtsString *ToUpperCase(EtsString *thisStr, const icu::Locale &locale) in ToUpperCase() argument
310 auto res = utf16Str.toUpper(locale); in ToUpperCase()
314 UErrorCode ParseSingleBCP47LanguageTag(EtsString *langTag, icu::Locale &locale) in ParseSingleBCP47LanguageTag() argument
317 locale = icu::Locale::getDefault(); in ParseSingleBCP47LanguageTag()
325 locale = icu::Locale::forLanguageTag(sp, status); in ParseSingleBCP47LanguageTag()
343 icu::Locale locale; in StdCoreStringToLocaleUpperCase() local
344 auto localeParseStatus = ParseSingleBCP47LanguageTag(langTag, locale); in StdCoreStringToLocaleUpperCase()
350 return ToUpperCase(thisStr, locale); in StdCoreStringToLocaleUpperCase()
357 icu::Locale locale; StdCoreStringToLocaleLowerCase() local
371 icu::Locale locale; StdCoreStringLocaleCmp() local
[all...]
H A Descompat_Date.cpp62 extern "C" EtsString *EscompatDateGetLocaleString(EtsString *format, EtsString *locale, int64_t ms, uint8_t isUtc) in EscompatDateGetLocaleString() argument
66 auto localeS = std::string(locale->ConvertToStringView(&buf)); in EscompatDateGetLocaleString()
69 ss.imbue(std::locale(ss.getloc(), new std::time_put_byname<char>(localeS.c_str()))); in EscompatDateGetLocaleString()
H A Dstd_core_Double.cpp62 EtsString *StdCoreDoubleToLocaleString(ObjectHeader *obj, EtsString *locale) in StdCoreDoubleToLocaleString() argument
64 ASSERT(obj != nullptr && locale != nullptr); in StdCoreDoubleToLocaleString()
68 std::string_view locTag = locale->ConvertToStringView(&buf); in StdCoreDoubleToLocaleString()
87 std::string message = "Unable to convert " + std::to_string(objValue) + " to locale " + std::string(locTag); in StdCoreDoubleToLocaleString()
/arkcompiler/ets_runtime/ecmascript/tests/
H A Djs_locale_test.cpp90 * @tc.desc: Call "NewJSIntlIcuData" function Set locale IcuField,check whether the locale IcuField through
100 JSHandle<JSLocale> locale = in HWTEST_F_L0() local
104 factory->NewJSIntlIcuData(locale, icuLocale, JSLocale::FreeIcuLocale); in HWTEST_F_L0()
107 icu::Locale *result = locale->GetIcuLocale(); in HWTEST_F_L0()
318 * @tc.desc: Call "CheckLocales" function check wether language is correct from locale libraries obtained
368 * @tc.desc: Call "IsWellCalendar" function judge whether the calendar is well from locale.
384 * @tc.desc: Call "IsWellCollation" function judge whether the collation is well from locale.
536 EXPECT_STREQ("en-US", result.locale.c_str()); // default locale in ResolveLocaleCommon()
[all...]
H A Dlocale_helper_test.cpp73 // test locale is jslocale in HWTEST_F_L0()
78 // test locale is object in HWTEST_F_L0()
102 * @tc.desc: Call "CanonicalizeUnicodeLocaleId" function canonicalize locale(Language-Tag),The English case of language,
104 * is lowercase.if locale string is IsUtf16,return empty string.
112 JSHandle<EcmaString> locale = factory-> NewFromStdString("en-Us"); in HWTEST_F_L0() local
113 JSHandle<EcmaString> canonicalizeLocaleId = LocaleHelper::CanonicalizeUnicodeLocaleId(thread, locale); in HWTEST_F_L0()
116 locale = factory-> NewFromStdString("kO-kore-kr"); in HWTEST_F_L0()
117 canonicalizeLocaleId = LocaleHelper::CanonicalizeUnicodeLocaleId(thread, locale); in HWTEST_F_L0()
120 locale = factory-> NewFromStdString("id-u-co-pinyin-de-ID"); in HWTEST_F_L0()
121 canonicalizeLocaleId = LocaleHelper::CanonicalizeUnicodeLocaleId(thread, locale); in HWTEST_F_L0()
[all...]
H A Djs_displaynames_test.cpp32 * function display locale and check the locale is within expectations.
61 * @tc.desc: Call function "GetAvailableLocales" to obtain the available locale from the ICU library and
62 * check whether the obtained locale is empty.
140 * @tc.desc: Display the language region and script of the locale according to the display configuration of
155 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh-Hant")); in HWTEST_F_L0()
164 JSDisplayNames::InitializeDisplayNames(thread, displayNames, locale, JSHandle<JSTaggedValue>(displayOptions)); in HWTEST_F_L0()
206 JSHandle<JSTaggedValue> locale(factory->NewFromASCII("zh-Hant")); in HWTEST_F_L0()
218 JSDisplayNames::InitializeDisplayNames(thread, displayNames, locale, JSHandle<JSTaggedValue>(displayOptions)); in HWTEST_F_L0()
224 JSObject::GetProperty(thread, displayOptions, localeKey).GetValue(), locale), tru in HWTEST_F_L0()
[all...]

Completed in 19 milliseconds

12