Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different localization depends on a target

I have few targets under one project in Xcode. In project setting I see localizations like this: enter image description here

But what I want to do is to have one of the target localized in German and Polish and the second one only German. These target products are separate ipa files, but I wonder if I left Polish empty for the second target does user in Poland see German texts or empty strings? Also if languages are there will it show all the languages available in appsore here?

enter image description here

like image 374
Jakub Avatar asked Jul 18 '16 15:07

Jakub


1 Answers

But what I want to do is to have one of the target localized in German and Polish and second one only German.

Unfortunately, since localization is file and project based, this is not possible without major changes to your code base. Depending on your code and resource files (storyboards, .strings files, etc) it may be possible to have two projects with different localizations that use a common shared framework with the majority of your app code in the framework. However, I'd imagine this is too big of a change in your project.

Also, it might be more reasonable to remove the localization after the IPA is generated. By removing the Polish localized resources and folders, you'd essentially be getting the desired results while the project configuration would not need to change.

This target products are separate ipa files, but I wonder if i left Polish empty for second target does user in Poland will see German texts or empty strings?

If you leave the Polish localized files empty, then you'd see two results in your app:

  1. For storyboard localization, you'd see empty strings (i.e. UILabels, UITextFields, etc. would by empty)
  2. For a string referenced by NSLocalizedString("key", "comment"), you'd see comment.

If you remove the Polish localized files completely, then the app will show whichever localization is your base localization.

Also if language are there it will show all the languages available in appsore here?

The App Store picks up on localizations based on what is in a generated build, not by project configuration. If you have Polish localization files in the build, then the App Store will see those and display that you're app supports that localization.

like image 163
Jake Avatar answered Sep 22 '22 05:09

Jake