0

I have followed a number of tutorials on the web to try and make an image on my storyboard launch screen change based on the culture that the iPhone is set to. I can make the text inside the app change so I know the culture is being set correctly, and that I have defined the cultures in the project settings but an image on the launch storyboard always shows the English picture.

My storyboard (created as a Launch Screen in Add, New File) is in the iOS project root and I have a Resources folder which contains folders named en.lproj, fr.lproj and de.lproj. I have an image in each of these folders called Header.png which is slightly different based on the language.

From what I have read, setting the image property of the image control on the storyboard to Header.png should show the english version based on it being my default developer culture (which works - this does happen), then should pick the same image from the relevant folder based on the culture changing and the app re-starting. This isn’t happening unfortunately, it always pulls the english one back.

I have tried putting the storyboard in a Base.lproj folder in the project root, and in a Base.lproj folder in the Resources folder and have tried moving the language folders (de.lproj, etc) out of the Resources folder to the root but none of these seemed to change anything.

I am using the iPhone 6 emulator and am developing in Xamarin studio (latest alpha version)

Does anybody have any suggestions as to where I might be going wrong? I’ve been working on this all day (and last night) and it’s driving me nuts :(

Thanks in advance,

Alan

Alan Kell
  • 11
  • 5

1 Answers1

0

I believe the setup for launch storyboards / screens differs to the general storyboards you use for your UI.

I have tried localising the images on both a Xamarin project and an Xcode project, neither would localise the image on the launch screen - but once launched the same image would be localised on the main storyboard.

Try creating a separate launch storyboard for each localisation as putting each one in it's respective .lproj folder.

https://developer.xamarin.com/guides/ios/advanced_topics/localization_and_internationalization/#Launch_Images

BytesGuy
  • 4,097
  • 6
  • 36
  • 55
  • Thanks for the feedback. I’ve tried what you have suggested here but am struggling unfortunately. I’ve moved my LaunchScreen.storyboard into Resources/en.lproj and have made copies of it in Resources/fr.lproj and Resources/de.lproj. In LaunchScreen.storyboard I’ve got an ImageView control with the Image property set to Header.png. I’ve got a different Header.png in each of the language folders yet every time I start the project, regardless of the culture that the device is set to I get the English Header.png :( Do you have any more suggestions by any chance? – Alan Kell Jul 02 '16 at 08:58
  • Also, in my info.plist I’ve got ‘Launch screen interface file base name’ set to LaunchScreen and ‘Main storyboard file base name’ set to LaunchScreen. I’m not referencing any kind of folder here, but it’s showing the launch screen so I guess folder references aren’t required as it’s in the resources folder? – Alan Kell Jul 02 '16 at 09:04