WidgetKit configurationDisplayName localization

It is noted that configurationDisplayName and description for iOS 14 Home Widget is not changing based on localization values added. How Apple's native apps doing the localization for the same.

Replies

I am having the same issue
What I have found is that the localization does indeed work, but it sporadically fails while debugging. Restarting my device fixes it sometimes, but not always. Maybe that helps.
Hi,

Try using LocalizedStringKey to localize the configurationDisplayName.

Use the following method to set the configuration display name,

public func configurationDisplayName(_ displayNameKey: LocalizedStringKey) -> some WidgetConfiguration

Eg.,

IntentConfiguration(kind: "<String>", intent: <your-intent>, provider: <intent-provider>) { entry in
  <your-view>   
}
 .configurationDisplayName(<key-for-your-localized-text>)
 .description(<key-for-your-localized-text>)

Hope this should help.

In which files are we supposed to put the translations? Tried a few without success