To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 9 or higher. Swift 5.
Translatio is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Translatio"
Translatio provides 2 additions to the String objects :
localized
propertylocalized(withBundle:tableName)
method
They can both be used easily in code, this is an example :
let hello = "UI.Home.Hello".localized
let anotherHello = "UI.Home.Hello".localized(withBundle: Bundle.main, tableName: "Labels")
Translatio adds extensions to all the most common UI elements such as UIButton, UITextField, UITextView, UILabel, UIBarButtonItem, UINavigationItem. The extensions provide an @IBInspectable
property that can be modified directly in the storyboard. This gives a very big advantage in localizing interface files.
As you can see the UILabel now has a Localizable Text property that can be modified directly in the IB.
Andrea Mario Lufino, andrealufino.me.
Translatio is available under the MIT license. See the LICENSE file for more info.