I'm trying to add a line break to a string in the new Xcode 15 strings catalog, aka xcstrings. Thinking of nothing, I added the usual \n
to the place where I want the line break.
But in my SwiftUI view I get to see the actual escaped \n
and the text does not break lines. So the text "lorem ipsum\ndolor" gets presented to the user as "lorem ipsum\ndolor".
How can I create a text with intentional line breaks without using multiple independent strings in the catalog?
.xcstrings
file in Finder, and Preview (or open it with a text editor, it's a JSON file), and compare what you see with manual entering of "\n" and the "Option" key technique. You'll notice that it's\\n
(for manual) or just\n
(with the Option) explaining why it failed on your attempt. – Linkous