Base internationalisation with Xcode 10
Asked Answered
D

2

18

My project declares two languages: English as development and French as additional. Also it has Use Base Internationalization ticked.

When I localise a Strings file in Xcode 9, I normally move the content to French, then tick Base in Localization list. This gives two copies of the new Strings file one in Base.lproj (containing English text), another in fr.lproj, so English will be used for a language other than French.

With Xcode 10, the Localization doesn't list Base, so I can't see a way to use Base.lproj other than doing localisation in Xcode 9 and then revert to Xcode 10 with Base file already created.

Is that a bug, or this is how it is meant to be?


Update 20Sep18.

Now there is an official release of XCode 10 and the issue persists even though Use Base Internationalization flag is still there. If this is not a bug, can someone explain what is going on? There should be an Apple documentation to discuss that.

BTW, a storyboard or a nib still list Base when localised. Only a Strings file appears to have the issue.

Davisdavison answered 8/8, 2018 at 9:0 Comment(4)
I had similar problem, I had some xib's localized: base(on EN), EN and JP. And when compiling using Xcode 10 it ignored the EN and JP, it just used the base one. My solution was getting ride of the base one. What I dont know is what languaje the system will use now that there is no base. I tried on spanish and it took EN but I dont know why that one and not JP...Abigail
rgkobashi. That's strange. As far as I can see, Xcode 10 still supports 'Base' for xib and 'storyboard'. Otherwise you would be unable to keep the layout, since all non-base files are not 'xib', but just 'strings'. As about your question, I guess it will the the first (default) language specified in your project. Well you can easily check that by setting a non-implemented language in the emulator, or in scheme.Davisdavison
Xcode 10.0 broke localisation with storyboard files. I've filed a bug report with apple.Leong
@Davisdavison the thing is that on my configuration (base, EN, and JP) everything was .xib and no .strings so Xcode was using those layouts. And thanks for answering my question, that makes sense...Abigail
O
3

This happens because iOS doesn't only looks for the current system language. It looks for the first supported language in the list of preferred languages.

But when you choose language in system preferences, iOS automatically adds this language to the list of preferred languages (Settings -- General -- Language & Region -- "Preferred language order" section).

Thus, when you change language to unsupported language, the app selected the second language in the "Preferred language order" list.

So, the "Base.lproj" file doesn't work.

Perhaps for this reason, Apple removed "Base.lproj" from Xcode 10.

Oldster answered 18/9, 2018 at 13:28 Comment(1)
Firstly, "Use Base Internationalization" tick is still present with XCode 10. This suggests that Base internationalisation support hasn't been removed in XCode 10. Secondly, I edited the scheme by setting the language to Spanish, which is not listed as my preferred language. Guess what: the app uses English (from Base.lproj), not the second language, as you suggest (if I understand you correctly).Davisdavison
M
0

Faced the same issue myself when trying to localize my Flutter app's name on iOS home screen with Xcode 14.2. I needed to localize Bundle display name in Info.plist to various languages and have English as the default language to show if the user selects an unsupported language.

Initially the language localizations worked OK except that I cannot have a Base version of InfoPlist.strings because the option is not showing up in Xcode, while the other two storyboard files do have Base versions.

I headed to Main.storyboard and noticed that while the Base file is called Main.storyboard, localization files are called Main.strings instead. It gives an idea that somehow the Base file is differrent from localization files. So I finally figured that the original Info.plist will serve as the Base version, thus be in the default language, in this case English.

Malebranche answered 5/1, 2023 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.