TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Aug 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Meniny.
Localization
is a Localization Manager written in Swift.
You are welcome to fork and submit pull requests.
Localization
is open-sourced software, licensed under the MIT
license.
import Localization
class SomeSettingsClass {
func changeLanguage() {
Localization.preferredLanguage = LocalizableLanguage.french.code // == "fr"
}
}
import Localization
class SomeViewController: UIViewController {
var someLabel: UILabel = UILabel()
override func viewDidLoad() {
super.viewDidLoad()
// ...
Localization.startObserve(with: self, selector: #selector(localizationDidChangeWithPreferredLanguage))
}
deinit {
Localization.stopObserve(with: self)
}
func localizationDidChangeWithPreferredLanguage() {
someLabel.text = "SomeLocalizationKey".localized()
}
}