Search code examples
swiftswiftuilocalization

How to localize conditional String


I'm currently localizing my app from English to German. However, I've encountered difficulties when localizing conditional operators like this one:

Text("Status: \(bluetoothManager.isConnected ? "Connected" : "Disconnected")")

I attempted to localize only the strings, but unfortunately, that approach didn't solved the issue.

Best regards, Julian

Already tried:

  • localize only the strings e.g "Connected" = "Verbunden";

Solution

  • I switched from the legacy string file to the newer string catalog, which solved all issues for me.