How to localize UIApplicationShortcutItems static objects?

With the iPhone 6s, Apple introduced a new feature called "3D Touch." Application developers can use this technology, using it in their applications or by providing the so-called UIApplicationShortcutItems on the main screen, which appears when your 3D Touch matches the icon of the corresponding application. I saw a lot of people who wanted to know how you can localize them. Here is how.

+6
source share
1 answer

What you need to do if you have not yet created a new string file called InfoPlist.strings , then you localize this string file in the languages ​​you need using the File Inspector on the right.

Now you write down the key (for example: ADD_ITEM_SHORTCUT_TITLE or ADD_ITEM_SHORTCUT_DESCRIPTION ) and the correct translation for each localized file. For instance:

English file:

 ADD_ITEM_SHORTCUT_TITLE = "Add"; ADD_ITEM_SHORTCUT_DESCRIPTION = "a new item"; 

German file:

 ADD_ITEM_SHORTCUT_TITLE = "FΓΌge hinzu"; ADD_ITEM_SHORTCUT_DESCRIPTION = "ein neues Item"; 

Then go to your Info.plist and enter your key in the appropriate field. For instance:

what your info.plist might look like here

This way you get a localized UIApplicationShortcutItems . Now they look like this:

Phone Language English:

enter image description here

Phone Language German:

enter image description here

+16
source

All Articles