Reputation: 23
First of all,I did this follow this site http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014
I create a new Localizable.strings file,and localize it ,then add English and Japanese support.
I edit my Localizable.strings(en) file as follow:
"APPTITLE" = "Calibrate";
I edit my Localizable.strings(ja) file as follow:
"APPTITLE" = "こんにちわ";
At the source code,the early code : self.title = @"PianoDisc Calibrate"; instead of : self.title = NSLocalizedString(@"APPTITLE", nil);
Then I run it,But I get "APPTITLE" not "こんにちわ";
My environment is iPad mini,ios 8.1 system,Xcode 7 or 6.4. I'm also searched long time on the StackOverflow,like as NSLocalizedString only retrieves the key, not the value in Localizable.strings (IOS) ,I have tried the all answer,But it still not work. There are some info,I use follow code,
NSString *path = [[NSBundle mainBundle] pathForResource:@"ja" ofType:@"lproj"]; NSLog(@"!!!!!!!!!!!!!!!!%@",path);
sometimes get null,sometimes get the true path.
What I'm missing? Thanks anyway!
Upvotes: 1
Views: 182
Reputation: 23
I resolved it. Some guy remind that "check you haven't somehow messed up with the Build Rules (Xcode 4 -> select your target -> tab "Build Rules") There, check if you don't have too many "CopyStringsFile" rules that aren't using "CopyStringsFile". If so you can remove them all but one." This step just resolve my problem,thanks god.
Upvotes: 1