Skip to content

Commit

Permalink
fixed cocos2d#676, add more languages into CCApplication::getCurrentL…
Browse files Browse the repository at this point in the history
…anguage(). Android & iPhone port is done, other platforms no yet.
  • Loading branch information
Walzer committed Aug 31, 2011
1 parent 4e6c338 commit a24a84d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cocos2dx/platform/CCCommon.h
Expand Up @@ -58,6 +58,10 @@ typedef enum LanguageType
{
kLanguageEnglish = 0,
kLanguageChinese,
kLanguageFrench,
kLanguageItalian,
kLanguageGerman,
kLanguageSpanish,
} ccLanguageType;

NS_CC_END;
Expand Down
18 changes: 17 additions & 1 deletion cocos2dx/platform/android/CCApplication_android.cpp
Expand Up @@ -89,7 +89,23 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
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;
}

Expand Down
12 changes: 12 additions & 0 deletions cocos2dx/platform/ios/CCApplication_ios.mm
Expand Up @@ -126,6 +126,18 @@ of this software and associated documentation files (the "Software"), to deal
{
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;
}
Expand Down

0 comments on commit a24a84d

Please sign in to comment.