cocos2d-x获得系统的语言

获得手机系统的语言大笑


    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    CCLabelTTF *label = CCLabelTTF::create("", "Arail", 24);
    label->setPosition(ccp(winSize.width/2, winSize.height/2));
    this->addChild(label);
    
    LanguageType languageType = CCApplication::sharedApplication()->getCurrentLanguage();
    switch (languageType) {
        case kLanguageEnglish:
            label->setString("language is english");
            break;
        case kLanguageChinese:
            label->setString("language is chinese");
            break;
        default:
            break;
    }



你可能感兴趣的:(cocos2d-x)