zoukankan      html  css  js  c++  java
  • 设置bundle包中的默认语言

    都只能获取中文

    1,

    #define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

    #define currentLanguageBundle [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:[[NSLocale preferredLanguages] objectAtIndex:0] ofType:@"lproj"]]

    #define An1LocalizedString(key, comment)  NSLocalizedStringFromTableInBundle(key,@"Root",currentLanguageBundle,@"")

     

    2,

    #define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

    #define currentLanguageBundle  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:@"en" ofType:@"lproj"]]

    #define An2LocalizedString(key, comment)   [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien"  ofType:@"bundle"]] localizedStringForKey:(key) value:comment table:@"Root"]

     

    3,

    #define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

    #define VivienResourceBundle_Language(lang)  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:(lang) ofType:@"lproj"]]

    #define VivienResourceBundle_DefaultLanguage  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:@"en" ofType:@"lproj"]]

    //#define AtmobotLocalizedString(key) [VivienResourceBundle_Language([InternationalControl userLanguage]) localizedStringForKey:(key) value:nil table:@"Root"]

    #define An3LocalizedString(key) [VivienResourceBundle_DefaultLanguage localizedStringForKey:(key) value:nil table:@"Root"]

  • 相关阅读:
    Nebula3的Input系统
    Nebula3学习笔记(7): 脚本系统
    项目经理成长日记(4)——态度决定一切
    Nebula3学习笔记(2): 核心库
    Nebula3学习笔记(1): 序
    魔兽争霸的地图验证漏洞和作弊图原理,兼谈魔兽联机机制[转载]
    Nebula3的多线程架构
    项目经理成长日记(5)——五指有长短,能力各不同
    Nebula3资源子系统
    Nebula3的场景管理
  • 原文地址:https://www.cnblogs.com/developer-qin/p/6098346.html
Copyright © 2011-2022 走看看