How to use the "Localized String" of User Defined Runtime Attributes?

In xib or sb file, some labels witch maybe display stationary text, but when the project supports multi-language, I should create a IBOutlet property of label and then set text by NSLocalizedString(<#key#>, nil).

All though it works, but that's inconvenient way. So I want to use the text keypath with Localized String type in User Defined Runtime Attributes, like this:

text Localized String NSLocalizedString(<#key#>, nil)


But it doesn't work for me...

Take a look at using base internationalization. For static strings in your interface, the associated .strings file for each storyboard in each language will fill in the appropriate localized string at runtime for you without you needing to do any additional work to get the correct localized string. In addition, using this system allows you to use the preview feature in Interface Builder to preview what the interface looks like in each language.

Thanks for replying. But I can't still understand how should do...

How should set the text keypath with Localized String Type in xib or sb file?😟

You don't need to do anything with achieve to have IB automatically load in the localized strings for your storyboard. Take a look at the Internationalization and Localization for iOS sample, and notice how there are strings files for each language corresponding to the object IDs in IB. These strings files are automatically created for you when you add a language to the project in the Xcode Project editor.


We have comprehensive localization support throughout iOS and the Xcode tools. Take a moment to consider how our tools and APIs want you to build your localized support. A good starting point is to look through the numerous resources listed on our Internationalization page, which can be your jumping off point to WWDC videos, documentation, and sample code.

How to use the "Localized String" of User Defined Runtime Attributes?
 
 
Q