Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I localize a folder of images for iOS?

I have a project that has already been heavily developed and all of a sudden we realized that we needed a set of images translated. I have the translated images, but I am unsure how to apply them to my project.

What is the easiest way to implement localization on a number of images that are already referenced in a project?

The images are referenced by object named. So @"xyz", rather than @"xyz.png". Also the images' locations are set to "Relative to Group", although I suppose I could change this, although I don't know what to.

Thanks.

[I've read the following, but it was unclear and get info doesn't have a localization option: localize many images in Xcode at once? ]

EDIT: There are 74 images to be localized [for each of three languages] EDIT: added how the images are referenced.

like image 291
Sophie McCarrell Avatar asked Dec 17 '12 20:12

Sophie McCarrell


1 Answers

First of all, make sure you set the localizations in your project:

enter image description here

You should have *.lproj folders in your project folder. One for each localization (en.lproj, de.lproj etc). Add the localized images to the right folder. You shouldn't have to change the code, if you used the normal ways to load your images ([UIImage imageNamed:@xyz.png"]). iOS will simple load the correct one depending on the user's language settings.

You may have to create the localization folder in the directory where the original image existed in order to not have to change the paths of the resources. So if the path of your image is myfolder/myimage.png, then the en.lproj and fr.lproj folders would go in myfolder.

like image 161
DrummerB Avatar answered Nov 20 '22 14:11

DrummerB