Latest 0.1.0
Homepage https://github.com/byvapps/ByvLocalizations
License MIT
Platforms ios 8.0
Authors

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

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

pod "ByvLocalizations"

Usage

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    NotificationCenter.default.addObserver(
        self,
        selector: #selector(self.reloadLabels),
        name: ByvLocalizator.notiName,
        object: nil)

    reloadLabels()
}

@IBAction func change(_ sender: UIButton) {
    let av = UIAlertController(title: "Language".localize(comment: "Action sheet title"), message: "Select the language you want".localize(comment: "Action sheet description"), preferredStyle: .actionSheet)
    for language in ByvLocalizator.shared.availableLanguages {
        av.addAction(UIAlertAction(title: language.name(), style: .default, handler: { (action) in
            ByvLocalizator.shared.setLanguage(code: language.code)
        }))
    }
    av.addAction(UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil))

    self.present(av, animated: true, completion: nil)
}

func reloadLabels() {
    label.text = "textToTranslate".localize()
    languageName.text = ByvLocalizator.shared.currentLanguage.name()
}

Generator

This generator ByvLocalizableStringsGenerator.swift can help to create and update Localizable.strings

Author

Adrian Apodaca, [email protected]

License

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

Latest podspec

{
    "name": "ByvLocalizations",
    "version": "0.1.0",
    "summary": "Select language manually in app.",
    "description": "Select language manually in app. It also could be used when you need a language that is not supported in the os like "Basque"",
    "homepage": "https://github.com/byvapps/ByvLocalizations",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pataluze": "[email protected]"
    },
    "source": {
        "git": "https://github.com/byvapps/ByvLocalizations.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ByvLocalizations/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This