!659 应用偏好语言返回systemlocale

Merge pull request !659 from zhangdd_ewan/cherry-0410
This commit is contained in:
openharmony_ci 2024-04-11 07:01:11 +00:00 committed by Gitee
commit e8cafd5719
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -99,11 +99,11 @@ std::string PreferredLanguage::GetAppPreferredLanguage()
if (preferences == nullptr) {
HILOG_ERROR_I18N(
"PreferredLanguage::GetAppPreferredLanguage get i18n preferences failed, return system language.");
return LocaleConfig::GetSystemLanguage();
return LocaleConfig::GetSystemLocale();
}
std::string res = preferences->GetString(PreferredLanguage::APP_LANGUAGE_KEY, "");
if (res.length() == 0) {
return LocaleConfig::GetSystemLanguage();
return LocaleConfig::GetSystemLocale();
}
return res;
}