Browse Source

Weather widget defaults to showing in the preferred language set in Windows, instead of English (#734)

pull/886/head 22000.469.42.2_00c3fe3
Valentin Radu 4 years ago
parent
commit
00c3fe3981
  1. 3
      CHANGELOG.md
  2. 42
      ExplorerPatcher/dllmain.c
  3. 6
      version.h

3
CHANGELOG.md

@ -14,6 +14,7 @@ Tested on OS build 22000.434. @@ -14,6 +14,7 @@ Tested on OS build 22000.434.
* The weather widget recomputes its area automatically, by default, in order to fit its contents, instead of remaining at a fixed size; there is also an option to choose between the two behaviors (.1)
* Possibility to disable the icon in the weather widget (.1)
* The weather widget defaults to showing in the preferred language set in Windows, instead of English (#734) (.2)
#### Fixes
@ -21,6 +22,8 @@ Tested on OS build 22000.434. @@ -21,6 +22,8 @@ Tested on OS build 22000.434.
* Fixed inconsistencies when displaying the weather widget and the system themes are disabled (aka the classic theme is used) (.1)
* Screen readers now read the weather data when requested for the weather widget (.1)
* Changing the Start button style or weather widget layout does not toggle taskbar auto-hide now; instead, the settings take effect immediately (.1)
* Fixed a bug that could corrupt registry entries of type REG_SZ set via the Properties UI (#734) (.2)
* Fixed a bug that reset the setting when pressing "Cancel" in an input box in the Properties UI (#734) (.2)
## 22000.469.41

42
ExplorerPatcher/dllmain.c

@ -5451,13 +5451,51 @@ void WINAPI LoadSettings(LPARAM lParam) @@ -5451,13 +5451,51 @@ void WINAPI LoadSettings(LPARAM lParam)
&dwSize
))
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en");
BOOL bOk = FALSE;
ULONG ulNumLanguages = 0;
LPCWSTR wszLanguagesBuffer = NULL;
ULONG cchLanguagesBuffer = 0;
if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, NULL, &cchLanguagesBuffer))
{
if (wszLanguagesBuffer = malloc(cchLanguagesBuffer * sizeof(WCHAR)))
{
if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, wszLanguagesBuffer, &cchLanguagesBuffer))
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, wszLanguagesBuffer);
bOk = TRUE;
}
free(wszLanguagesBuffer);
}
}
if (!bOk)
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en-US");
}
}
else
{
if (wszWeatherLanguage[0] == 0)
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en");
BOOL bOk = FALSE;
ULONG ulNumLanguages = 0;
LPCWSTR wszLanguagesBuffer = NULL;
ULONG cchLanguagesBuffer = 0;
if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, NULL, &cchLanguagesBuffer))
{
if (wszLanguagesBuffer = malloc(cchLanguagesBuffer * sizeof(WCHAR)))
{
if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, wszLanguagesBuffer, &cchLanguagesBuffer))
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, wszLanguagesBuffer);
bOk = TRUE;
}
free(wszLanguagesBuffer);
}
}
if (!bOk)
{
wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en-US");
}
}
}
if (epw)

6
version.h

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#define VER_MAJOR 22000
#define VER_MINOR 469
#define VER_BUILD_HI 42
#define VER_BUILD_LO 1
#define VER_BUILD_LO 2
#define VER_FLAGS VS_FF_PRERELEASE
@ -12,5 +12,5 @@ @@ -12,5 +12,5 @@
#define VER_STR(arg) #arg
// The String form of the version numbers
#define VER_FILE_STRING VALUE "FileVersion", "22000.469.42.1"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.469.42.1"
#define VER_FILE_STRING VALUE "FileVersion", "22000.469.42.2"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.469.42.2"

Loading…
Cancel
Save