How do I use "Base" language & "Development Language"?

In the "Info" tab of my project (Xcode 12.5, Swift 5) there are two languages in the "Localizations" list:
  1. Base (2 Files Localized)

  2. English - Development Language (0 Files Localized)

I can add new languages but it won't let me remove either of the above.

First of all, what are "base" and "development language" used for? Am I right in my assumption that the former is the language that's used by default if the user's phone is set to any language that isn't English and the latter is the language that is always used in Xcode's simulators (and if the user's phone is set to English)?

In the File Inspector for "Main.storyboard" and
"LaunchScreen.storyboard" "Base" is ticked and "English" isn't. What's the point of that? Do these specific lists show what languages that specific storyboard supports?

Let's say I want to use e.g. French both as base and development language (according to my assumptions) and English if the user's phone isn't set to French. How do I accomplish that?

Replies

First of all, what are "base" and "development language" used for?

With regards Base localisation, check out Using Base Internationalization in the Internationalization and Localization Guide.

The development language is used to guide the fallback process. My go-to doc for that is QA1828 How iOS Determines the Language For Your App.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
@eskimo
Thanks for the links!

Sorry, I've got a couple more questions:
So "Development Language" is the language used when the app doesn't support a language the user picked in his settings (as you said, the "fallback"), okay.
If the "Base" language is active, the link says that they should be the same but what if the app is meant to be used in e.g. French but also supports English for everyone else? If a user's settings only list English, the app would be displayed in English but wouldn't that mean that the base language (French) and development language (English) are different? In my app, by editing the labels,... in the Interface Builder, I've apparently been writing everything into "Base" (2 files), while "English - Development Language" hasn't got any files connected to it.
The second link also mentions specific regions and that if a user specificies e.g. Canadian French (fr_ca), which isn't supported by the app, it'll try to load regular French (fr) instead. But what if the app only supports "fr_ca" and the user uses Swiss French (fr_ch), does that still work (and load "fr_ca") because the app recognizes that they are based on the same language?

Tbh, I'm still not sure how the "Base Localization" works exactly. In the images on the first website you linked (and in a lot of older screenshots I found on e.g. Stackexchange) there's always only "English - Development Language" in the list (even with the box below ticked) and, according to that link, base localization adds the files to it. But in my Xcode 12.5 project (and also older test ones) there are 2 different list items: 1. Base and 2. English. I can only get rid of "Base" by unticking the box and then it asks me if I want to move everything into "English", which I already tried yesterday but it gave me an UTF-16 error and didn't do anything.

In what case scenario do you actually want to tick the "Base Internationalization" box in Xcode?
If you’re using Interface Builder then you should use Base localisation. Otherwise you end up having to replicate each nib file (well, each .xib or .storyboard) for each language, which is a maintenance headache. With Base localisation you have one nib file (for the development language) in the Base and then all the other localisations just have a .strings file that overrides the strings in that nib.

If you support English and French localisations and you want folks who use a different language to fall back to English, use English as the development language. I believe that other French variants will fall back to French but, honestly, this isn’t something I’ve dug into recently.

I recommend that you prototype all of this in a new test project that you create from one of the built-in templates. Once you’ve got it working there, you can then figure out how to replicate that setup in your main app.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
@eskimo
Sorry for the delayed reply. What I've done so far:
  1. I added the second language (French), which added a "strings" file for French for all storyboards.

  2. In the File Inspector of the storyboard I ticked "English", which added a "strings" file for English for that specific storyboard.

  3. Afterwards I set "developmentRegion = fr;" in the "project.pbxproj" file (set French as development language).

This works:
  • If the simulator in Xcode is set to French, the app is French.

  • If the simulator is set to English, the app uses the English translation.

  • If the simulator is set to a different language, e.g. Italian, the app uses French.

The rest of the simulated iPhone SE2 was still set to English but that's probably because I only edited the "App Language" in the scheme and didn't set the actual language in the settings.

I'm not sure what to do with the "Base" language now. If I change an e.g. button text directly in storyboard, the "strings" files aren't affected, so the changes aren't shown in a simulator of course. If I untick "French", it'll probably be the same as with English before again: I'll only be able to edit the French text directly in storyboard. Unticking "Base" (and moving its contents to "French") didn't work last time around, so not sure what that does. Is there a way to keep the French "strings" files and make it edit them automatically, whenever I edit something in storyboard?
Another question just came up:

This link says that you can change the language that's displayed in the Interface Builder by choosing the language in the lower right of the Assistant Editor (infos written in 2015). This button doesn't exist in Xcode 12.5, no matter if the Assistant Editor is active or not. How do I change the language for it with the latest Xcode version?