Disable English localization with Xcode 5 - ios

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?

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).

I encountered the same issue. Here are the steps I did to get past them.
Localize your storyboard file.
Select your Storyboard file in Xcode.
In the “File Inspector”, under the “Localization” sub header, press the “Localize…” button.
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”.
Press the “Localize” button.
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.
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.

Related

How to Localize Location Permission Dialog alert? [duplicate]

I've completed translating my app to Turkish using Base Localization. However, I also need to translate NSLocationWhenInUseUsageDescription key in my Info.plist file. I did exactly what I did for everything else:
Went to File inspector and checked Turkish:
Then I went to the new strings resource and completed my translation by adding this key to the localization file:
"NSLocationWhenInUseUsageDescription" = "[my Turkish description of location permissions]";
Saved, compiled, even deleted app from device and rebuilt, but no avail. When my app asks for location permissions, the explanation underneath is still the English one (I've tried including the English translation as well under Base translation file, but it didn't change anything).
Everything else is Turkish, translated just fine. It's just the location permission that doesn't translate. I've also seen How to localise a string inside the iOS info.plist file? and added the "Localized resources can be mixed" = YES key (of course, as CFBundleAllowMixedLocalizations, not literally that sentence) to my original plist but that also didn't change anything.
How can I solve the problem?
Here's what ended up working for me in Xcode 7.1.
First, go to project directory and manually create two InfoPlist.strings files, the first inside the en.lproj folder and the second inside the fr.lproj folder.
Both files should have the following content :
NSLocationWhenInUseUsageDescription = "YOUR TEXT HERE";
Since the files won't show up automatically in Xcode, you have to manually add both to the project bundle, this can be achieve via right-clicking the project name in Xcode and choosing the Add files to X option, then selecting the files you just created.
Also if you want to test the result & make sure things work, changing the Application Language in Edit Scheme > Run > Options isn't enough.
You need to change the simulator or the device language via Settings > General > Language & Region > iPhone Language
I've started over. Removed the translations, cleaned the project, and tried again. It worked. I have no idea why it didn't initially though.
My problem seems to be case sensitive:
My InfoPlist.strings had a lower "i" in finder and Xcode (infoPlist), but needs to be upper.
I changed file name and reference in the source Xcode Project and it works
(or deleted and re-create with the right name).

Cannot localize my app (adding a localization language shows no files and adds nothing)

Basically I can't add Localizations from the project > info > Localizations section.
When i try to do so, i can see the languages and select the one I want. But when the "Choose files and reference language..." screen appears it is completely empty. When i press finish nothing happens as well.
My goal is to localize the app name, so i have to add the InfoPlist.strings files to the languages I need.
If i try just selecting the file and pressing the localize button i get a prompt asking me to select the language, if i try any of the languages shown there i get this message error:
“Info.plist” couldn’t be moved to “ja.lproj” because either the former
doesn't exist, or the folder containing the latter doesn't exist.
I even tried manually adding the .lproj folders and adding the files there but the app name doesn't change. I suspect that it is because the project is configured to look for those in a different place.
This project was originally created with cocos2dx so it came with many things preconfigured, that was a long time ago with an old version of cocos2dx, so i suppose the folder structure has something to do. Still i don't know where to fix to at least be able to add more localizations.
The solution I found was to first create the "InfoPlist.strings" manually as a file inside the project directory. Then add the file from xcode. Then clicked on localization and select at least 1 language. Then i could add/remove localizations from my project settings.

Xcode removing language specific storyboards iOS

A while ago i decided to make my application multilanguage. I ended up using localizable.strings. So a different file for each language with all the translations in it.
In my main storyboard i just use NSLocalizedString(#"example", nil); on all my elements etc.
The problem i have is that i just found out that i somehow ended up with a storyboard for each language. I can fold out my MainStoryboard_iPhone.storyboard and under this it lists the language specific storyboards (MainStoryboard_iPhone.storyboard (English) and MainStoryboard_iPhone.storyboard (Dutch). Since i do not use this because i do everything with the localizable.strings i do not need this language specific storyboards. Over time they also became inconsistent. The english board has all the current changes and the dutch one does not.
My question is:
How can i safely remove these language specific storyboards and just keep using the localizable.strings. I want to end up with only 1 main storyboard (the top level one in the image above). I do not want to ruin my project and i want to be sure that the solution i use is correct.
Thank you!
I had the same issue.
I solved it by selecting "Base internationalization" in the project settings. Next, click the file inspector icon (right pane) for your storyboard file and make sure only Base is checked. Do not check the other languages.
This will fix the issue.
Don't bother with Base internationalization for your localizable.strings file, you can still use your regular translation setup there (ie, English and Dutch).
To "roll back" a localized File. you have to navigate to the folder where your class should be. You see the folder "en.lporj" (and the other languages) and there is the file you need.
-
Now copy to a save place, remove the multi-language file and in xcode and tell to remove from disk. Copy it again into your folder where you need it and import it in xcode.
Now the settings for the translation are resettet. you should recheck if no links went lost (simple clean build should be enought for this).
I handle only .xib file at the moment, but the procedure should be the same for all files :)
(if not, please let me know :D)
Greets,
geo

Why can't I add localization to my iOS app?

I'm trying to add a localization. I've read all those localization/internationalization guides from Apple and raywenderlich.com. I've marked all my code with NSLocalizedString macro, I've used genstrings to create Localizable.strings. But somehow I'm missing some important step.
When I try to add localization to my Localizable.strings I'm somehow restricted to English only.
When I try to add localization to project via "Editor"->"Add Localization" all language options are disabled.
Does anybody have any thoughts as to why am I restricted to English only? What have I missed?
I've tried to add localization to other projects with the same result. :(
You need to first add your localizations to your project. Click on the project file, ensure that the project, not the target, is selected in the middle pane and then choose the "Info" screen. There's a area called "Localizations" where you can add languages. You should then be able to localize your resources.
Another possible issue is that you are not selecting appropriately the project, which leads to all languages in the Add localization list being disabled.
By default the target may be selected, make sure you select the project instead. Then you can use the Add localization normally.
Something which kept me busy for too long. I looked over the language I needed (Swedish) in the first list and took the one from the "Other" list. Well my phone or emulator didn't change at all to Swedish. But when I took Swedish from the first list it got nicely updated when changing the language settings.
With Xcode 6, you can do it via Project Settings.

Remove an iOS app localization

In Bombr 1.2 I added a half-assed French localization, over time adding more strings to localize I've decided to drop the French localization. In Bombr 1.2.1 I removed the reference to fr.lproj/Localizable.strings from the Xcode project but the file still exists. Now that 1.2.1 is on the app store it still says that French is a supported language.
Will removing the fr.lproj folder and resubmitting correctly display the supported languages (this is my hunch), or is it possibly that iTunes Connect will not allow you to drop support for a language?
(I took a year of French in high school for fun, but not enough to translate my own app.)
Building on the answer given by #vanya, select your project from the list and delete the language under in the "localization" section.
If you want to remove app metadata localization, there's a delete menu on iTunesConnect
try to look at the info.plist which defines localizations and I guess some work in iTunesConnect should be done as well, but before approving an app
To remove the localization from Xcode (I'm using 4.2 on Snow Leopard) click on the file/folder in the sidebar, "Localizable.strings" and open the File Inspector (keyboard shortcut cmd-opt-1 or View > Utilities > Show File Inspector in the menu bar). You'll see a Localization pane with your localizations listed. Select the one you want to remove and click the minus sign to delete it.
So I landed on this question, but with some specific criteria:
I want to remove the base development language (English)
I want to keep the localized language (French)
None of the above answers worked and I couldn't find anything better on Stack Overflow. Eventually I found this gem: XCode: Remove localizations on build.
I develop in English, so the entire base of the app is in the English localisation. I then translated it into Finnish for the first release, but the intention was to only release the Finnish content and not the English.
Setting up a small script during a final Build phase works wonders to strip unwanted localisations:
#Remove english
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/en.lproj"
# Remove base (iOS 9)
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Base.lproj"
Then I had some runtime errors because some Storyboard files were localized and located in the Base.lproj folder. I worked around this by doing the following:
Un-localized those Storyboards (unchecked all languages) and then "Moved to trash"
Dragged the Storyboards from the trash back into the project. (Basically moving the Storyboards from Base.lproj folder – which the script would delete – to the project folder.)
Note: none of these Storyboards were actually localized (the .strings files were all empty). All the translations were properly set in code using NSLocalizedString.

Resources