Skip to content

Meniny/Localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Version Author Build Passing Swift
Platforms MIT
Cocoapods Carthage SPM

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

Installation

CocoaPods

use_frameworks!
pod 'Localization'

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

About

📱A Localization Manager written in Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published