In the current XCode version (14.3), localized strings are not shown in preview, instead the key is shown. They show in Simulator and on device though. Can someone confirm this behaviour or am I missing a setting or so?
Example
Localized.strings (de): "price" = "Preis";
Code:
Text("price")
Preview*:
price
Simulator / device:
Preis
*) For the preview I am using:
ContentView()
.environment(.locale, .init(identifier: "de"))
as described here: https://developer.apple.com/documentation/xcode/previewing-localizations
2
Answers
Try this extension for your string
I got the same issue and I fixed it by cleaning the build folder. Command+Shift+K or via the menu bar: Product -> Clean Build Folder