Switching to Base Internationaliztion - iphone

My app is currently localized for English and Japanese, with seperate storyboards for each. I want to switch to base localization so that I only have to maintain a single storyboard. I've checked the "Use Base Internationalization" box in the project's info tab and chosen the English iPhone and iPad storyboards for the base.
I assume I should delete the Japanese iPhone and iPad storyboards I had previously used, but I don't see an option to delete them when right-clicking on their files in the file inspector. Should I delete these old storyboards, and, if so, how?
** Edit **
Changing the 'Main Interface' shown in the screenshot doesn't allow me to delete the Japanese storyboard. It's hard to tell which storyboard to select in the dropdown because its width is more narrow than the storyboard names, but that's a separate issue.

This tutorial drives you through the process step-by-step. This is how it worked for me:
Remove all localizations and leave only the base.
Ensure that the localized files were moved from the project directory (in Finder)
Add the localizations one-by-one
The localized strings are extracted from the storyboard only when the localization is created. The Tutorial above provides a script that can help you keeping the localized files up to date if the storyboard is changed.
In your case, you will have to merge the existing translations into the new files but I suppose it is not a huge deal compared to the gain with using a single file.
For reference, the process is described in this official tutorial too: http://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/chapters/InternationalizeYourApp/InternationalizeYourApp/InternationalizeYourApp.html

After cleaning and reloading, I was able to remove the Japanese storyboards by clicking on the - in the project settings:

Related

Using one storyboard with multiples languages

I want to localize my app in multiple language (like 6 or 7) but i don't want to add as many as storyboard copy. So, for 6 differents languages, I want:
One storyboard
6 Localizable.strings
In my storyboard, all components are outlets so i can localize them programmatically.
My issue is that i can't load application in language which don't have storyboard localization (but have localizable.strings), I get an error:
Could not find a storyboard named 'XXXX' in bundle NSBundle.
Is there a way to just use one storyboard with multiple Localizable files?
It sounds like your storyboard is still in the en.lproj folder. When your launches on a system that's configured to use another language, resources from that language's lproj will be used not the resources from the en.lproj. You need to mark your storyboard as not being localized in Xcode so that it doesn't get deployed to a en.lproj folder in your built app. Also make sure it's still included as a resource in the appropriate target of your project. You should be able to do all of this from the file inspector with your storyboard selected.
If you're targeting iOS 6.0 and later, you can use the Base.lproj feature. With that feature, your application just ships one storyboard, and multiple strings files and storyboard's strings are replaced at runtime with the strings from the appropriate language's strings file.
You can read more about base.lproj here:
https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/chapters/InternationalizeYourApp/InternationalizeYourApp/InternationalizeYourApp.html

Localized xib files is not being used

I created bunch of localized xib files -- Chinese, Japanese, etc. But when I switch my iphone language, the localized xibs are not being used and the labels remain Eng. However the strings are being picked up correctly.
Anybody have any ideas where I should troubleshoot?
The answer for me was to do a Clean build on the project, then delete the app on the device, then rebuild/reinstall. Just doing a Clean build wasn't enough, but deleting the app and reinstalling did the trick.

iPhone - System strings not localized on device

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, the "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:
Open project in Xcode >= 4.0.2
Click on project file
Select item under Project title on the right
Check Localizations table.
Select the localization you want to duplicate (English)
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:
Select the localization you want to remove (English)
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.

Localizing resources with xcode 4.0.2

I am having multiple issues trying to localize an app with xcode 4.0.2.
This app was coded initially with previous version, but since I installed the 4.0.2 everything (more or less) has worked, except localization. I have about 10 png's that load in 10 different xibs via UIImageView using Interface Builder. These png's are "correctly" localized, inside the es.lproj folder the spanish ones and in the en.lproj folder the english ones.
The weird thing is that even inside xcode, when I open the xib file, it sometimes shows the english version and sometimes the spanish. ¿?
The xibs are not localized, because there is nothing more to localize in there, just that UIImageView with the png's.
Is it not possible to localize just the png's?
Does anyone know if this issues respond to known bugs?
This png's are named text1.png, text2.png, text3.png ... Could it be something related to the serialized naming?
The default xib when there's no localization is english. When it load it pulls in the english resources. So you need to create the localized xibs in addition to the images. Or, what I'd recommend in your case since it's just 10 images, is to load and set the correct image in viewDidLoad. It'll be easier to maintain since you won't have to update every localized version of the xib for every change you make. Save that headache for when you have more items in one that are localized. :)
Well, I think that I get it...
I have changed the name to the png's. Instead of text1.png -> textone.png, texttwo.png ...
(The name should not be a problem, though)
When changing the names, some of the png's has become red. Even though they were still in the right lang.lproj (ex. en.lproj) folder.
I have created another directory to back-up the files and cut-paste all the "red ones".
Then I have deleted (references and file) these files from xcode.
Using finder, I have pasted each one of these png's inside my main language file. Just to move it again to the xcode resources from there.
After having it in xcode again, I have localized it using the "Localization +" Inspector.
Then, using finder again, I have replaced new "localized" png inside lang.lproj (ex. es.lproj) with the old language png in the back-up folder.
Finally, I have deleted the app in the simulator, cleaned, and Run again.
I did the same process with xib files. And everything works now. I haven't found any way to fix dependencies or paths to files that aparently are ok, but the localization doesn't reach them as expected. I understand that this should not be the way, though.

localized nib not working in a iPhone project

I am working on an iPhone project which I have translated to two languages : French and Spanish.
The issue I have is just with one file : the RootViewController nib.
I localized the MainWindow.nib, and it works (when I change the language, the text in the app changes according to what I specified). I also have several NSLocalizedStrings, with a Localizable.strings file, which also works, but this RootViewController doesn't:
I made the file localizable, added two languages (fr and es), which I modified, the files are located in the fr.lproj folder and es.lproj folder, and they are included in the Target/App/"Copy Bundle Ressources".
The text in the app is always the one from the English nib, even when I change the language.
Any idea where this would come from?
Is your English xib in the en.lproj folder side by side with the other languages? If your english xib is in the root, it may just be finding that and not looking elsewhere.
I've got the exact same problem, but with English & Spanish
The answer is in this question.
I've just cleaned all targets and all is fine now.