문제

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