From 5f6ce9db92723196aaad1375624b3c6c95227b57 Mon Sep 17 00:00:00 2001 From: Ben Ward Date: Mon, 11 Feb 2013 15:29:56 +0000 Subject: [PATCH] Adding Portuguese and Arabic language support --- cocos2dx/platform/CCCommon.h | 4 +++- cocos2dx/platform/android/CCApplication.cpp | 8 ++++++++ cocos2dx/platform/blackberry/CCApplication.cpp | 8 ++++++++ cocos2dx/platform/ios/CCApplication.mm | 6 ++++++ cocos2dx/platform/linux/CCApplication.cpp | 8 ++++++++ cocos2dx/platform/mac/CCApplication.mm | 8 ++++++++ cocos2dx/platform/marmalade/CCApplication.cpp | 8 ++++++++ cocos2dx/platform/win32/CCApplication.cpp | 6 ++++++ 8 files changed, 55 insertions(+), 1 deletion(-) diff --git a/cocos2dx/platform/CCCommon.h b/cocos2dx/platform/CCCommon.h index 72340ee036..6b76011687 100644 --- a/cocos2dx/platform/CCCommon.h +++ b/cocos2dx/platform/CCCommon.h @@ -66,7 +66,9 @@ typedef enum LanguageType kLanguageRussian, kLanguageKorean, kLanguageJapanese, - kLanguageHungarian + kLanguageHungarian, + kLanguagePortuguese, + kLanguageArabic } ccLanguageType; // end of platform group diff --git a/cocos2dx/platform/android/CCApplication.cpp b/cocos2dx/platform/android/CCApplication.cpp index 847753dac1..b85a274e62 100644 --- a/cocos2dx/platform/android/CCApplication.cpp +++ b/cocos2dx/platform/android/CCApplication.cpp @@ -120,6 +120,14 @@ ccLanguageType CCApplication::getCurrentLanguage() { ret = kLanguageHungarian; } + else if (0 == strcmp("pt", pLanguageName)) + { + ret = kLanguagePortuguese; + } + else if (0 == strcmp("ar", pLanguageName)) + { + ret = kLanguageArabic; + } return ret; } diff --git a/cocos2dx/platform/blackberry/CCApplication.cpp b/cocos2dx/platform/blackberry/CCApplication.cpp index ed07456776..5122959a25 100644 --- a/cocos2dx/platform/blackberry/CCApplication.cpp +++ b/cocos2dx/platform/blackberry/CCApplication.cpp @@ -159,6 +159,14 @@ ccLanguageType CCApplication::getCurrentLanguage() { ret_language = kLanguageHungarian; } + else if (strcmp(language, "pt") == 0) + { + ret_language = kLanguagePortuguese; + } + else if (strcmp(language, "ar") == 0) + { + ret_language = kLanguageArabic; + } free(language); free(country); diff --git a/cocos2dx/platform/ios/CCApplication.mm b/cocos2dx/platform/ios/CCApplication.mm index 7927944b8d..8c08853931 100644 --- a/cocos2dx/platform/ios/CCApplication.mm +++ b/cocos2dx/platform/ios/CCApplication.mm @@ -113,6 +113,12 @@ ccLanguageType CCApplication::getCurrentLanguage() else if ([languageCode isEqualToString:@"hu"]){ ret = kLanguageHungarian; } + else if ([languageCode isEqualToString:@"pt"]){ + ret = kLanguagePortuguese; + } + else if ([languageCode isEqualToString:@"ar"]){ + ret = kLanguageArabic; + } return ret; } diff --git a/cocos2dx/platform/linux/CCApplication.cpp b/cocos2dx/platform/linux/CCApplication.cpp index 241fd143fe..5ad70949fe 100644 --- a/cocos2dx/platform/linux/CCApplication.cpp +++ b/cocos2dx/platform/linux/CCApplication.cpp @@ -152,6 +152,14 @@ ccLanguageType CCApplication::getCurrentLanguage() { ret = kLanguageHungarian; } + else if (0 == strcmp("pt", pLanguageName)) + { + ret = kLanguagePortuguese; + } + else if (0 == strcmp("ar", pLanguageName)) + { + ret = kLanguageArabic; + } return ret; } diff --git a/cocos2dx/platform/mac/CCApplication.mm b/cocos2dx/platform/mac/CCApplication.mm index ead2e66386..1ae54b71a4 100755 --- a/cocos2dx/platform/mac/CCApplication.mm +++ b/cocos2dx/platform/mac/CCApplication.mm @@ -119,6 +119,14 @@ ccLanguageType CCApplication::getCurrentLanguage() else if ([languageCode isEqualToString:@"hu"]){ ret = kLanguageHungarian; } + else if ([languageCode isEqualToString:@"pt"]) + { + ret = kLanguagePortuguese; + } + else if ([languageCode isEqualToString:@"ar"]) + { + ret = kLanguageArabic; + } return ret; } diff --git a/cocos2dx/platform/marmalade/CCApplication.cpp b/cocos2dx/platform/marmalade/CCApplication.cpp index bd469fd544..5258089473 100644 --- a/cocos2dx/platform/marmalade/CCApplication.cpp +++ b/cocos2dx/platform/marmalade/CCApplication.cpp @@ -185,6 +185,14 @@ ccLanguageType CCApplication::getCurrentLanguage() case S3E_DEVICE_LANGUAGE_HUNGARIAN: currentLanguage = kLanguageHungarian; break; + + case S3E_DEVICE_LANGUAGE_PORTUGUESE: + currentLanguage = kLanguagePortuguese; + break; + + case S3E_DEVICE_LANGUAGE_ARABIC: + currentLanguage = kLanguageArabic; + break; default: currentLanguage = kLanguageEnglish; diff --git a/cocos2dx/platform/win32/CCApplication.cpp b/cocos2dx/platform/win32/CCApplication.cpp index 98c9dde41a..99f37da1be 100644 --- a/cocos2dx/platform/win32/CCApplication.cpp +++ b/cocos2dx/platform/win32/CCApplication.cpp @@ -145,6 +145,12 @@ ccLanguageType CCApplication::getCurrentLanguage() case LANG_HUNGARIAN: ret = kLanguageHungarian; break; + case LANG_PORTUGUESE: + ret = kLanguagePortuguese; + break; + case LANG_ARABIC: + ret = kLanguageArabic; + break; } return ret;