TWLocalize 0.0.5

TWLocalize 0.0.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Nov 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Tom Wolters.



TWLocalize

Build Status
Version
License
Platform

TWLocalize written in Swift makes iOS localizations easy. No longer do you need to localize your app, keep multiple .string files and use NSLocalizedString.

Usage

The framework uses a dictionary to retrieve the desired strings. Simply add your own TWLocalizedText dictionary with all the desired translated strings.

struct MyStrings {
  static let MyText:TWLocalizedText = [.english: "This is my text", .dutch: "Dit is mijn tekst"]
}
let label = UILabel()
label.setLocalized(text: MyStrings.MyText)

or use the localized property of MyText directly.

label.text = Strings.MyText.localized

TWLocalize makes use of the current locale language. It's possible to change the language.

TWLocalize.setLanguage(to: .dutch)

Reset the custom set language

TWLocalize.setLanguage(to: nil)

Installation

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

pod "TWLocalize"

Author

Tom Wolters, https://twitter.com/tom_wolters

License

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