Lines Matching defs:language

12  * See the License for the specific language governing permissions and

53 const char *LocaleConfig::LANGUAGE_KEY = "persist.global.language";
57 const char *LocaleConfig::DEFAULT_LANGUAGE_KEY = "const.global.language";
243 string GetDisplayLanguageInner(const string &language, const string &displayLocaleTag, bool sentenceCase)
246 // 0 is the start position of language, 2 is the length of zh and fa
247 if (!language.compare(0, 2, "zh") || !language.compare(0, 2, "fa") || !language.compare(0, 2, "ro")) {
255 icu::Locale tempLocale = icu::Locale::forLanguageTag(language.c_str(), status);
269 icu::Locale locale = icu::Locale::forLanguageTag(language, status);
337 bool LocaleConfig::IsValidLanguage(const string &language)
339 string::size_type size = language.size();
344 if ((language[i] > 'z') || (language[i] < 'a')) {
406 // language in white languages should have script.
427 bool LocaleConfig::IsSuggested(const string &language)
440 string mainLanguage = GetMainLanguage(language);
444 bool LocaleConfig::IsSuggested(const std::string &language, const std::string &region)
456 string mainLanguage = GetMainLanguage(language);
554 std::string language = it->substr(0, pos);
556 if (language.compare("*") == 0) {
559 if (blockedLanguageRegions.find(language) == blockedLanguageRegions.end()) {
560 blockedLanguageRegions[language] = { region };
562 blockedLanguageRegions[language].insert(region);
636 string LocaleConfig::GetMainLanguage(const string &language)
639 icu::Locale origin = icu::Locale::forLanguageTag(language, status);
672 string LocaleConfig::GetDisplayLanguage(const string &language, const string &displayLocale, bool sentenceCase)
675 string adjust = Adjust(language);
676 if (adjust == language) {
682 icu::Locale locale = icu::Locale::forLanguageTag(language, status);
689 result = GetDisplayLanguageWithDialect(language, displayLocale);
713 HILOG_INFO_I18N("can not parse language supported locale file");
758 HILOG_INFO_I18N("can not open language data file");
764 HILOG_INFO_I18N("parse language data file failed");
874 std::string language = locale.GetLanguage();
878 std::string languageAndScripts = language + "-" + scripts;
884 std::string languageAndRegion = language + "-" + region;
889 if (locale2DisplayName.find(language) != locale2DisplayName.end()) {
890 return locale2DisplayName.at(language);
1162 std::string language = localeInfo.GetLanguage();
1163 if (localDigitMap.find(language) == localDigitMap.end()) {
1166 std::string localNumberSystem = localDigitMap.at(language);
1196 HILOG_ERROR_I18N("LocaleConfig::SetSystemLanguage %{public}s is not valid language tag.",
1200 // save old language, reset system language to old language if update locale failed.
1203 HILOG_ERROR_I18N("LocaleConfig::SetSystemLanguage update system language failed.");
1213 // reset system language to old language in case that system language is inconsist with system locale's lanuage.
1280 // check whether current language support local digit.
1282 std::string languageTag = localeTag.substr(0, 2); // obtain 2 length language code.
1366 // Compute language and script part from languageTag.
1370 HILOG_ERROR_I18N("LocaleConfig::UpdateLanguageOfLocale init icu Locale for language %{public}s failed.",
1397 // combine language, script, region and extend param with '-'
1419 // combine locale with origin locale's language and script with regionTag.