自动国际化设置器。
仅替换 Class UILabel 中的文本或属性文本。(通过类名称字符串 == "UILabel" 判断)
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
。
//add to application:didFinishLaunchingWithOptions:
SSI18N.i18n()
//useage
self.lb1.text = "testKey1"
//or
SSI18N.addI18nFileWithDict(["ja_US":testJaUrl,"en_US":testUSUrl]) { () -> Void in
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.lb1.text = testKey1
self.lb2.attributedText = NSAttributedString(string: testKey2, attributes: [NSForegroundColorAttributeName:UIColor.whiteColor()])
})
}
Xcode 7(测试通过)
Xcode 6(测试失败,仍在修复中)
SSI18N 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "SSI18N"
CodeEagle,[email&protected]
SSI18N 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。