Skip to content

Try it without the installer

Default Content Locale Extended does not need the Drupal CMS German Installer. In a fresh Drupal CMS, three commands are enough – in any language the templates have translations for. Currently that is German for all 23 free templates of the installer and French for Haven.

You need PHP, Composer and a database – the same environment as for Drupal CMS itself.

Step 1: Download Drupal CMS

composer create-project drupal/cms my-site
cd my-site

Step 2: Add the module and a template

composer require 'drupal/dcle:1.0.x-dev@dev' drupal/haven

Until the first stable release the module is available as a development version, hence 1.0.x-dev@dev. Add more templates the same way, e.g. drupal/byte or drupal/forma. Drupal CMS already ships Blank and Starter.

Step 3: Create the localized variants

vendor/bin/drush dcle:site-templates

For every template in the recipes/ folder, the command adds another recipe, e.g. recipes/haven_localized. It installs the module first – and, as soon as Canvas is in the project, its Canvas submodule too – and then the template itself. So the module is active before the template creates its content.

To cover only some templates, use vendor/bin/drush dcle:site-templates haven byte. If you add more templates later, simply run the command again.

Step 4: Install Drupal CMS

Open the site in your browser, choose your language, and in the step "Choose a site template" pick the variant "Haven (localized)". It is listed next to the normal Haven template.

Or on the command line, here in French (with your database details):

vendor/bin/drush site:install drupal_cms_installer --locale=fr -y \
  --db-url=mysql://user:password@localhost/database \
  installer_site_template_form.add_ons=haven_localized

Don't reload during installation

Don't reload the page in the browser while the installation is running. Drupal may otherwise cache an unfinished state, and the finished site shows a 500 error. vendor/bin/drush cr fixes that.

What you get

The template's content is translated: pages, menus, forms, image descriptions, Canvas pages including header and footer. That is how we tested the French translation of Haven: all 285 texts of the template arrive in French, and all published pages of the template work. Following exactly this guide with a fresh Drupal CMS in German gave 285 of 285 as well.

What stays English is what doesn't come from the template but from Drupal CMS itself or from a theme's code:

  • Texts of Drupal CMS such as the dashboard, the editorial workflow and admin views are translated on localize.drupal.org. How complete they are depends on your language's translation team. In the base recipe that all templates use, 223 texts were missing in French, 67 in German.
  • Texts a theme hard-codes are out of reach for any translation file, such as "Follow us on" on Haven's social media links.

What the German Installer does on top

For German installations, the Drupal CMS German Installer solves some problems that are not in the template content but in other projects. Without it they remain until those projects fix them:

What Without the German Installer Bug report
Installation screens partly English, e.g. the language dialog and the template descriptions –
Archimedes, Healthcare, Pulse, CareSphere, Convene cannot be installed, in any language #03
Summit is set up in the language "undefined" in any language but English, then its pages break #06
Convivial Gov switches the site to English during installation, the content stays English #15
"Follow us on …", the video notice, Convene's footer stay English #22, #24, #35

Why the work is split this way is explained in Dubbed film and cinema.

Pitfalls

The template is already installed. A template cannot be translated afterwards: the module translates content while it is created, not later. Nor can a template be added to a finished site; that fails on conflicts with the existing configuration. Reinstall the site and choose the localized variant.

Don't create a site-templates.php. Drupal CMS supports a file site-templates.php that defines the list of templates. It replaces the online list, though, and local recipes take precedence anyway. The localized variants show up in the installer without it.

Composer cannot find drupal/dcle. Mind the 1.0.x-dev@dev from step 2 as long as there is no stable release.

Your language is missing. If there is no translation of the template for your language yet, its content stays English. How to contribute one is explained in the guide for translators.