Add "newline" character in localizable.strings

Burhanuddin Sunelwala picture Burhanuddin Sunelwala · May 2, 2013 · Viewed 11.6k times · Source

How to add a newline character in localizable.strings?

I tried putting \n, but no success.

Answer

Martin R picture Martin R · May 2, 2013

Using \n should just work. With this line in "Localizable.strings":

"abc" = "foo\nbar";

and this code:

NSString *s = NSLocalizedString(@"abc", NULL);
NSLog(@"%@", s);

I get the output

2013-05-02 14:14:45.931 test[4088:c07] foo
bar