Skip to content

Commit

Permalink
Distinguishing between Simplified Chinese and Traditional Chinese in …
Browse files Browse the repository at this point in the history
…the Win32 Platform
  • Loading branch information
MartinLutherSu authored and halx99 committed Jan 9, 2025
1 parent f798f0f commit 2cdfe88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/platform/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum class LanguageType
{
ENGLISH = 0,
CHINESE,
CHINESE_TRADITIONAL,
FRENCH,
ITALIAN,
GERMAN,
Expand Down
17 changes: 15 additions & 2 deletions core/platform/win32/Application-win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,25 @@ LanguageType Application::getCurrentLanguage()
LanguageType ret = LanguageType::ENGLISH;

LCID localeID = GetUserDefaultLCID();
unsigned short primaryLanguageID = localeID & 0xFF;

unsigned short primaryLanguageID = PRIMARYLANGID(localeID);
unsigned short subLanguageID = SUBLANGID(localeID);

switch (primaryLanguageID)
{
case LANG_CHINESE:
ret = LanguageType::CHINESE;
switch (subLanguageID)
{
case SUBLANG_CHINESE_SIMPLIFIED:
ret = LanguageType::CHINESE;
break;
case SUBLANG_CHINESE_TRADITIONAL:
ret = LanguageType::CHINESE_TRADITIONAL;
break;
default:
ret = LanguageType::CHINESE;
break;
}
break;
case LANG_ENGLISH:
ret = LanguageType::ENGLISH;
Expand Down

0 comments on commit 2cdfe88

Please sign in to comment.