xcodelocalizable.strings

Add "newline" character in localizable.strings


How to add a newline character in localizable.strings?

I tried putting \n, but no success.


Solution

  • 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