1
votes

I'd like to localize my application with the following pattern:

  • Localize all strings (say English, French and German (don't mention the war!))
  • Localize some images in some languages (say just English and French)

I can localize the strings without issue. My problem is that when I add the German strings, the other resources that are localized into English and French attempt to find a German version. I don't want to provide a German version (trying to avoid too many superfluous images as they bulk up the size of the app).

Can anyone suggest a way of telling the application not to bother looking for a German version of the images.

My problem isn't adding languages, it's ignoring them under certain conditions. I don't want to include a German version of "a.png", but I do want to include a French version of "a.png". When the user's language is set to German, I'd like it to select the default language which is English.

3
explained more: My problem isn't adding languages, it's ignoring them under certain conditions. I don't want to include a German version of "a.png", but I do want to include a French version of the same file. When the user's language is set to German, I'd like it to select the default language which is English.zaph

3 Answers

1
votes

Having had the same issue I want to follow up on this as the suggested resolution did not work exactly as quoted.

My setup is 3 localized languages, de, en, fr. The .lproj folders Xcode created are thus named

en.lproj
de.lproj
fr.lproj

I have a graphical button with "start" on it that needs localization from english to french but not to german (as it is the same word).

My "Localization native development region" was set to "English", which must have been the default (maybe a while back, the project has been a wip for quite a while).

The button did not show up on german devices. Switching to "EN" or any of the suggestions from Xcode ("United Kingdom", "United States of America") did not resolve the issue.

The solution was simpel. The string in the "Localization native development region" needs to exactly match the (native language).lproj string. So setting it to "en" it finally resolved the issue.

Hope this helps whoever stumbles upon this question.

0
votes

iOS (and Mac OS) should always fall back to the app's default language. If you don't include the image.png in the de.lproj resources folder, the app should use the en.lproj/image.png file in its place.

Look for key: "Localization native development region" in the Target > Info pane of Xcode. Make sure that says EN.

-1
votes

I don't have that much experience but as far as I'm concerned, your program should just look for the german image, find nothing and then try to load the english image instead.