Search code examples
iosuilabeluistoryboardiboutletnslocalizedstring

iOS is there a way to assign Localized String to a UILable from IB/storyboard


I want to assign NSLocalizedString(key, comment) to a UILabel from storyboard without creating an outlet for it.


Solution

  • 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.