Showing localized image (in xcassets) using SwiftUI's Image()

Hello,

I am trying to show a localized image using SwiftUI's Image() by overridding the system locale like this:

.environment(\.locale, Locale.init(identifier: "nl"))

Both the preview and the actual app are still showing the default (fallback) image, not the localized version.

The image is localized in a catalog (xcassets) as described here..

When I change my system locale (to "nl") the correct image appears.

What am I doing wrong, or is this a bug in SwiftUI?

Thanks.

I am having the same problem

Showing localized image (in xcassets) using SwiftUI's Image()
 
 
Q