mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Workaround for Simplified Chinese localization issue of currency API
This commit is contained in:
parent
b0f30025fe
commit
9f49756f64
1 changed files with 10 additions and 0 deletions
|
@ -107,6 +107,16 @@ CurrencyDataLoader::CurrencyDataLoader(_In_ unique_ptr<ICurrencyHttpClient> clie
|
|||
if (GlobalizationPreferences::Languages->Size > 0)
|
||||
{
|
||||
m_responseLanguage = GlobalizationPreferences::Languages->GetAt(0);
|
||||
|
||||
// Workaround for Simplified Chinese localization issue of currency API.
|
||||
std::wstring responseLanguage(m_responseLanguage->Data());
|
||||
wregex pattern = wregex(L"zh-hans-[a-zA-Z]+", std::regex_constants::icase);
|
||||
std::wsmatch match;
|
||||
if (regex_match(responseLanguage, match, pattern))
|
||||
{
|
||||
responseLanguage = L"zh-CN";
|
||||
}
|
||||
m_responseLanguage = ref new Platform::String(responseLanguage.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue