Localized app choosing the wrong images - ios

I localized my app and when I open it I get the english version. (Default is german language). I thought that I could copy the images with english text into the en.lproj folder. (They are the same name as the german versions). But it still takes the images from the de.lproj folder. And yes, running in german or english both work fine, only the images do not appear to change.
I did not set the images programmatically, but rather arranged them in the view (*.xib).

I have same problem. This seems like a bug in IB. If I rename one of loc. folders (eg. en.lproj) and then trying to open 'name.xib' Czech/English I see sometimes czech version of image, sometimes it shows missing one.

Related

iOS localized text not appearing on real device

I have localized my app. However, the storyboard text is failing in 1 instance. In Xcode, previewing the view controller for the required display language shows the correct text, and running on the simulator also works.
However, when running on a real device (with the same display language set), the non-localized text is shown (ie the localization lookup is failing).
This only happens for one particular piece of text, all the others appear correctly.
In the Main.strings file, all formatting for this failing bit of text is the same as the others.
Does anyone know why? Anyone know how to fix?
Thanks.

Localize several storyboards

I have a project which is relatively big, for such reason I use several storyboards. The thing is, I have not find the way to localize several storyboards in xcode. The options I see when using Base Internationalization are only related to my Main.storyboard and the LaunchScreen.storyboard files.
My app should be in english and spanish, those are the requirements. I have searched and searched but have not found the way to have .strings (english and spanish) for every storyboard, except the Main.
My storyboards are located in disk (and project structure) like this:
General_UI_Folder
Main.storyboard (with its .strings)
LaunchScreen.storyboard (with its .strings)
Subfolder1
...several .storyboards
Subfolder2
...several .storyboards
I'm using Xcode 8 and Swift 3.
I would appreciate any help, since I'm somehow new to iOS development.
You have 2 choices.
1) You localize each storyboard, using the storyboard localization system where it creates "substoryboards", 1 per language, where you change the value of labels, and other components, straight into the storyboards themselves.
You have to use this option:
2) Use the Localizable.strings files and update your view in every viewDidLoad method of your controllers.

Xcode Localization failed with xib files

I was working through iOS programming 3rd edition by Joe Conway and am stuck on localization. I added two languages under project - info, then clicked the localize button on the .xib file, finally translated the other .xib into the new language and checked that they are in the right folders. However no matter how many times I try the .xib refuse to display in the new language when I change language in simulator settings.
In addition, when I checked the current language with NSLog and NSLocale it tells me I am in the right language. I can even use this to translate by code some of the table cell contents I was displaying. But the correct .xib file just won't load.
Any help?

Adding new language to existing localized app

I have an app that uses localization, I need to add one more language, I want to display two different language images of same name in one xib file, the xib file is not localized as I am localizing the images. Can it be done using interface builder, without writing any code?
You can add one more language by click on + button.Hope this will help you.But you have to make multiple XIB's as you are saying to set the images only in one XIB i think it is not possible.
Add the images to your localized subdirectories in your project (en.lproj, es.lproj, etc.) and iOS will pick up the correct image when it unarchives the localized xib file.
Xcode can do this for you automatically: Just select the resource you want to localize (an image, xib file, etc.), display the File Inspector pane, and then click the Localize button.
(As a side note, it's a bad practice to localize a high number of images. You should remove text from images and choose them so they are "neutral" and "understandable" in every region of the world. Your app size will thank you for it.)
To do it without code you must localize the xibs, otherwise you will require code from you or others and some configuration. It's easier as follows:
Assuming you have added already localizations to the project (you can do it in Project > Info tab) you just need to select the image in the project tree and check the desired localizations in the right sidebar (cmd-alt-1, localizations).
Replace the image in each *.lproj directory with the localized version. Then in your viewDidLoad use -[UIImage imageNamed:] as usual to load an image into the xib image view or whatever you are doing.

Difficulty Localizing xib Files

I have localized two sets of xibs and put them in my project navigator as shown in the picture below:
My Localized.strings files are working fine, but the xib files are sometimes selected incorrectly. When I set the device language to French, I see the English xib view. When I set the device language to English, I see the French xib view.
I removed the xib files from the project, deleting the references only, and then dragged them back into project in the same places, as the picture shows. Right at the moment, I'm only seeing the English version, regardless of which language I have the device set to.
Is there something anyone can see that I'm doing wrong?
(I have read advice, like this one, on not using separate frames for each language. I may switch to that at some point, but right now, I just want to understand what is wrong with my set up.)
Update
Here is the file organization for the en.lproj folder. The fr.lproj folder is set up the same way. These are inside a folder called Resources.
Update - Final Result
I experimented with the localization settings for my xib files in the panel at the right.
and finally noticed those disclosure buttons when I had two or more languages selected for localization. Clicking on the disclosure button revealed a xib file for each language. I then had redo the localization for the foreign language xib. (I probably could have copied and pasted from the existing xibs.)
So the files are now organized like this:
The project navigator shows the en.proj and fr.proj, but are the files really localized in folders on the file system? In XCode 4.2 the localized files will show there localization after the file name in parentheses. I do not see that in your example. Here is what my localized resources look like.
To make the XIB localized you need to put them into folders on the file system with the appropriate names. It is easiest to do this from the file inspector.
Don't know if this helps?

Resources