recipe_config_translation
Recipe config translation automatically applies a recipe's
per-language config overrides whenever the recipe is applied; the
multilingual piece that Drupal recipes don't handle yet. Ship translated
config inside your recipe and it lands in the right language automatically,
on every install path.
Drupal recipes can install config, but they do not yet apply language overrides (translated config values), see core issue #3453331.
On a multilingual site that means recipe-provided content like the site name,
labels or settings stays untranslated after applying the recipe. This module
closes that gap with zero configuration.
Features
- Lets a recipe ship per-language config overrides as plain YAML files
({recipe}/config/language/{langcode}/{config_name}.yml),
each holding only the keys that differ. - Applies those overrides automatically on every
recipe-apply path: fresh install,drush recipe, Package
Manager and Project Browse, by reacting to core'sRecipeAppliedEvent. - Scoped to installed languages and idempotent: writing
only into the matchinglanguage.{langcode}override collection, so re-applying a recipe is always safe.
Post-Installation
Just enable the module and it works. Add your translations to the recipe, one file per overridden config object:
{recipe}/config/language/de/system.site.ymlname: 'Mein Name'
The next time that recipe is applied, the override is written into the German
config override collection. To backfill recipes that were already applied,
call the installer service once from an update hook:
Similar projects
Native support is tracked in core issue #3453331; until that lands, this module provides the behavior for recipe authors who need translated config today.
Credits
Initial development by drunomics GmbH.