It took a while but on a website with multiple domains the following bug appeared:

  • website with domain A & B: 'source' language: English
  • domain A: language_default: English, interface language (with lang-switcher) English
  • domain B: language_default: -other- (Dutch), interface language (with lang-switcher) Dutch

We translated a lot of interface with i18n: things like fields, taxonomy-terms, etc from English to other Languages.

On domain B, where the default_language was changed to Dutch, not any some of the i18n and entity_translation translations did not work.

Which ones:
- field labels (i18n_field)
- content-titles (entity-translation).

The reason seems to be that:
- If the interface language is the same / equal to the default language, the 'translation' process is not triggered. So nothing happens and the source input is shown (in our case English).

To me this is quite a Major issue, because I think the imagined purpose of this setting (domain_default_language) is that you want to set a language per domain and kinda disable all other languages.

I am not totally sure if this is the correct analysis but for sure switching default_language per domain gave us very unsuspected results.

Comments

vasike’s picture

I think i got into a similar issue
But i won't say it's about the default language, but a "conflict" between Domain languages and Entities fields languages.
If the Domain enabled languages and Fields languages don't fit.
And in some scenarios we need to share content on multiple domains with different languages enabled.
And this is where it happens.

vasike’s picture

Status: Active » Needs review
StatusFileSize
new684 bytes

And here is patch that implements hook_field_available_languages_alter()
And put back the all the languages of Drupal for the entities fields.

P.S. There, i had to reset the language_list, not sure if you break something for the "main" functionality of this module.
If yes, maybe we should "clone" a fresh language_list() function within this module to get the all available languages.

P.S.2
However, there could be more issues about this, when using some Entity Cache.
For this, maybe an extra module is needed
I found a a sandbox for Domain Cache : needs patch, check the project issues

vasike’s picture

StatusFileSize
new1.17 KB

It seems my worries about the first patch were founded.

Here is a new patch that:
- Reset the language_list temporary, just to alter the field languages, put back the language_list after
- Use drupal static for this hook, to make sure this reset is made only once.