Why is Xcode ignoring a localized InfoPlist.strings file?

199 Views Asked by At

I'm localizing my app to support Hungarian and everything is being translated correctly except for the app name. I've created two .strings files for Info.plist:

en.proj/InfoPlist.strings:

"CFBundleName" = "English test";

"CFBundleDisplayName" = "English test";

and hu.proj/InfoPlist.strings:

"CFBundleName" = "Az Én 1RM Kalk";

"CFBundleDisplayName" = "Az Én 1RM Kalk";

My other localized strings files are in the same folders as the InfoPlist.strings files. However, when I run my app with the App Language and App Region set to Hungarian and Hungary, all the text in my app is correctly translated to Hungarian, but the app name is still "English test".

I've tried everything I can find on other SO posts and I'm out of ideas.

Why would it use the English file, but not the Hungarian file?

Update:

At runtime, p Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String ?? "" returns the correct value of "Az Én 1RM Kalk" from hu.proj/InfoPlist.strings but it's still displaying the "English test" value from en.proj/InfoPlist.strings in the simulator.

0

There are 0 best solutions below