From 299872636411a72f99a8b0b0d74d5ab1f4bacc3e Mon Sep 17 00:00:00 2001 From: dumganhar Date: Wed, 2 Nov 2011 01:23:07 +0800 Subject: [PATCH] revert language --- .../platform/win32/CCApplication_win32.cpp | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/cocos2dx/platform/win32/CCApplication_win32.cpp b/cocos2dx/platform/win32/CCApplication_win32.cpp index 12a2432c8b..47e4910b93 100644 --- a/cocos2dx/platform/win32/CCApplication_win32.cpp +++ b/cocos2dx/platform/win32/CCApplication_win32.cpp @@ -129,32 +129,30 @@ ccLanguageType CCApplication::getCurrentLanguage() { ccLanguageType ret = kLanguageEnglish; - do - { - int nCount = sizeof(arrayChineseCode) / sizeof(int); - for (int i = 0; i < nCount; ++i) - { - if (arrayChineseCode[i] == LanguageID) - { - if (LanguageID == 2052) - { - ret = kLanguageChinese_Simplified; - } - else - { - ret = kLanguageChinese_Traditional; - } - break; - } - } - - CC_BREAK_IF(kLanguageEnglish != ret); - - if (1041 == LanguageID) - { - ret = kLanguageJapanese; - } - } while (0); + LCID localeID = GetUserDefaultLCID(); + unsigned short primaryLanguageID = localeID & 0xFF; + + switch (primaryLanguageID) + { + case LANG_CHINESE: + ret = kLanguageChinese; + break; + case LANG_FRENCH: + ret = kLanguageFrench; + break; + case LANG_ITALIAN: + ret = kLanguageItalian; + break; + case LANG_GERMAN: + ret = kLanguageGerman; + break; + case LANG_SPANISH: + ret = kLanguageSpanish; + break; + case LANG_RUSSIAN: + ret = kLanguageRussian; + break; + } return ret; }