With the iPhone 6s, Apple has introduced a new feature called "3D Touch". App developers are able to use this technology by using it within their apps or provide so-called UIApplicationShortcutItems
on the home screen which appear when you 3D Touch the corresponding app icon. I've seen quite a few people out there who wanted to know how you would be able to localize those. Here's how.
What you have to do is, if you haven't already, create a new strings file called InfoPlist.strings
, then you localize this strings file to the languages you wish via the File Inspector on the right.
Now, you write down a key (for example: ADD_ITEM_SHORTCUT_TITLE
or ADD_ITEM_SHORTCUT_DESCRIPTION
) and the correct translation for each localized file. For example:
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 to the corresponding field. For example:
That way, you get localized UIApplicationShortcutItems
. Now, they look like this:
Phone language English:
Phone language German:
Based on Sam0711er answer link
If you have a lot of UIApplicationShortcutItems
, then just write down the necessary unique names at the end, for example (in InfoPlist.strings
):
ADD_ITEM_SHORTCUT_TITLE_SHARE = "Share app";
ADD_ITEM_SHORTCUT_TITLE_SOMETHING = "Something wrong?";
And in Info.plist
:
© 2022 - 2024 — McMap. All rights reserved.