Problem/Motivation

The title of this issue is a bit misleading, because I am not suggesting we remove the ability to change the default language of a farmOS instance. I am specifically referring to default_langcode in the system.site configuration.

There are two related critical Drupal core bugs that wreak havoc on translations when the default_langcode of a site is changed from English:

However, there is a simple workaround described in this comment: https://www.drupal.org/project/drupal/issues/2806009#comment-14009513

I've been using this workaround for the past 3 years without any problems. I advise it for all single language sites. Default language: English, All lanuage detections off, Selected language (default detection): Dutch.

"Selected language (default detection)" refers to one of the language "Detection methods" that can be enabled in /admin/config/regional/language/detection/ (when the language module is enabled). The configuration for that detection method (available at /admin/config/regional/language/detection/selected) allows you to specify any of the installed languages (as well as "Site's default language", which is the default).

So, the workaround is to leave "English" as the site's default language, use that detection method as a fallback, and configure it to one of the installed languages (instead of leaving it set to "Site's default language"). This essentially has the same effect as changing the site's default language, without actually changing it, and therefore avoiding the nasty core issues.

Proposed resolution

I propose we add some enforcement to ensure that the site's default language cannot be changed from English. And at the same time, perhaps add our own config form at /farm/settings/language for easily changing the "Selected language" detection method config.

Remaining tasks

TBD

User interface changes

Disable the ability to change the default language.

API changes

None.

Data model changes

None.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Lots of relevant discussion/debugging in this thread: https://github.com/farmOS/farmOS/issues/472

m.stenta’s picture

Status: Active » Needs review

FYI this is done in my `2.x-l10n` PR: https://github.com/farmOS/farmOS/pull/475

  • m.stenta committed 8844554 on 2.x
    Issue #3257430: Do not allow the default language to be changed from...
m.stenta’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.