mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-16 02:02:51 -07:00
Workaround for Simplified Chinese localization issue of currency API (#2031)
* Workaround for Simplified Chinese localization issue of currency API * Update fix
This commit is contained in:
parent
b0f30025fe
commit
039bb5dea4
1 changed files with 8 additions and 0 deletions
|
@ -107,6 +107,14 @@ 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_view responseLanguage(m_responseLanguage->Data(), m_responseLanguage->Length());
|
||||
std::match_results<std::wstring_view::const_iterator> match;
|
||||
if (std::regex_match(responseLanguage.cbegin(), responseLanguage.cend(), match, std::wregex(L"zh-hans-[a-z]+", std::regex_constants::icase)))
|
||||
{
|
||||
m_responseLanguage = L"zh-CN";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue