Hello,
I am trying to localize my app in other languages. Most of the text are automatically extracted by Xcode when creating a string catalog and running my app.
However I realized few texts aren't extracted, hence I find a solution for most of them by adding
For example I have some declared variable as
var title: String = "Continue"
Hence for them to be trigger I changed the String by LocalizedStringResource which gives
var title: LocalizedStringResource = "Continue"
But I still have an issue with some variables declared as an array with this for example
@State private var genderOptions = ["Male", "Female", "Not Disclosed"]
I tried many things however I don't success to make these arrays to be translated as the word here "Male", "Female" and "Not Disclosed".
I have more array like that in my code and I am trying to find a solution for them to be extracted and be able to be localized
Few things I tried that doesn't worked
@State private var genderOptions : LocalizedStringResource = ["Male", "Female", "Not Disclosed"]
@State private var genderOptions = [LocalizedStringResource("Male"), LocalizedStringResource("Female"), LocalizedStringResource("Not Disclosed")]
Any idea more than welcome
Thank guys
Selecting any option will automatically load the page