I am trying to localize my app using this method: How to implement localization in Swift UI
In general it works. One problem I found is with text concatenation. Example: I have a translation for the text "bookings". To make it work I need to separate my previous code:
Text("bookings: 40")
to be:
Text("bookings")
.fontWeight(.bold)
+ Text(": 40")
.fontWeight(.bold)
Translation still works. The problem is that right now I need to have text formatting twice (in this example: fontWeight, but sometimes it's more complex).
I have tried to make it more simple like this:
Text("bookings" + ": 40)
.fontWeight(.bold)
This code works in English, but is not being translated now to another languages. How should I change my code to make it work and keep it simple?