2012-04-19 14:35:52 +08:00
|
|
|
#include "CurrentLanguageTest.h"
|
|
|
|
|
|
|
|
CurrentLanguageTest::CurrentLanguageTest()
|
|
|
|
{
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF* label = CCLabelTTF::create("Current language Test", "Arial", 28);
|
2012-04-19 14:35:52 +08:00
|
|
|
addChild(label, 0);
|
2012-10-23 17:48:50 +08:00
|
|
|
label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-50) );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelLanguage = CCLabelTTF::create("", "Arial", 20);
|
2012-10-23 17:48:50 +08:00
|
|
|
labelLanguage->setPosition(VisibleRect::center());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-08-21 15:28:43 +08:00
|
|
|
ccLanguageType currentLanguageType = CCApplication::sharedApplication()->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-10-19 09:41:46 +08:00
|
|
|
case kLanguageKorean:
|
|
|
|
labelLanguage->setString("current language is Korean");
|
|
|
|
break;
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
addChild(labelLanguage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CurrentLanguageTestScene::runThisTest()
|
|
|
|
{
|
|
|
|
CCLayer* pLayer = new CurrentLanguageTest();
|
|
|
|
addChild(pLayer);
|
|
|
|
|
|
|
|
CCDirector::sharedDirector()->replaceScene(this);
|
|
|
|
pLayer->release();
|
|
|
|
}
|