Placeholder and NSLocalizedString
cocoa, nslocalizedstring, objective-c
Solution
Did you copy-paste the code? Or did you re-typed it in? Because if you copy-pasted it the problem is there:
[textView1 insertText:[NSString stringWithFormat:NSLocalizedString(@"festaCompresaW, @""), nomeFesta, giornoFesta, meseFesta, annoFestaModificato, ggSett]];
I suppose it should be
[textView1 insertText:[NSString stringWithFormat:NSLocalizedString(@"festaCompresa", @""), nomeFesta, giornoFesta, meseFesta, annoFestaModificato, ggSett]];
So basically a `"` instead of `W`.
Also, in Localizable.strings you don't put `@` in front of the quotes, so this:
"festaCompresa" = @"%@ is the %i/%i/%i. the day of the week is %@. The holidays is included in the calculation. \n";
should be this:
"festaCompresa" = "%@ is the %i/%i/%i. the day of the week is %@. The holidays is included in the calculation. \n";
Hope it helps
Problem
I'm trying to translate my application and I find it difficult to translate when there are half a placeholder. I need to locate the following code: ``` [textView1 insertText:[NSString stringWithFormat:@"%@ è il %i/%i/%i. Il giorno delle settimana è %@. La Festa è compresa nel calcolo. \n", nomeFesta, giornoFesta, meseFesta, annoFestaModificato, ggSett]]; ``` I put in the file localizable.string (English): ``` "festaCompresa" = @"%@ is the %i/%i/%i. the day of the week is %@. The holidays is included in the calculation. \n"; ``` Then I edited the piece of code: ``` [textView1 insertText:[NSString stringWithFormat:NSLocalizedString(@"festaCompresaW, @""), nomeFesta, giornoFesta, meseFesta, annoFestaModificato, ggSett]]; ``` It does not work.