CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Thore Bartholomäus.
TBMXibLocalizer helps you to localise your xib files and is compatible with genstrings.
If your are using Cocoapods simply add the following to your Podfile
pod 'TBMXibLocalizer'
else add all .h and .m files you find the Classes
folder to your project.
For each xib file that you want to localise you should create a class that inherties from TBMXibLocalizer
. You should prefer a .m file without the correspondent .h because it makes everything much more clear.
@interface MainMenuLocalizer : TBMXibLocalizer
TBMXibDefineControl(aButton)
@end
@implementation MainMenuLocalizer
TBMXibLocalizeControl(aButton, NSLocalizedString(@"Hi I'm a button!", @""))
@end
TBMXibDefineControl
defines a control or rather an IBOutlet. TBMXibLocalizeControl
creates a method that calls -localizeControl:string:
. The methods by defined by TBMXibLocalizeControl
a prefixed and dynamically called using run time features in -awakeFromNib
.
In your xib file you have to create an object with the appropriate sublass of TBMXibLocalizer
and connect the IBOulets with the controls in the xib file.
TBMXibLocalizer
.To support TBMXibLocalizer
the class simply has to implement the TBMLocalizableControl
protocol.
Supports 10.7+
MIT