How localise the key UIApplicationShortcutItemTitl

2019-04-26 14:32发布

问题:

How should I localise the key UIApplicationShortcutItemTitle?

I know how localisation works for keys like NSLocationUsageDescription and NSLocationAlwaysUsageDescription: you put your localisation in the InfoPlist.strings file.

However, those are unique keys at the route of the document.

In this case, I'll have one UIApplicationShortcutItemTitle for each quick action, nested inside a dictionary and and array.

How can I localise these nested values?

回答1:

Despite UIApplicationShortcutItemTitle not being 'unique' because there are multiple arrays, you can specify the value of that key to link up to the key in InfoPlist.strings.

In Info.plist,

"UIApplicationShortcutItemTitle" : "shortcutTitle1"

In InfoPlist.strings,

shortcutTitle1 = "localised string value goes here for the first shortcut title in the info plist array"

Taken from Apple's sample application example.