Merge pull request #1474 from wenbin1989/gles20

Add kLanguageKorean to ccLanguageType and getCurrentLanguage()
This commit is contained in:
minggo 2012-10-21 18:49:42 -07:00
commit 9cf3f4c5f6
7 changed files with 41 additions and 2 deletions

View File

@ -63,7 +63,8 @@ typedef enum LanguageType
kLanguageItalian,
kLanguageGerman,
kLanguageSpanish,
kLanguageRussian
kLanguageRussian,
kLanguageKorean
} ccLanguageType;
// end of platform group

View File

@ -108,6 +108,10 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
ret = kLanguageRussian;
}
else if (0 == strcmp("ko", pLanguageName))
{
ret = kLanguageKorean;
}
return ret;
}

View File

@ -147,6 +147,10 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
ret_language = kLanguageRussian;
}
else if (strcmp(language, "ko") == 0)
{
ret_language = kLanguageKorean;
}
free(language);
free(country);

View File

@ -104,6 +104,9 @@ ccLanguageType CCApplication::getCurrentLanguage()
else if ([languageCode isEqualToString:@"ru"]){
ret = kLanguageRussian;
}
else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean;
}
return ret;
}

View File

@ -95,7 +95,25 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
ret = kLanguageEnglish;
}
else if ([languageCode isEqualToString:@"fr"]){
ret = kLanguageFrench;
}
else if ([languageCode isEqualToString:@"it"]){
ret = kLanguageItalian;
}
else if ([languageCode isEqualToString:@"de"]){
ret = kLanguageGerman;
}
else if ([languageCode isEqualToString:@"es"]){
ret = kLanguageSpanish;
}
else if ([languageCode isEqualToString:@"ru"]){
ret = kLanguageRussian;
}
else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean;
}
return ret;
}

View File

@ -118,6 +118,9 @@ ccLanguageType CCApplication::getCurrentLanguage()
case LANG_CHINESE:
ret = kLanguageChinese;
break;
case LANG_ENGLISH:
ret = kLanguageEnglish;
break;
case LANG_FRENCH:
ret = kLanguageFrench;
break;
@ -133,6 +136,9 @@ ccLanguageType CCApplication::getCurrentLanguage()
case LANG_RUSSIAN:
ret = kLanguageRussian;
break;
case LANG_KOREAN:
ret = kLanguageKorean;
break;
}
return ret;

View File

@ -34,6 +34,9 @@ CurrentLanguageTest::CurrentLanguageTest()
case kLanguageSpanish:
labelLanguage->setString("current language is Spanish");
break;
case kLanguageKorean:
labelLanguage->setString("current language is Korean");
break;
}
addChild(labelLanguage);