zoukankan      html  css  js  c++  java
  • Cocos2d-x中获取设备语言的方法

    1.cocos2dx获取设备语言的方法:CCApplication::sharedApplication()->getCurrentLanguage()

    2.cocos2dx 2.1.4支持识别的语言可在ccLanguageType中查看。以下是ccLanguageType的所以枚举语言。

    kLanguageEnglish = 0,

    kLanguageChinese,

    kLanguageFrench,

    kLanguageItalian,

    kLanguageGerman,

    kLanguageSpanish,

    kLanguageRussian,

    kLanguageKorean,

    kLanguageJapanese,

    kLanguageHungarian,

    kLanguagePortuguese,

    kLanguageArabic

    3. getDeviceLanguage()是我封装的一个函数,方便使用!

    void HelloWorld::getDeviceLanguage(){

    ccLanguageType deviceLanguage=CCApplication::sharedApplication()->getCurrentLanguage();

    switch (deviceLanguage) {

    case kLanguageChinese:

    CCLog("中文");

    break;

    case kLanguageEnglish:

    CCLog("英文");

    break;

    case kLanguageFrench:

    CCLog("法文");

    break;

    case kLanguageItalian:

    CCLog("意大利文");

    break;

    case kLanguageGerman:

    CCLog("");

    break;

    case kLanguageSpanish:

    CCLog("西班牙文");

    break;

    case kLanguageRussian:

    CCLog("俄文");

    break;

    case kLanguageKorean:

    CCLog("韩文");

    break;

    case kLanguageJapanese:

    CCLog("日文");

    break;

    case kLanguageHungarian:

    CCLog("匈牙利文");

    break;

    case kLanguagePortuguese:

    CCLog("葡萄牙文");

    break;

    case kLanguageArabic:

    CCLog("阿拉伯文");

    break;

    }

    }

  • 相关阅读:
    P3368 【模板】树状数组 2
    P3374 【模板】树状数组 1
    BZOJ 2654
    BZOJ 1016
    BZOJ 4870
    BZOJ 4868
    BZOJ 1503
    P3379 【模板】最近公共祖先(LCA)
    雅礼2017国庆1-1
    使用 CefSharp 网页显示问题
  • 原文地址:https://www.cnblogs.com/yssgyw/p/3416711.html
Copyright © 2011-2022 走看看