/base/global/i18n/frameworks/intl/test/fuzztest/localeinfo_fuzzer/ |
H A D | localeinfo_fuzzer.cpp | 28 LocaleInfo *locale = new LocaleInfo(input); in DoSomethingInterestingWithMyAPI() local 29 if (locale == nullptr) { in DoSomethingInterestingWithMyAPI() 32 locale->GetLanguage(); in DoSomethingInterestingWithMyAPI() 33 locale->GetScript(); in DoSomethingInterestingWithMyAPI() 34 locale->GetRegion(); in DoSomethingInterestingWithMyAPI() 35 locale->GetBaseName(); in DoSomethingInterestingWithMyAPI() 36 locale->GetCalendar(); in DoSomethingInterestingWithMyAPI() 37 locale->GetCollation(); in DoSomethingInterestingWithMyAPI() 38 locale->GetHourCycle(); in DoSomethingInterestingWithMyAPI() 39 locale in DoSomethingInterestingWithMyAPI() [all...] |
/base/global/i18n/frameworks/intl/src/ |
H A D | locale_util.cpp | 20 bool LocaleUtil::IsRTL(const std::string &locale)
in IsRTL() argument 22 icu::Locale curLocale(locale.c_str());
in IsRTL() 26 uint16_t LocaleUtil::EncodeLanguageByLocaleInfo(const LocaleInfo *locale)
in EncodeLanguageByLocaleInfo() argument 28 if (locale == nullptr) {
in EncodeLanguageByLocaleInfo() 31 return EncodeLanguage(locale->GetLanguage().c_str());
in EncodeLanguageByLocaleInfo() 34 uint32_t LocaleUtil::EncodeScriptByLocaleInfo(const LocaleInfo *locale)
in EncodeScriptByLocaleInfo() argument 36 if (locale == nullptr) {
in EncodeScriptByLocaleInfo() 39 return EncodeScript(locale->GetScript().c_str());
in EncodeScriptByLocaleInfo() 42 uint16_t LocaleUtil::EncodeRegionByLocaleInfo(const LocaleInfo *locale)
in EncodeRegionByLocaleInfo() argument 44 if (locale in EncodeRegionByLocaleInfo() [all...] |
H A D | index_util.cpp | 31 icu::Locale locale(LocaleConfig::GetSystemLocale().c_str()); in IndexUtil() 32 index = std::make_unique<icu::AlphabeticIndex>(locale, status); in IndexUtil() 34 icu::Locale locale(localeTag.c_str()); in IndexUtil() 35 index = std::make_unique<icu::AlphabeticIndex>(locale, status); in IndexUtil() 68 icu::Locale locale(localeTag.c_str()); in AddLocale() 70 index->addLabels(locale, status); in AddLocale()
|
H A D | i18n_calendar.cpp | 82 void I18nCalendar::InitCalendar(const icu::Locale &locale, CalendarType type)
in InitCalendar() argument 87 calendar_ = new icu::BuddhistCalendar(locale, status);
in InitCalendar() 91 calendar_ = new icu::ChineseCalendar(locale, status);
in InitCalendar() 95 calendar_ = new icu::CopticCalendar(locale, status);
in InitCalendar() 99 calendar_ = new icu::EthiopicCalendar(locale, status);
in InitCalendar() 103 calendar_ = new icu::HebrewCalendar(locale, status);
in InitCalendar() 107 calendar_ = new icu::IndianCalendar(locale, status);
in InitCalendar() 111 calendar_ = new icu::IslamicCalendar(locale, status, icu::IslamicCalendar::ECalculationType::CIVIL);
in InitCalendar() 115 InitCalendar2(locale, type, status);
in InitCalendar() 126 void I18nCalendar::InitCalendar2(const icu::Locale &locale, CalendarTyp argument [all...] |
H A D | utils.cpp | 109 bool IsValidLocaleTag(icu::Locale &locale) in IsValidLocaleTag() argument 113 std::string languageTag = locale.getLanguage() == nullptr ? "" : locale.getLanguage(); in IsValidLocaleTag() 178 icu::Locale locale = icu::Locale::forLanguageTag(language.data(), icuStatus); in GetISO3Language() local 179 if (U_FAILURE(icuStatus) || !IsValidLocaleTag(locale)) { in GetISO3Language() 182 return locale.getISO3Language(); in GetISO3Language() 188 icu::Locale locale; in GetISO3Country() local 190 locale = icu::LocaleBuilder().setLanguage("zh").setRegion(country).build(icuStatus); in GetISO3Country() 192 locale = icu::Locale::forLanguageTag(country.data(), icuStatus); in GetISO3Country() 196 if (U_FAILURE(icuStatus) || !IsValidLocaleTag(locale)) { in GetISO3Country() [all...] |
H A D | collator.cpp | 80 locale = icu::Locale::forLanguageTag(icu::StringPiece(curLocale), status); in Collator() 85 if (LocaleInfo::allValidLocales.count(locale.getLanguage()) > 0) { in Collator() 90 locale = localeInfo->GetLocale(); in Collator() 107 icu::Collator::getKeywordValuesForLocale("collation", icu::Locale(locale.getBaseName()), false, status)); in IsValidCollation() 133 locale.setUnicodeKeywordValue("co", collation, status); in SetCollation() 136 locale.setUnicodeKeywordValue("co", nullptr, status); in SetCollation() 142 locale.setUnicodeKeywordValue("co", collation, status); in SetCollation() 144 locale.setUnicodeKeywordValue("co", nullptr, status); in SetCollation() 148 locale.setUnicodeKeywordValue("co", nullptr, status); in SetCollation() 159 locale in SetUsage() [all...] |
H A D | locale_info.cpp | 64 locale = icu::Locale::forLanguageTag(icu::StringPiece(finalLocaleTag), status);
in InitLocaleInfo() 71 locale = icu::Locale::forLanguageTag(icu::StringPiece(finalLocaleTag), status);
in InitLocaleInfo() 75 language = locale.getLanguage();
in InitLocaleInfo() 76 script = locale.getScript();
in InitLocaleInfo() 77 region = locale.getCountry();
in InitLocaleInfo() 78 baseName = locale.getBaseName();
in InitLocaleInfo() 252 return locale;
in GetLocale() 261 Locale curLocale = locale;
in Maximize() 282 Locale curLocale = locale;
in Minimize()
|
/base/global/i18n_lite/frameworks/i18n/test/unittest/lite/common/ |
H A D | i18n_test.cpp | 52 LocaleInfo *locale = new LocaleInfo("zh", "Hans", "CN");
in HWTEST_F() local 53 EXPECT_TRUE(locale != nullptr);
in HWTEST_F() 54 delete locale;
in HWTEST_F() 64 LocaleInfo *locale = new LocaleInfo("zh", "CN");
in HWTEST_F() local 65 EXPECT_TRUE(locale != nullptr);
in HWTEST_F() 66 delete locale;
in HWTEST_F() 76 LocaleInfo *locale = new LocaleInfo();
in HWTEST_F() local 77 EXPECT_TRUE(locale != nullptr);
in HWTEST_F() 78 delete locale;
in HWTEST_F() 88 LocaleInfo locale("z in HWTEST_F() 1054 LocaleInfo locale = LocaleInfo::ForLanguageTag("zh-Hant-CN-u-nu-arab", status); HWTEST_F() local 1066 LocaleInfo locale = LocaleInfo::ForLanguageTag("zh-Hant-CN-u-nu-arab", status); HWTEST_F() local [all...] |
/base/global/resource_management_lite/frameworks/resmgr_lite/src/ |
H A D | global_utils.c | 43 static uint32_t GetValueFromLocale(const char *locale);
49 static uint32_t GetOffsetByLocale(const char *path, const char *locale, uint32_t length);
55 static uint32_t GetIdHeaderOffsetByLocale(const char *locale, const Key *keys, uint32_t configNum);
123 static uint32_t GetValueFromLocale(const char *locale)
in GetValueFromLocale() argument 125 if (locale == NULL) {
in GetValueFromLocale() 131 for (int32_t i = strlen(locale) - 1; i >= 0; i--) {
in GetValueFromLocale() 132 // locale needs to be case insensitive
in GetValueFromLocale() 133 value += (((uint8_t)tolower(locale[i])) << offset);
in GetValueFromLocale() 186 LocaleItem locale = {0, 0, 0};
in FindOffsetByLangWithScriptOrRegion() local 188 SetLocaleItemViaKeys(&(keys[i].keyParams[j]), &locale);
in FindOffsetByLangWithScriptOrRegion() 222 LocaleItem locale = {0, 0, 0}; FindOffsetByAllParam() local 353 GetOffsetByLocale(const char *path, const char *locale, uint32_t length) GetOffsetByLocale() argument 478 GetIdHeaderOffsetByLocale(const char *locale, const Key *keys, uint32_t configNum) GetIdHeaderOffsetByLocale() argument [all...] |
/base/global/i18n/interfaces/native/inner_api/i18n/include/ |
H A D | locale_util.h | 26 static bool IsRTL(const std::string &locale); 27 static uint16_t EncodeLanguageByLocaleInfo(const LocaleInfo *locale); 28 static uint32_t EncodeScriptByLocaleInfo(const LocaleInfo *locale); 29 static uint16_t EncodeRegionByLocaleInfo(const LocaleInfo *locale);
|
/base/global/i18n/frameworks/intl/test/unittest/ |
H A D | intl_number_format_test.cpp | 42 string locale = "en-IN"; in HWTEST_F() local 44 vector<string> locales{locale}; in HWTEST_F() 72 string locale = "en-IN"; in HWTEST_F() local 74 vector<string> locales{locale}; in HWTEST_F() 102 string locale = "en-IN"; in HWTEST_F() local 104 vector<string> locales{locale}; in HWTEST_F() 132 string locale = "en-IN"; in HWTEST_F() local 134 vector<string> locales{locale}; in HWTEST_F() 162 string locale = "en-IN"; in HWTEST_F() local 164 vector<string> locales{locale}; in HWTEST_F() 192 string locale = "en-IN"; HWTEST_F() local [all...] |
H A D | i18n_test.cpp | 590 std::string fakeLocale = "fake locale tag"; in HWTEST_F() 609 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); in HWTEST_F() local 611 std::unique_ptr<EntityRecognizer> m = std::make_unique<EntityRecognizer>(locale); in HWTEST_F() 627 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); in HWTEST_F() local 629 std::unique_ptr<EntityRecognizer> m = std::make_unique<EntityRecognizer>(locale); in HWTEST_F() 647 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); in HWTEST_F() local 649 std::unique_ptr<EntityRecognizer> m = std::make_unique<EntityRecognizer>(locale); in HWTEST_F() 665 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); in HWTEST_F() local 667 std::unique_ptr<EntityRecognizer> m = std::make_unique<EntityRecognizer>(locale); in HWTEST_F() 683 icu::Locale locale in HWTEST_F() local 699 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 715 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 735 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 755 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 773 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 793 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 809 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 829 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 847 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 865 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 883 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 903 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 921 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 939 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 959 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 979 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 997 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1017 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1039 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1059 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1079 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1095 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1115 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1136 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1157 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1179 icu::Locale locale = icu::Locale::forLanguageTag(localeStr, status); HWTEST_F() local 1197 LocaleInfo *locale = new LocaleInfo("zh-Hans-CN"); HWTEST_F() local 1210 LocaleInfo *locale = new LocaleInfo("zh-Hans-CN"); HWTEST_F() local 1223 LocaleInfo *locale = new LocaleInfo("zh-Hans-CN"); HWTEST_F() local 1343 std::string locale = "ug-CN"; HWTEST_F() local [all...] |
/base/global/i18n_lite/frameworks/i18n/src/ |
H A D | date_time_format.cpp | 25 * construct a DateTimeFormat object with request pattern and locale.
27 * locale, locale information to retrieve datetime resource form icu data.
29 DateTimeFormat::DateTimeFormat(AvailableDateTimeFormatPattern requestPattern, const LocaleInfo &locale)
in DateTimeFormat() argument 31 this->locale = locale;
in DateTimeFormat() 49 impl = new(nothrow) DateTimeFormatImpl(requestPattern, locale);
in Init() 53 DataResource resource(&locale);
in Init() 63 NumberFormatImpl *numberFormatter = new(nothrow) NumberFormatImpl(locale, status);
in Init()
|
H A D | plural_format.cpp | 21 PluralFormat::PluralFormat(LocaleInfo &locale, I18nStatus &status)
in PluralFormat() argument 23 if (locale.GetId() == nullptr) {
in PluralFormat() 27 mLocale = locale;
in PluralFormat()
|
H A D | measure_format.cpp | 26 locale = localeinfo; in MeasureFormat() 35 measureFormatImpl = new MeasureFormatImpl(locale, status); in Init() 39 DataResource resource(&locale); in Init()
|
H A D | locale_info.cpp | 272 LocaleInfo locale;
in ForLanguageTag() local 275 return locale;
in ForLanguageTag() 277 ParseLanguageTag(locale, languageTag, status);
in ForLanguageTag() 278 locale.InitIdstr();
in ForLanguageTag() 279 return locale;
in ForLanguageTag() 282 void LocaleInfo::ParseLanguageTag(LocaleInfo &locale, const char *languageTag, I18nStatus &status)
in ParseLanguageTag() argument 304 if (!ParseNormalSubTag(locale, start, tagLength, options, type)) {
in ParseLanguageTag() 306 ProcessExtension(locale, key, value);
in ParseLanguageTag() 315 bool LocaleInfo::ParseNormalSubTag(LocaleInfo &locale, const char *start, size_t tagLength, uint16_t &options,
in ParseNormalSubTag() argument 323 locale in ParseNormalSubTag() 378 ProcessExtension(LocaleInfo &locale, const char *key, const char *value) ProcessExtension() argument [all...] |
H A D | number_format.cpp | 21 NumberFormat::NumberFormat(LocaleInfo &locale, int &status)
in NumberFormat() argument 23 if (locale.GetId() == nullptr) {
in NumberFormat() 27 mLocale = locale;
in NumberFormat()
|
/base/global/resource_management_lite/frameworks/resmgr_lite/src/utils/ |
H A D | utils.cpp | 100 * @brief locale compose of language,script and region,encode as 64bits. 122 uint16_t Utils::EncodeRegionByResLocale(const ResLocale *locale) in EncodeRegionByResLocale() argument 124 if (locale == nullptr) { in EncodeRegionByResLocale() 127 return Utils::EncodeRegion(locale->GetRegion()); in EncodeRegionByResLocale() 130 uint16_t Utils::EncodeLanguageByResLocale(const ResLocale *locale) in EncodeLanguageByResLocale() argument 132 if (locale == nullptr) { in EncodeLanguageByResLocale() 135 return Utils::EncodeLanguage(locale->GetLanguage()); in EncodeLanguageByResLocale() 138 uint32_t Utils::EncodeScriptByResLocale(const ResLocale *locale) in EncodeScriptByResLocale() argument 140 if (locale == nullptr) { in EncodeScriptByResLocale() 143 return Utils::EncodeScript(locale in EncodeScriptByResLocale() [all...] |
/base/global/resource_management_lite/frameworks/resmgr_lite/include/utils/ |
H A D | utils.h | 37 static uint16_t EncodeLanguageByResLocale(const ResLocale *locale); 41 static uint32_t EncodeScriptByResLocale(const ResLocale *locale); 47 static uint16_t EncodeRegionByResLocale(const ResLocale *locale);
|
/base/global/i18n/frameworks/intl/entity_recognition/date_time_recognition/src/ |
H A D | date_time_rule.cpp | 12 * See the License for the specific locale governing permissions and 23 DateTimeRule::DateTimeRule(std::string& locale) in DateTimeRule() argument 34 Init(locale); in DateTimeRule() 49 void DateTimeRule::Init(std::string& locale) in Init() argument 52 std::string xmlPath = "/system/usr/ohos_locale_config/datetime/" + locale + ".xml"; in Init() 54 this->locale = this->localeMap["locale"]; in Init() 56 this->locale = locale; in Init() 58 xmlPath = "/system/usr/ohos_locale_config/datetime/" + this->locale in Init() 292 IsRelDates(icu::UnicodeString& hyphen, std::string& locale) IsRelDates() argument [all...] |
H A D | date_time_sequence.cpp | 36 std::string DateTimeSequence::GetDateOrder(const std::string &locale) in GetDateOrder() argument 39 icu::Locale localeObj = icu::Locale::forLanguageTag(locale.data(), icuStatus); in GetDateOrder() 41 HILOG_ERROR_I18N("Failed to create locale for GetDateOrder"); in GetDateOrder() 46 HILOG_ERROR_I18N("%{public}s getBaseName is null.", locale.c_str()); in GetDateOrder()
|
/base/global/i18n_lite/tools/i18n-dat-tool/src/main/java/ohos/global/i18n/ |
H A D | Utils.java | 57 * Get a locale's fallback, locale is specified with languageTag 195 * Get mask of a locale 197 * @param locale Indicates the specified locale related to the output mask 202 public static String getMask(ULocale locale, long[] maskOut) throws UnsupportedEncodingException { in getMask() argument 206 if ("fil".equals(locale.getLanguage())) { in getMask() 208 } else if ("mai".equals(locale.getLanguage())) { in getMask() 211 langs = locale.getLanguage().getBytes("utf-8"); in getMask() 215 if ("Latn".equals(locale in getMask() [all...] |
/base/global/i18n/frameworks/intl/entity_recognition/include/ |
H A D | entity_recognizer.h | 29 EntityRecognizer(icu::Locale& locale); 37 std::string locale; member in OHOS::Global::I18n::EntityRecognizer
|
/base/global/i18n/frameworks/intl/test/fuzztest/entityrecongnizer_fuzzer/ |
H A D | entityrecongnizer_fuzzer.cpp | 31 icu::Locale locale = icu::Locale::forLanguageTag(input, status); in DoSomethingInterestingWithMyAPI() local 32 EntityRecognizer entityRecongnizer(locale); in DoSomethingInterestingWithMyAPI()
|
/base/global/i18n/frameworks/intl/entity_recognition/src/ |
H A D | entity_recognizer.cpp | 21 EntityRecognizer::EntityRecognizer(icu::Locale& locale) in EntityRecognizer() argument 23 std::string region = locale.getCountry(); in EntityRecognizer() 24 std::string language = locale.getLanguage(); in EntityRecognizer()
|