I write this post because this problem is driving me crazy.
I had same problems try to print same text(right to left like Persian) in UILabel using NSLocalizedString with parameters.
My code looks like this:
label.text = [NSString stringWithFormat:NSLocalizedString(@"The trick belongs to %@",nil),user];
In my string file in farsi I try to use this
"The trick belongs to %@" = " %@ میز را ترک کرد";
"The trick belongs to %@" = "%@ برنده کارت ها شد";
"The trick belongs to %@" = "@% برنده کارت ها شد";
"The trick belongs to %@" = "برنده کارت ها شد @%";
"The trick belongs to %@" = "برنده کارت ها شد %@";
And all this type of form always print:
"Maria برنده کارت ها شد " but has to be shown like "برنده کارت ها شد Maria"
Many thanks in advance
Your variable in the right hand side should be %1$@, and make sure it's the only entry for that key. In your example you have 5 strings, so it appears to be ignoring the other ones.
The reason we use %1$@ is because if we want a different order for the variables we can use 1,2,3, etc.
More on it here:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html#//apple_ref/doc/uid/10000051i-CH6
Scroll down to the Formatting Strings Resources section.