Problem/Motivation
There is a case in which the value of some translatable config text in some language is the same as in the default language. For example, when your website's name is a proper noun.
In that case, Drupal does not save any config translation for that language (https://git.drupalcode.org/project/drupal/-/commit/cc7cae5fe14ac9abe62e8...).
It's nice because if for example you made a typo in the website's name, it will be fixed in the other language if you simply fix it in the default language (no duplicate data).
Since #2488302, you even get a special message when trying to translate with the default value.
BUT! When you use config splits in addition to config translation, this can cause an unexpected behavior.
Steps to reproduce
Let's say that your default site name (in your sync/ folder) is set to "My cool website", translated in french (sync/language/fr) with "Mon super site web".
In a split (for example on one website in some kind of multisite installation where you share most of the config between websites), you override the site name to "John Doe" (through Drupal UI). Then translate in french to "John Doe" (same value). It will work as expected: "John Doe" is shown in both languages.
When you export your split, you'll get a config override file for the default language in mysplit/ (because in DB for default language you have "John Doe" which is not the same as "My cool website").
But you won't* get any config override file for french (in mysplit/language/fr), although "John Doe" is not the same as "Mon super site web".
Why? Because, as explained above, there is no translation saved when a text is unchanged. So that in DB, there is no config translation to french for the website's name. And thus, as Config split loops on existing config entities in the language collection when trying to detect overrides at export, it does not detect the override for french.
The consequence is that, when you import again, you still see "John Doe" in english mode, but you see "Mon super site web" in french. The override is gone.
*I only tested in partial mode but I guess it's the same in other modes.
Proposed resolution
I'm currently trying to find a fix for that. It's clear for me that in such a case, we should get some sort of override in mysplit/language/fr. So that the files state is different in the case you want "the same as default language" and the case you want "the same as default config" (which could also be a legitimate use case).
I see two ways to have this:
- on export, find a way to get a config override file very similar to the one you'd get if you had changed the value on translation,
- or, on export, detect the fact that a config which exists in default config (french translation) does not exist anymore in splitted DB, and generate some file indicating a "config removal" in mysplit/language/fr.
The last one seems harder to me, but I may be wrong. On the other side, the first one seems less "clean", as it will create a config translation on next import.
Remaining tasks
Implement some way to fix the bug.
User interface changes
None.
API changes
None?
Data model changes
None?