开发者

iPhone - System strings not localized on device

开发者 https://www.devze.com 2023-03-02 14:07 出处:网络
I build a project using XCode 4 and I was running on the simulator since now. I had noticed that the strings in System type \"Edit\" and \"Save\" buttons where in english, but everything in my simulat

I build a project using XCode 4 and I was running on the simulator since now. I had noticed that the strings in System type "Edit" and "Save" buttons where in english, but everything in my simulator was set to french. I suspected a bug like the one I had in XCode 3.

But now I'm running on my pure french configured iPhone, and those buttons are still in english, and are not localised as in other apps I can use.

I noticed that in my info.plist, t开发者_JAVA百科he "Localization native development region" was set to "en" by default. I've changed this to "Fr" or "France" in the drop down menu, but that does not chage anything.

How may I correct this to make those buttons show a localized title ?


I had basically the same question, but Black Frog's answer didn't really help me. I did some research and this is what I found out:

The localization is primarily based on the bundle. With info.plist you can add localizations that aren't in the bundle, but you can't remove localizations that are present in the bundle.

The preferred way to add a French localization in Xcode 4 is to do the following:

  1. Open project in Xcode >= 4.0.2
  2. Click on project file
  3. Select item under Project title on the right
  4. Check Localizations table.
  5. Select the localization you want to duplicate (English)
  6. Click + and select the language you want you're app to use (French)

If you don't wan't to support English there are two additional steps:

  1. Select the localization you want to remove (English)
  2. Click - and delete the files

Special thanks to Nekto who helped me figure this out.


You have to create localized version of your nib files. Or you can set the text of each button/label to a localized string in view load.

0

精彩评论

暂无评论...
验证码 换一张
取 消