Localization of Default.png is not working

可紊 提交于 2019-11-28 09:28:37

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!