Which language for suggestedInvocationPhrase?

One thing that is not clear to me is which language to use for the suggestedInvocationPhrase when adding a new Shortcut to Siri in your app. The Siri language might be different than the app content or the iOS language. And it obviously seems that Siri is only trying to understand the spoken phrase in it's language.
Is there a way to access the Siri language or how should this be implemented?
Thanks!

Answered by DTS Engineer in 330137022

To correctly localize the phrase, you should get the phrase from your strings file with deferredLocalizedIntentsString. The SoupChef sample codedemonstrates this, and the WWDC 2018 localization session goes into more detail about localizing shortcuts.

Accepted Answer

To correctly localize the phrase, you should get the phrase from your strings file with deferredLocalizedIntentsString. The SoupChef sample codedemonstrates this, and the WWDC 2018 localization session goes into more detail about localizing shortcuts.

Looking at the SoupChef example. I can clearly state that deferredLocalizedIntentsString does not work correctly. I only see the "ORDERSOUPSUGGESTEDPHRASE" placeholder in the "Add to Siri" UI.

In Console I can see sandbox violation errors, the same is happening to my app:

error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/Base.lproj
error kernel Sandbox: AddShortcutExten(1686) deny(1) file-read-data /private/var/containers/Bundle/Application/299F6C5D-A3AB-4F6C-98A3-AAC05C581B63/SoupChef.app/en.lproj
error AddShortcutExtension Unable to simultaneously satisfy constraints.
error AddShortcutExtension -[INCExtensionProxy getDefaultValueForParameterNamed:completionHandler:]
blockinvoke2 Error getting default value for parameter name: <private> - Error Domain=INExtensionContextErrorDomain Code=1003
error AddShortcutExtension -[WFDynamicEnumerationParameter defaultSerializedRepresentation]
blockinvoke2 Error loading default serialized representation for dynamic enumeration: <private>
error AddShortcutExtension -[INCExtensionProxy getDefaultValueForParameterNamed:completionHandler:]blockinvoke2 Error getting default value for parameter name: <private> - Error Domain=INExtensionContextErrorDomain Code=1003
error AddShortcutExtension -[WFDynamicEnumerationParameter defaultSerializedRepresentation]blockinvoke2 Error loading default serialized representation for dynamic enumeration: <private>
error AddShortcutExtension -[INCExtensionProxy getDefaultValueForParameterNamed:completionHandler:]
blockinvoke2 Error getting default value for parameter name: <private> - Error Domain=INExtensionContextErrorDomain Code=1003
error AddShortcutExtension -[WFDynamicEnumerationParameter defaultSerializedRepresentation]
blockinvoke2 Error loading default serialized representation for dynamic enumeration: <private>

deferredLocalizedIntentsString is still the correct answer for the original question, and displays the appropriate localized string in iOS 14 Beta 4.
Which language for suggestedInvocationPhrase?
 
 
Q