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.
Related
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:
My application is localized in two languages. I have pairs of xib files for the two localizations. When I change the device/simulator language, or when I modify xib files and rebuild-run the application, the old xib files are still used in the application, seem to be cached somewhere. How to tell my app to delete cached xib files?
Edit:
Check this scene:
On device, I run the app while the device language is English, all xib files are English. Then I change device language to Arabic, restart the device, Xib files still english!
what is the problem? and how to solve it?
From Xcode:
Build Menu -> Clean
and/or
Delete app from simulator
(usually I do both)
Make sure the xib are only in the localized directories
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.
I had a localized universal application. I copied a bunch of resources (XIB) files from an old project into the appropriate locations (English.lprog) directories for both iPhone (Filename~iPhone.xib) and iPad (Filename~iPad.xib). I added them to the project, and they all appear correctly in Xcode, as localizations, etc. I can open the localized files for each device in XCode/IB, and everything appears correct.
Now, when I run the project - everything is completely haywire. In short, when I run in English on the iPad simulator, I get the Chinese version of the iPhone XIBs!!!
I can't figure out what the problem is - any idea how to dig deeper?!
Few things fixed this:
Total clean build of project
Erase old application from device and/or simulator before reinstall.
Just because the icon in XCode looks like an IB icon, and double-clicking opens in IB, it still MUST have an ".xib" extension visible on the file.
Simulator is NOT case sensitive, but iPhone IS. This includes differences like MyClass~iphone.xib (works) vs. MyClass~iPhone.xib (doesn't work).
These steps have worked for me: In Xcode,
Check the location of folders for every language
Build > Clean all targets
Build > Compile
alt-R
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.