I want to assign NSLocalizedString(key, comment)
to a UILabel from storyboard without creating an outlet for it.
Right click on the xib file in Xcode, and choose Get Info . Select the General tab and on the bottom click Make File Localizable . Then you will be able to add localizations by clicking Add Localization on that same tab. I would recommend this tutorial for step-by-step information (and pretty pictures).
The key used to look up an entry in a strings file or strings dictionary file.
Just select your storyboard/xib
, go to File Inspector
. In the Localization
part, you can tick the language you want. Then, it will create a .string
file with all text used in storyboard
. You'll just have to provide a translation for each text used in storyboard
.
If no language appear in this part, you have to change values of Localization native development region
in Info of your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With