Wrong InfoPlist.strings file used by the app

I recently added a new language to my app and I have an issue regarding the localization.

Configuration:

I have the developmentRegion in "fr" and setup 2 localizations: "French: Development language" and "Danish" The goal is to have the application in Danish language if the preferred language is Danish and French otherwise.

Issue:

If French or Danish appear in my preferred languages, I have no problem. But if neither French nor Danish was set as preferred language (like only English), I have the app translation in French as expected but all strings regarding app permission like "NSLocationWhenInUseUsageDescription" in system modal alert are in Danish.

Is like the localizable.strings file used is in the "fr.lproj" and the InfoPlist.strings is the "da.lproj"

debug

I verify I have all the strings files at the right repository. I have:

fr.lproj
-- Localizable.strings
-- InfoPlist.strings
da.lproj
-- Localizable.strings
-- InfoPlist.strings

I verify the file architecture in the .app file: find ***.app -name "*.strings"

***.app/fr.lproj/InfoPlist.strings
***.app/da.lproj/InfoPlist.strings
***.app/fr.lproj/Localizable.strings
***.app/da.lproj/Localizable.strings

Finally I print the Bundle.main.localizedInfoDictionary and I have values of the French file but the application show the Danish ones

Thanks for the help.

Replies

Could you show what you get in the file list ?

Should be like this:

I have a sample project where I reproduce easily this issue:

Localizable.strings
French file: "localizable_file" = "French";
Danish file: "localizable_file" = "Danish";

and

InfoPlist.strings
French file: "NSLocationWhenInUseUsageDescription" = "French location when in use usage"; 
Danish file: "NSLocationWhenInUseUsageDescription" = "Danish location when in use usage";

I show "French" in a label and "Danish location when in use usage" when I request the location permission.

I also tried to add base.lproj with both Localizable.strings & InfoPlist.strings and the problem persist. I also remove Danish language and add Catalan, Italian, Finnish... languages and no problems. Then I re-add Danish and surprise it does not work anymore.

I have same issue in Xcode15

The result was the same whether I checked the item "use base internationalization" or not.

If you set your device to English, the app name will be in Chinese and the others will be in Japanese. This is strange.

Solution Using Xcode15's String catalog If you create InfoPlist.xcstrings, the Default language settings will work properly.