INAppLocalizer 1.0.0

INAppLocalizer 1.0.0

Maintained by Gamal.



  • By
  • Gamal

INAppLocalizer

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

INAppLocalizer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'INAppLocalizer'

Usage

import UIKit
import INAppLocalizer

class ViewController: UIViewController, Localizer {

    override func viewDidLoad() {
        super.viewDidLoad()
        NotificationCenter.default.addObserver(self,
                                               selector: #selector(onLanguageDidChanged),
                                               name: .languageDidChanged, object: nil)
        print(INAppLocalizer.current)
        print(INAppLocalizer.getSelectedLanguages())
        INAppLocalizer.set(language: "ar")
    }

    @objc func onLanguageDidChanged() {
        let language = localize(for: LocalizationsKeys.language)
        print(#function, language)
    }

}

enum LocalizationsKeys: String, LocalizedKey {
    case language = "langauge.lan"
}

Author

Gamal, [email protected]

License

INAppLocalizer is available under the MIT license. See the LICENSE file for more info.