Since a recent swift version, multi line string literals are available that allow to format the appearance of a multi line string easily.
I'm looking for a way, though, to localise such a string.
Here is an example of the text of a pre-configured mail, that users can send:
mailComposerVC.setMessageBody("""
Hi,
I would like to share the following feedback:
""",
isHTML: false)
It seems there is no way to properly transform this into the localisable .strings file.
As a workaround, I came up with the solution to individually localise each part of the message and use interpolation:
let localisedGreeting = NSLocalizedString("Hi", comment: "")
let localisedMessage = NSLocalizedString("I would like to share the following feedback: ", comment: "")
mailComposerVC.setMessageBody("""
\(localisedGreeting),
\(localisedMessage)
""",
isHTML: false)
The .strings file looks like this:
"Hi" = "Hallo";
"I would like to share the following feedback: " = "ich möchte folgendes Feedback geben: ";
Is there a better/more concise way to do this?