Localization of Default.png is not working
Asked Answered
B

4

6

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

  1. Select Default.png in xcode
  2. Command-I to Get Info
  3. Click on Make File Localizable
  4. Go back to General Tab (why Apple, why?)
  5. Click on Add Localization
  6. Enter es for Spanish according to this:
  7. 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

Bomar answered 6/8, 2010 at 7:42 Comment(3)
What is the size of your launch image? In Finder, can you see Default.png in each .lproj folder?Waistcloth
Did you try cleaning the targets? Deleting the app and reinstalling?Coeternity
Hi Guys. The size is 78k for both versions. I can see the Default.png in both English.lproj and es.lproj folders (and yes they are different ;-). Have tried cleaning, cleaning targets, deleted app in both simulator and physical device but no difference :-(Bomar
B
6

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:

  1. Delete App from Simulator (just to be sure)

  2. Delete all versions of the localized Default.png (in XCode & on Disc)

  3. Select Build > Clean All Targets

  4. If not done yet, make the Localizion Directories (e.g. es.lproj, de.lproj)

  5. Copy the localized Default.png in the appropriate Localizion Directory

  6. Go To XCode > Right Mouse Click on Resources > Add > Existing File ...
  7. Select the localized Default.png in the Localizion Directory
  8. Don't forget to mark "Copy items into destination group's folder...." > Add
  9. 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.

Bomar answered 11/11, 2010 at 8:55 Comment(2)
Just copied the english image to en.lproj, and Finder shows it there. When I add the file in XCode, it shows instead in sv.lproj and not in en.lproj. Whooee, magical file systems. I love Apple.Mighty
do you have a working example ?Jandy
S
7

I'd thought I'd add the answer for localizing Launch.xib.

  1. Create InfoPlist.strings file. (File,New,Resource,Strings)

  2. Localize it and select your languages

  3. For e.g. the Spanish version, add your launch screen key and name for the Spanish version of your Launch screen

    "UILaunchStoryboardName" = "Launch_es";

  4. Copy your existing Launch.xib to Launch_es.xib, and change the text and/or images to the Spanish translations or Spanish-named images.

Selimah answered 16/7, 2015 at 19:21 Comment(0)
B
6

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:

  1. Delete App from Simulator (just to be sure)

  2. Delete all versions of the localized Default.png (in XCode & on Disc)

  3. Select Build > Clean All Targets

  4. If not done yet, make the Localizion Directories (e.g. es.lproj, de.lproj)

  5. Copy the localized Default.png in the appropriate Localizion Directory

  6. Go To XCode > Right Mouse Click on Resources > Add > Existing File ...
  7. Select the localized Default.png in the Localizion Directory
  8. Don't forget to mark "Copy items into destination group's folder...." > Add
  9. 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.

Bomar answered 11/11, 2010 at 8:55 Comment(2)
Just copied the english image to en.lproj, and Finder shows it there. When I add the file in XCode, it shows instead in sv.lproj and not in en.lproj. Whooee, magical file systems. I love Apple.Mighty
do you have a working example ?Jandy
L
1

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.

Loganloganberry answered 11/4, 2012 at 10:21 Comment(0)
M
0

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.

Mezcaline answered 12/6, 2012 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.