Swift 国际化和本地化框架 Localize-Swift
- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/marmelroy/Localize-Swift
- 软件文档: https://github.com/marmelroy/Localize-Swift
软件介绍
Localize-Swift 是一个简单的用于 Swift 应用的国际化和本地化框架,提供了清晰的语法和应用内的多语言切换。
特性
可保留你应用内已经使用的 Localizable.strings 文件
允许用户直接修改应用的语言而无需更改设备语言
使用 .Localized() 替代 NSLocalizedString(key,comment) - 更具 Swifty 语法风格
通过新的 python 脚本 genstrings 来生成你的字符串,可识别 .Localized().
使用方法
在每个 Swift 文件中引入 Localize 用来包含本地化的文本
If Carthage -
import Localize
If CocoaPods -
import Localize_Swift
Add .Localized() following any String object you want translated:
textLabel.text = "Hello World".Localized()
To get an array of available localizations:
Localize.availableLanguages()
To change the current language:
Localize.setCurrentLanguage("fr")To update the UI in the viewcontroller where a language change can take place, observe LCLLanguageChangeNotification :
NSNotificationCenter.defaultCenter().addObserver(self, selector: "setText", name: LCLLanguageChangeNotification, object: nil)
To reset back to the default app language:
Localize.resetCurrentLanaguageToDefault()
Programming PHP
Rasmus Lerdorf、Kevin Tatroe、Peter MacIntyre / O'Reilly Media / 2006-5-5 / USD 39.99
Programming PHP, 2nd Edition, is the authoritative guide to PHP 5 and is filled with the unique knowledge of the creator of PHP (Rasmus Lerdorf) and other PHP experts. When it comes to creating websit......一起来看看 《Programming PHP》 这本书的介绍吧!

