Skip to content

Commit

Permalink
L10N: Fixed a little bug in EP_L10N_ApplyPreferredLanguageForCurrentT…
Browse files Browse the repository at this point in the history
…hread
  • Loading branch information
Amrsatrio committed Nov 20, 2023
1 parent 72f1458 commit a7a3d27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ExplorerPatcher/Localization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ BOOL EP_L10N_ApplyPreferredLanguageForCurrentThread()
(LPBYTE)&dwPreferredLanguage,
&dwSize
);
if (lres == ERROR_SUCCESS && dwSize > 0)
if (lres == ERROR_SUCCESS && dwPreferredLanguage != 0)
{
EP_L10N_Language language = LangIDToEPLanguage(dwPreferredLanguage);
EP_L10N_Language language = LangIDToEPLanguage((LANGID)dwPreferredLanguage);
rv = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, language.wszId, nullptr);
}
else
{
rv = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, nullptr, nullptr);
}
RegCloseKey(hKey);
}
return rv;
Expand Down

0 comments on commit a7a3d27

Please sign in to comment.