应用偏好语言返回systemlocale

Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
zhangdd_ewan 2024-04-10 19:25:21 +08:00
parent b889b15520
commit 05cb91c840

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;
}