【Unity3D游戏开发】之多语言缩写对应表 (十五)

本文介绍了Unity3D在游戏开发中处理多语言的情况,特别是针对iOS返回的语言代码如"en"、"zh"、"zh-Hans"、"zh-Hant"等。文章提供了Unity支持的所有语言的缩写对应表,帮助开发者实现游戏的国际化和本地化。
摘要由CSDN通过智能技术生成

游戏开发时,iOS会返回当前语言为 "en"、"zh"、“zh-Hans"、"zh-Hant"等等


Unity对应的语言列表;


  private static function CheckAndSetUserLanguage() : boolean {
    switch(Application.systemLanguage) {
        case SystemLanguage.Afrikaans: SetLang("af"); break;
        case SystemLanguage.Arabic: SetLang("ar"); break;
        case SystemLanguage.Basque: SetLang("eu"); break;
        case SystemLanguage.Belarusian: SetLang("be"); break;
        case SystemLanguage.Bulgarian: SetLang("bg"); break;
        case SystemLanguage.Catalan: SetLang("ca"); break;
        case SystemLanguage.Chinese: SetLang("zh"); break;
        case SystemLanguage.Czech: SetLang("cs"); break;
        case SystemLanguage.Danish: SetLang("da"); break;
        case SystemLanguage.Dutch: SetLang("nl"); break;
        case SystemLanguage.English: SetLang("en"); break;
        case SystemLanguage.Estonian: SetLang("et"); break;
        case SystemLanguage.Faroese: SetLang("fo"); break;
        case SystemLanguage.Finnish: SetLang("fu"); break;
        case SystemLanguage.French: SetLang("fr"); break;
        case SystemLanguage.German: SetLang("de"); break;
        case SystemLanguage.Greek: SetLang("el"); break;
        case SystemLanguage.Hebrew: SetLang("he"); break;
        case SystemLanguage.Icelandic: SetLang("is"); break;
        case SystemLanguage.Indonesian: SetLang("id"); break;
        case SystemLanguage.Italian: SetLang("it"); break;
        case SystemLanguage.Japanese: SetLang("ja"); break;
        case SystemLanguage.Korean: SetLang("ko"); break;
        case SystemLanguage.Latvian: SetLang("lv"); break;
        case SystemLanguage.Lithuanian: SetLang("lt"); break;
        case SystemLanguage.Norwegian: SetLang("nn"); break; // TODO: Check
        case SystemLanguage.Polish: SetLang("pl"); break;
        case SystemLanguage.Portuguese: SetLang("pt"); break;
        case SystemLanguage.Romanian: SetLang("ro"); break;
        case SystemLanguage.Russian: SetLang("ru"); break;
        case SystemLanguage.SerboCroatian: SetLang("sr"); break; // TODO: Check
        case SystemLanguage.Slovak: SetLang("sk"); break;
        case SystemLanguage.Slovenian: SetLang("sl"); break;
        case SystemLanguage.Spanish: SetLang("es"); break;
        case SystemLanguage.Swedish: SetLang("sv"); break;
        case SystemLanguage.Thai: SetLang("th"); break;
        case SystemLanguage.Turkish: SetLang("tr"); break;
        case SystemLanguage.Ukrainian: SetLang("uk"); break;
        case SystemLanguage.Vietnamese: SetLang("vi"); break;
        case SystemLanguage.ChineseSimplified: SetLang("zh_Hans"); break;
        case SystemLanguage.ChineseTraditional: SetLang("zh_Hant"); break;
        case SystemLanguage.Unknown: SetLang(defaultLang); break; // Unknow Fallback to defaultLang
        case SystemLanguage.Hungarian: SetLang("hu"); break;
    };

    if(gameLang.length > 0) {
      return true;
    }

    return false;
  }


所有语言的缩写对应表:


var LANGUAGE_BY_LOCALE = {
    af_NA: "Afrikaans (Namibia)",
    af_ZA: "Afrikaans (South Africa)",
    af: "Afrikaans",
    ak_GH: "Akan (Ghana)",
    ak: "Akan",
    sq_AL: "Albanian (Albania)",
    sq: "Albanian",
    am_ET: "Amharic (Ethiopia)",
    am: "Amharic",
    ar_DZ: "Arabic (Algeria)",
    ar_BH: "Arabic (Bahrain)",
    ar_EG: "Arabic (Egypt)",
    ar_IQ: "Arabic (Iraq)",
    ar_JO: "Arabic (Jordan)",
    ar_KW: 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值