Problem/Motivation

Recently, on a new site, I've switched the default language from English to a different language. I've exported the config and reinstalled the site. I've discovered that English language has vanished. Lately I've discovered that I need to add keep_english: true in my custom profile. Took me 1 hour to find this.

We need somehow to inform the site builder about this before they lose their mind.

Steps to reproduce

See above.

Proposed resolution

If the profile doesn't have keep_english on, show a warning after the default language is switched from English that instructs the site builder what they need to do.

Nice to have: An intermediary screen/form where the user is presented with the warning and is able to cancel until the issue is fixed.

Further reflection: Maybe keep_english is not a profile thing but a site config?

Remaining tasks

Clarify the warning message.

User interface changes

To be clarified.

API changes

None.

Data model changes

None.

Release notes snippet

To be clarified.

Issue fork drupal-3545306

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

claudiu.cristea created an issue. See original summary.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

rob c’s picture

Something like this?

I got the form working, but could use some guidance on additional text we need to display. (this will set your site language to x, update your config language when you install a module, etc)

Creating a UpdateLanguageSubscriber now, so you can't access the form if (for example) 'en' already is the default language or if you only have one language. And this needs tests (+ still need to update existing test). Then i'll attempt my first merge request / contribution in a decade or something, so gonna be fun.

And after all this we can update #3337864: Configuration language is not adjusted after changing the site default language and add some bits in this new form (or something else).

rob c’s picture

StatusFileSize
new51.52 KB

Apologies, the correct screenshot:

ressa’s picture

Thanks for working on this @rob c, perhaps we could also consider linking to the documentation page https://www.drupal.org/docs/administering-a-drupal-site/multilingual-gui... which itself links to relevant issues? (under "4. Set a default language.")

rob c’s picture

StatusFileSize
new63.16 KB

Hey your all welcome. This one was (after reviewing a ton of issues) really bugging me, so i figured let's have a go at it. ( #3150540: Configuration langcode is forced to site default language etc. a long long list ).

I've added the link like you suggested and i have pushed the current code. Still needs more text i think (describing the impact of this change if 'keep_english' is not set). Out of time this week, but this needs more work before a full review, and still needs additional tests (a test profile with keep_english: true, test for the EventSubscriber - or go another route, etc) / need to rework the EventSubscriber, but at least we have something to look at now. Back at it next monday (maybe this weekend).

v3

ressa’s picture

Thank you so much for a fast answer, and already adding the link, I think that looks great.

Multilingual support in Drupal works really well overall, but there are still edge cases and things that can be improved -- like weird things happening (as in this issue), or cumbersome processes like translating config, which I ran into myself last year (see #3549927: Streamline translation of Views block titles, custom menu titles, etc.: Allow Interface Translation). So all improvements are very welcome :)