2012-04-19 14:35:52 +08:00
|
|
|
#include "CurrentLanguageTest.h"
|
|
|
|
|
|
|
|
CurrentLanguageTest::CurrentLanguageTest()
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelTTF* label = LabelTTF::create("Current language Test", "Arial", 28);
|
2012-04-19 14:35:52 +08:00
|
|
|
addChild(label, 0);
|
2013-07-12 14:11:55 +08:00
|
|
|
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y-50) );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelTTF *labelLanguage = LabelTTF::create("", "Arial", 20);
|
2012-10-23 17:48:50 +08:00
|
|
|
labelLanguage->setPosition(VisibleRect::center());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-15 16:24:42 +08:00
|
|
|
ccLanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage();
|
2012-04-19 14:35:52 +08:00
|
|
|
switch (currentLanguageType)
|
|
|
|
{
|
|
|
|
case kLanguageEnglish:
|
|
|
|
labelLanguage->setString("current language is English");
|
|
|
|
break;
|
|
|
|
case kLanguageChinese:
|
|
|
|
labelLanguage->setString("current language is Chinese");
|
|
|
|
break;
|
|
|
|
case kLanguageFrench:
|
|
|
|
labelLanguage->setString("current language is French");
|
|
|
|
break;
|
|
|
|
case kLanguageGerman:
|
|
|
|
labelLanguage->setString("current language is German");
|
|
|
|
break;
|
|
|
|
case kLanguageItalian:
|
|
|
|
labelLanguage->setString("current language is Italian");
|
|
|
|
break;
|
|
|
|
case kLanguageRussian:
|
|
|
|
labelLanguage->setString("current language is Russian");
|
|
|
|
break;
|
|
|
|
case kLanguageSpanish:
|
|
|
|
labelLanguage->setString("current language is Spanish");
|
|
|
|
break;
|
2012-11-28 16:53:10 +08:00
|
|
|
case kLanguageKorean:
|
2012-10-19 09:41:46 +08:00
|
|
|
labelLanguage->setString("current language is Korean");
|
|
|
|
break;
|
2012-11-28 16:53:10 +08:00
|
|
|
case kLanguageJapanese:
|
|
|
|
labelLanguage->setString("current language is Japanese");
|
|
|
|
break;
|
2013-03-03 10:32:09 +08:00
|
|
|
case kLanguageHungarian:
|
2012-12-05 18:31:05 +08:00
|
|
|
labelLanguage->setString("current language is Hungarian");
|
|
|
|
break;
|
2013-03-03 10:32:09 +08:00
|
|
|
case kLanguagePortuguese:
|
|
|
|
labelLanguage->setString("current language is Portuguese");
|
|
|
|
break;
|
|
|
|
case kLanguageArabic:
|
|
|
|
labelLanguage->setString("current language is Arabic");
|
|
|
|
break;
|
2013-05-29 16:31:46 +08:00
|
|
|
case kLanguageNorwegian:
|
|
|
|
labelLanguage->setString("current language is Norwegian");
|
|
|
|
break;
|
2013-06-21 03:15:42 +08:00
|
|
|
case kLanguagePolish:
|
|
|
|
labelLanguage->setString("current language is Polish");
|
|
|
|
break;
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
addChild(labelLanguage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CurrentLanguageTestScene::runThisTest()
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Layer* pLayer = new CurrentLanguageTest();
|
2012-04-19 14:35:52 +08:00
|
|
|
addChild(pLayer);
|
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
Director::getInstance()->replaceScene(this);
|
2012-04-19 14:35:52 +08:00
|
|
|
pLayer->release();
|
|
|
|
}
|