I wonder if anyone has encountered the same problem and how they solve it.
I want to localize Default.png so I do the following steps which from what I understand should be the correct way (please correct me if I'm wrong).
Select Default.png in xcode
Command-I to Get Info
Click on Make File Localizable
Go back to General Tab (why Apple, why?)
Click on Add Localization
Enter es for Spanish according to this:
In finder I replace the Default.png in the es.lproj folder
I have tried in both the simulator and on an iPhone with changing the language between English and Spanish, but I only get the original file. Other localizations like app name and strings works just fine, but not this one...
I'm on xcode 3.2.3
Thanks
I'd thought I'd add the answer for localizing Launch.xib.
Create InfoPlist.strings file. (File,New,Resource,Strings)
Localize it and select your languages
For e.g. the Spanish version, add your launch screen key and name for the Spanish version of your Launch screen
"UILaunchStoryboardName" = "Launch_es";
Copy your existing Launch.xib to Launch_es.xib, and change the text and/or images to the Spanish translations or Spanish-named images.
I got this solution from Developers Forum (credit to Sascha Paulus, thanks Sascha!).
I had a similar problem in another project with localization, but the solution worked for both issues.
Here we go:
Delete App from Simulator (just to be sure)
Delete all versions of the localized Default.png (in XCode & on Disc)
Select Build > Clean All Targets
If not done yet, make the Localizion Directories (e.g. es.lproj, de.lproj)
Copy the localized Default.png in the appropriate Localizion Directory
Go To XCode > Right Mouse Click on Resources > Add > Existing File ...
Select the localized Default.png in the Localizion Directory
Don't forget to mark "Copy items into destination group's folder...." > Add
Repeat it with every localized Default.png
I think the trick is to delete the file you have a problem with, clean all and then add it again. If you don't have any localization there is no need to create a specific folder.
Give it a try, worked for me.
I have had the same problem. I have solved it with this:
In the Simulator, menu "simulator iOs", option "restart content and settings".
In Xcode, menu "Build", option "Clean All Targets"
And when I have selected the button "Build and run" it has worked.
Just to add that on a latest 4.3.3 every attempt to remove and re-add the files, and the clean all, nothing worked, but what solved everything was the remove-app-from-device-and-simulator and reinstall. Now every image and xib are translated correctly.
Related
I delete the storyboard by mistake from my app.
Where I can find it and restore it,
or I lost it?
The default storyboard filename is Main.storyboard, so that's what you should look for unless you gave it a different name. (Older versions named it MainStoryboard.storyboard, so if you are working on an older project, you might need to look for that instead.)
First, check your project folder (using the Finder). If it's there, you can drag it back into your project in Xcode, or you can use the “Add Files to …” menu option.
If it's not there, check the trash can. If it's there, you can right-click it and choose “Put Back”, then follow the steps in the previous paragraph.
Try running again your app and Xcode will create the file automatically, this worked for me.
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.
Seeing as the sv_SE localization doesn't take effect on the iPhone Simulator, but sv does (with the same language settings set to Swedish (language AND region), I would now like to remove the sv_SE localization to keep things proper.
What's the correct way to do this?
Do I really have to Remove All Localizations and re-do the translation work for the XIBs, as there seems no other way to do it in the Info window?
Mark localization in resources and delete? Delete folder/.lproj? Which is correct?
Xcode 3.2: expand localizable file subtree in left pane (files & groups). Then delete the unwanted localization. You probably want to click "Also move to trash" button.
Xcode 4: select the file, show utilities sidebar (the right one), pick the "show file inspector" button. There is a section with localizations. Select the unwanted one, click minus (-) button. Confirm. Or do it like in Xcode 3.2 deleting the localization from the project navigator. , it's up to you.
Xcode 5: works like Xcode 4.
If you remove all localizations (by mistake for instance) you can add the lproj folders to the project. You don't need to make one by one localizable again.
Tip: better you commit your work, experiment, if your changes doesn't work checkout the previous version and try again.
Some recent version of iOS caused my app icon to turn white. I've gone through everything in regards to images and can't find the issue. I'm running Xcode 3.2.5 with sdk 4.2. I do have an entry for "Icon files" in Info.plist with 5 keys:
Item 0 myapp.png
Item 1 myapp#2x.png
Item 2 myapp-72.png
Item 3 myapp-Small-50.png
Item 4 myapp-Small.png
Item 5 myapp-Small#2x.png
All the above have proper dimensions.
I see the image in 'Copy Bundle Resources' and also in the .app file for the simulator version. It is properly reference by name in 'Icon files', Item 0. It is not named Default.png since it is referenced by name in Item 0.
Any suggestions?
You just need those 3 Files:
Icon.png
Icon#2x.png
Icon-iPad.png
Put the names into the Info.plist under Icon Files.
EDIT: Clean your target if it still won't work!
That is what helped me (project summary - app icons are ok, iOS simulator - app icons are ok, iPhone device - blank icon).
Just reconnect your icons to project by dragging them from project navigator to App icon section in project summary.
When does it turn white? If you upgrade an app when it's running, sometimes it appears with a white icon in the "task" bar. This applies to apps you're developing and those download from iTunes. The fix is usually just to kill the app and restart.
That's the simplest answer, but I suspect might not be the solution.
Does the case of the file names in your Info.plist match the actual file names? The Simulator is not case sensitive but the iOS is.
You might also like to make a completely clean build. Don't just do a "Clean" in Xcode, instead manually clear out your build folder.
Finally, when the iPhone 4 first came out I had some issues with the order of the icons referenced in the Info.plist. I never saw white icons (usually just the non-Retina version) but this may be something worth playing with if nothing else works.
The icon file name may be too long if it is a custom file name. This is just a guess, and I hate guessing, but this appears to have been the problem I just had.
I have four targets using the same code but with different icons. I named the icons differently based on the app name, so I could store them in the same directory.
For example:
Icon.png
Icon_second.png
Icon_alternate.png
Icon_second_alternate.png (or Icon_secondalternate.png in case underscores were an issue)
This nomenclature was used for all of the icon names (there's 8 icon files to support iPhone, iPad, retina, etc).
The last one was giving me a problem. Despite a hundred clean/rebuilds, deleting the schema entirely and creating a new one, fruitless efforts, it suddenly occurred to me to try renaming it.
You should be able to name the icons differently, as I still use the first three versions. They are listed in the plist file and render in the project summary, and on the simulator, just fine. The last one rendered in the summary as well. However, I think the length of the file name was too long for the simulator. There must be a length limit. I renamed the fourth one to use the standard Icon.png naming but added it to the fourth target only (images are stored in a separate folder).
CONCLUSION: If you have more than one target for your app, use the standard naming system for all of your icons but add them to separate folders, and then when adding to Xcode just set the build target appropriately.
If you still have the default icon entry (even blank), this can happen, remove that entry in info.plist.
Also, Default.png would be your splash screen.
Load the icons into the Preview application, and make sure they are really png format (and not just named such) by doing a "Save As..." specifying PNG format in the save dialog. Do a Get Info to check the sizes. Make sure the case of all letters in the name match your plist entries.
I had the same problem recently - the Icons I was using were created in GIMP. When I opened them in Photoshop on the development Mac it complained about an ICC color profile. After re-saving the PNGs in Photoshop the Icons worked like a treat.
P.s. I just repeated my steps in creating the images in GIMP, but when saving unticked every extra option that GIMP - by default - was trying to add into the image when saving it. The icons worked perfectly this time around.
If you believe your icon configuration is correct, then you may simply be seeing a bug in Xcode.
As a workaround…
"Clean" your project. Choose Xcode > Product > Clean.
Delete the app from your simulator, or even reset the Simulator by choosing iOS Simulator > Reset Content and Settings.
Quit both the iOS Simulator and XCode apps, then restart them.
I have just discovered that after upgrading to the latest Xcode 3.2.2, I am not able anymore to localize Settings.bundle. The "Make File Localizable button always appears grayed out, and the Settings.bundle files appear with "No Explicit File Encoding", instead of UTF-16.
This happens not just for my old projects, it happens even for new projects.
Any clue? Is the localization procedure changed?
Thank you in advance.
Looks very strange, maybe need to report to bugreport? But here is workaround that works.
Reveal your Settings.bundle in Finder.
Right click (or Ctrl-click) on it and select Show Package contents.
Copy en.lproj and rename to desired language (e.g., fr.lproj).
Now you can go back to Xcode and edit localized Root.strings and files as you need.