Problem/Motivation

Recipes don't handle languages seamlessly.

If you use a recipe to install Language on a site that doesn't already have it, you won't get any configurable languages by default (because recipes don't import any module's config entities except the stuff you explicitly specify).

If you do this in your recipe:

config:
  import:
    language: '*'

You'll get a configurable language for English. But what if your site is not in English and never has been?

You'd have to create the necessary language dynamically. You could probably do it with a config action, but that's awkward.

Proposed resolution

When a recipe is applied and it has installed Language, automatically create a configurable language for the site's default language, if no other languages (except for locked ones) exist.

This would make it seamless, and transparent to recipe authors that want to use multilingual features. We could implement this by having Language listen to RecipeAppliedEvent and checking $event->recipe->install->modules to determine if this recipe has installed Language.

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Drupal CMS will polyfill this, and it could be straightforwardly ported to core: https://git.drupalcode.org/project/drupal_cms/-/merge_requests/967

Tagging, therefore, as a Drupal CMS release target.

phenaproxima’s picture

Issue summary: View changes