Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

localization - Localizable.strings not working in iOS

I'm having this really mind breaking problem.

I created a Localizable.strings file in XCode and then 2 languages in it.

I filled up these files with the language translations, did a build/clean and then a fresh build, but there is no way the Localization strings show up in my project. If I try something like:

self.title = NSLocalizedString(@"HEAD", nil);

only "HEAD" instead of the translation shows up in the device simulator.

This is my project hierarchy:

project hierarchy

And this are the content of the English localization file: enter image description here

Any ideas?

question from:https://stackoverflow.com/questions/11194911/localizable-strings-not-working-in-ios

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found the answer myself.

Besides cleaning and building the project again and all that I described above. You must also delete the app in the iPhone simulator and then build it again! After that it works perfectly.

Talk about making it simple Apple...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...