CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Localization 1.0.2

Localization 1.0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Meniny.



  • By
  • Elias Abel


What’s this?

Localization is a Localization Manager written in Swift.

Requirements

  • iOS 8.0+
  • macOS 10.10+
  • watchOS 2.0+
  • tvOS 9.0+
  • Xcode 8 with Swift 3

Contribution

You are welcome to fork and submit pull requests.

License

Localization is open-sourced software, licensed under the MIT license.

Usage

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()
  }
}