Entity Change Default Language

Entity Change Default Language changes the default (original) language of translatable content, for example a node created in English that should be Spanish. The translation in the new language becomes the original one, and the old default language can stay as a translation.

Key features

  • A "Change default language" operation on content, with a confirmation form.
  • Works on every translatable content entity type: nodes, taxonomy terms, blocks, users and more.
  • Creates the new default translation when it is missing, so content with a single translation can be changed too.
  • Chooses which translations to keep and whether the old default language stays.
  • Paragraphs follow their host, and other reference fields follow on request.
  • The whole change runs in one database transaction, rolled back on failure.
  • Drush commands for one entity or a whole entity type, through a queue.

How it works

  • User interface: users with the "Change the default language of content entities" permission, who may also edit the content, get a "Change default language" operation.
  • Settings: at Configuration > Regional and language > Entity Change Default Language, exclude some entity types or allow only some. By default every translatable content entity type is enabled.
  • Drush: drush ecdl:cdl node 1 es changes one entity now, and drush ecdl:dlet node es queues every entity of a type.
  • Service: code calls \Drupal::service('entity_change_default_language')->update($entity, 'es').
  • Queue: cron processes the queued items, tries a failed one up to 5 times in all and logs every skipped one.

Requirements

  • Drupal 11.4 or later, or Drupal 12, and PHP 8.3 or later.
  • Language and Content Translation, both in core.
  • Drush 13 or later, only for the Drush commands.

Sites on Drupal 9, 10 or 11.0 to 11.3 can use the 1.0.x branch.

Documentation

Read the user documentation, with screenshots of every step, and the README.

Looking for Drupal support?

Premium support from the project maintainers
Get in touch with us
Supporting organizations: 

Project information

Releases