[ios]cocos2dx获取设备的当前预言

参考:http://blog.sina.com.cn/s/blog_923fdd9b0101fmpv.html

http://bbs.9ria.com/thread-199313-1-1.html


    1.    获取当前设备的语言
    2. CCSize size=
      CCDirector::sharedDirector()->getWinSize();
    3. //    这个是显示当前设备
    4. CCLabelTTF *
      labelLanguage = CCLabelTTF::create("", "", 20);
    5. labelLanguage->setPosition(ccp(size.width* 0.5,
      size.height*0.5));
    6. //    获取语言
    7. ccLanguageType la =
      CCApplication::sharedApplication()->getCurrentLanguage();
    8. switch (la)
    9. {
    10. case
      kLanguageEnglish:
    11. labelLanguage->setString("当前设备语言是:
      English");
    12. break;
    13. case
      kLanguageChinese:
    14. labelLanguage->setString("当前设备语言是:
      Chinese");
    15. break;
    16. case
      kLanguageFrench:
    17. labelLanguage->setString("当前设备语言是:
      French");
    18. break;
    19. case
      kLanguageGerman:
    20. labelLanguage->setString("当前设备语言是:
      German");
    21. break;
    22. case
      kLanguageItalian:
    23. labelLanguage->setString("当前设备语言是:
      Italian");
    24. break;
    25. case
      kLanguageRussian:
    26. labelLanguage->setString("当前设备语言是:
      Russian");
    27. break;
    28. case
      kLanguageSpanish:
    29. labelLanguage->setString("当前设备语言是:
      Spanish");
    30. break;
    31. }
    32. addChild(labelLanguage);
上一篇:【一天一道LeetCode】#46. Permutations


下一篇:PHP截取中文无乱码函数——cutstr