[MRTCore] Sync between WGA.PrimaryLanguageOverride and MWGA.PrimaryLanguageOverride
This commit is contained in:
Родитель
f753170ead
Коммит
aaa39d5e70
|
@ -6,6 +6,8 @@
|
|||
#include "ResourceContext.g.cpp"
|
||||
#include "winrt/Windows.Globalization.h"
|
||||
|
||||
#include <AppModel.Identity.h>
|
||||
|
||||
const wchar_t c_languageQualifierName[] = L"Language";
|
||||
|
||||
#include "ApplicationLanguages.h"
|
||||
|
@ -101,6 +103,16 @@ void ResourceContext::Apply()
|
|||
winrt::check_hresult(MrmSetQualifier(m_resourceContext, eachValue.Key().c_str(), eachValue.Value().c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
// sync with Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride if it has been updated more recently
|
||||
if (AppModel::Identity::IsPackagedProcess())
|
||||
{
|
||||
auto language = winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride();
|
||||
if (language != ApplicationLanguages::PrimaryLanguageOverride())
|
||||
{
|
||||
ApplicationLanguages::PrimaryLanguageOverride(language);
|
||||
}
|
||||
}
|
||||
if (!ApplicationLanguages::PrimaryLanguageOverride().empty())
|
||||
{
|
||||
winrt::check_hresult(MrmSetQualifier(m_resourceContext, c_languageQualifierName, ApplicationLanguages::PrimaryLanguageOverride().c_str()));
|
||||
|
|
Загрузка…
Ссылка в новой задаче