Search code examples
swiftswiftuilocalizable.strings

Swift Localizable String not working in SwiftUI


I don't know what's wrong with this. This is my localizable string

"sendEmailTo %s" = "We will send an email to %s. Thanks for watching";

and this is the way I'm using it into Text()

Text("sendEmailTo %s \("[email protected]")")

Do you have an idea of the error?, thank you so much


Solution

  • Since you want to replace %s with an email string, you need to get rid of it from the passed string to Text

    Text("sendEmailTo \("[email protected]")")
    

    Check out this blogpost Localization in SwiftUI