I'm trying to localise my iPhone app, and I've tried to Google for help and look on here but I can't find anything that I am doing incorrectly.

I have created a Localizable.strings file, which currently only contains:

/* 
  Localizable.strings
  AppName

  Created by Joe on 25/10/2011.
  Copyright (c) 2011 xxx. All rights reserved.
*/

"DestinationHeader" = "I am going to";

I then went to the Localization tab on the right in XCode, and added "English" to the file. Now the file appears in my en.lproj folder in the bundle.

Then, in the view controller, I've added the line:

sectionTitle = NSLocalizedString(@"destinationHeader", nil);

But all that seems to be happening is the text "destinationHeader" is appearing instead of "I am going to". I'm obviously doing something wrong, does anyone have any ideas?

Thanks!

:-Joe

有帮助吗?

解决方案

Try this:

sectionTitle = NSLocalizedString(@"DestinationHeader", nil);

You should enter the same value of key in localizable.strings and it is case sensitive.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top