1

i went through few video tutorials and links for localizing an IOS app,there are few very good tutorials about the localization though, i am facing issues with localizing the resources. i am using assets catalog for management of the resources in the app and i am using launcher.xib for my custom spalsh screen which contains a lable and an imageview. i will be setting the image to imageview based on the language settings (english and french). i followed initial steps for adding localization feature to the app, and it created fr.lproj directory in my xcode project folder. i copied few images with french text in to fr.lproj folder and few english texted images in to base.lproj. in assets catalog i used english texted images default images for the imageview, now i run the app by changing the language setting of the device, and result is in english. i went through this link http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014 where author says we cant localize the assets catalog, and he is doing a little trick to do it. but my problem is launcher.xib doesnt linked with .h and .m files and dont have any methods where i cant set an image programatically. How can i achieve this? help Me please.. Thanks.

RockandRoll
  • 409
  • 5
  • 23

1 Answers1

0

[UIImage imageNamed:@"NSLocalizedString (@"image_name_key", nil)"]

image_name_key will contain your image name in different language in string files. like

image_name_key = @"fr.jpg" image_name_key = @"en.jpg"

eNipu
  • 25
  • 1
  • 8
  • I cant set an image programatically, as i am dealing with launcher.xib file. i want to set an image from interface builder. – RockandRoll Feb 23 '15 at 11:16
  • In that case remove the default View scene(UIView) from Launch Screen.xib. Add a UIViewController in XIB. Create a subclass of the view controller. Do things programmatically in the code. – eNipu Feb 23 '15 at 11:30
  • Thanks for giving alternate solution eNipu, i can try that one. but i wanted to try this way, so that whether is it possible or not and i also saw this link http://stackoverflow.com/questions/26147439/xcode-6-ios-doesnt-use-storyboard-localizations , which say that it a bug in xcode6 storyboard.. – RockandRoll Feb 23 '15 at 11:36
  • and this link as well.. http://stackoverflow.com/questions/18814801/localize-asset-catalogs – RockandRoll Feb 23 '15 at 11:42