In Swift/XCode I always get the English error messages as an output and not the translated local message of my device (Simulator or real device doesn't matter). I added the localization countries in the info tap of my project, but do I have to do something else, like translating an English error file manually to e.g. German?
I know there are similar old questions on SO, and their answers all sound very simple but don't work.
Example code:
ContentView.swift
@State var errorText: String = ""
var body: some View {
VStack {
...
logIn()
Text(errorText)
}
}
.....
func logIn() {
session.logIn(email: email, password: password) { (user, error) in
if let error = error
{
self.errorText = error.localizedDescription
self.shouldAnimate = false
return
}
....
Edit:
I wasn't sure what I should enter here when adding German as a language. I use SwiftUI and not Storyboard if this fact matters:
What does work for example is the translation of the Edit Button in the Status Bar. But the error messages at the same time are always English.
.navigationBarItems(trailing: EditButton())