参考:http://blog.sina.com.cn/s/blog_923fdd9b0101fmpv.html
http://bbs.9ria.com/thread-199313-1-1.html
- /
获取当前设备的语言 - CCSize size=
CCDirector::sharedDirector()->getWinSize(); - // 这个是显示当前设备
- CCLabelTTF *
labelLanguage = CCLabelTTF::create("", "", 20); - labelLanguage->setPosition(ccp(size.width* 0.5,
size.height*0.5)); - // 获取语言
- ccLanguageType la =
CCApplication::sharedApplication()->getCurrentLanguage(); - switch (la)
- {
- case
kLanguageEnglish: - labelLanguage->setString("当前设备语言是:
English"); - break;
- case
kLanguageChinese: - labelLanguage->setString("当前设备语言是:
Chinese"); - break;
- case
kLanguageFrench: - labelLanguage->setString("当前设备语言是:
French"); - break;
- case
kLanguageGerman: - labelLanguage->setString("当前设备语言是:
German"); - break;
- case
kLanguageItalian: - labelLanguage->setString("当前设备语言是:
Italian"); - break;
- case
kLanguageRussian: - labelLanguage->setString("当前设备语言是:
Russian"); - break;
- case
kLanguageSpanish: - labelLanguage->setString("当前设备语言是:
Spanish"); - break;
- }
- addChild(labelLanguage);