The multi-lingual multi-domain problem
Background
- In a multi-lingual install, the schema is changed to add columns for all translatable fields.
- One column is added per language.
- The list of languages is stored in
civicrm_domain.locales
- For unknown historical reasons,
locales
was only populated for domain 1. It was thus treated as a "master domain" although there doesn't appear to be any documentation of this. - So in a multi-domain setup, domain 2 would inherit its language settings from domain 1.
Problem
- Having
civicrm_domain.locales
be populated for domain 1 butnull
for domain 2+ is confusing to devs and leads to crashes when relying on that value from the current domain. - Bug reported in #1800 (closed)
Proposed solution
- Ensure all domains have
locales
populated when enabling multilingual: https://github.com/civicrm/civicrm-core/pull/17733 - An upgrade script to ensure
locales
is the same for all domains: https://github.com/civicrm/civicrm-core/pull/17738
Related issues/PRs
- https://github.com/civicrm/civicrm-core/pull/17646
- https://github.com/civicrm/civicrm-core/pull/17733
- https://github.com/civicrm/civicrm-core/pull/17650
Tough questions
Once the relatively easy stuff is solved by merging the fixes above, we might consider:
- What happens if the admin desires one domain to be single-language and another to be multi?
- When reverting from multi-lingual back to single, are all domains affected?
- What if different multi-lingual domains want to support different languages?
- Is all of the above completely unreasonable and multilingual settings should just always be the same across domains?
Edited by colemanw