Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable English localization with Xcode 5

I have searched related questions and tried many suggested methods but none seems to work.

I have a japanese-only App that when run on an english device gets UI items such as back buttons translated ("Back").

To achieve this I have:

  • Deleted the English from "Localizations" from my project and chose to delete localized files (was a single *.strings file).

  • Changed CFBundleDevelopmentRegion in my Info.plist from jp_JPto jp as I read it should match the name of the *.lproj folder.

  • Cleaned, deleted, closed Xcode, etc. But default UI items are still getting translated to english.

Also I get some weird behavior in Xcode 5 now:

  • Checking the "Use Base Internationalization" checkbook presents an empty "Choose files and reference language to create Base localization". Choosing either Cancel or Finish has no effect and nothing happens.

  • Clicking on the "+" button to add the Other > "Base (Base)" localization does nothing.

I thing that my problem seems to be that my Base localization is still somehow english but I can't find a way to change that. Any ideas?

like image 449
Rivera Avatar asked Mar 20 '23 20:03

Rivera


2 Answers

I found that to truly remove English support I have to properly set the CFBundleDevelopmentRegion into a full valid region (e.g. ja_JP) and not just a language (just ja still resulted in English showing up).

When you have a valid region Xcode will show you the name of your country instead of the raw value in the Plist editor.


Seems like some modules, such as MFMailComposeViewController, get localized to English no matter what (tested on iOS 6 and 7).

like image 69
Rivera Avatar answered Apr 06 '23 08:04

Rivera


I encountered the same issue. Here are the steps I did to get past them.

  1. Localize your storyboard file.
    1. Select your Storyboard file in Xcode.
    2. In the “File Inspector”, under the “Localization” sub header, press the “Localize…” button.
    3. A dialog appears that says “Do you want to localize this file? The file will be moved into the lproj folder for the following language.” It lists a language. For me it was “English” and I chose that. For you, I suspect it will be “Japanese”.
    4. Press the “Localize” button.
  2. If it warns you that your storyboard file has changed outside of the project, choose “Save anyway”. If you don't it deletes the storyboard from your project. This happened to me with a source controlled project, but not with a new empty project.
  3. Go back to your project and check the “Use Base Internationalization” checkbox. Your storyboard should show up in the "Choose files and reference language to create Base localization" sheet.

If you go back to your storyboard, you will see “Base” as the checked localization. I had my language (English) show up as an option. When I checked it, a storyboard.strings file was created. Since my base was already in my preferred language, I didn’t need a strings file so I removed it. I presume that if I had another language, I could select that and get a storyboard.strings file for that language.

like image 37
Erik Allen Avatar answered Apr 06 '23 09:04

Erik Allen