Merge pull request #497 from walzer/master

add more languages to CCApplication::getCurrentLanguage() method
This commit is contained in:
Walzer 2011-08-30 23:21:38 -07:00
commit a68fb803a0
3 changed files with 33 additions and 1 deletions

View File

@ -58,6 +58,10 @@ typedef enum LanguageType
{ {
kLanguageEnglish = 0, kLanguageEnglish = 0,
kLanguageChinese, kLanguageChinese,
kLanguageFrench,
kLanguageItalian,
kLanguageGerman,
kLanguageSpanish,
} ccLanguageType; } ccLanguageType;
NS_CC_END; NS_CC_END;

View File

@ -89,7 +89,23 @@ ccLanguageType CCApplication::getCurrentLanguage()
{ {
ret = kLanguageEnglish; ret = kLanguageEnglish;
} }
else if (0 == strcmp("fr", pLanguageName))
{
ret = kLanguageFrench;
}
else if (0 == strcmp("it", pLanguageName))
{
ret = kLanguageItalian;
}
else if (0 == strcmp("de", pLanguageName))
{
ret = kLanguageGerman;
}
else if (0 == strcmp("es", pLanguageName))
{
ret = kLanguageSpanish;
}
return ret; return ret;
} }

View File

@ -126,6 +126,18 @@ ccLanguageType CCApplication::getCurrentLanguage()
{ {
ret = kLanguageEnglish; 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;
}
return ret; return ret;
} }