Skip to content

Drupal Multilingual — Configuration, Content and Interface Translation

DodaTech Updated 2026-06-27 9 min read

In this tutorial, you'll learn how to build multilingual Drupal sites — from enabling languages and configuring content translation to translating interface strings, setting up language switchers, and optimizing multilingual SEO with hreflang tags.

What You'll Learn

  • Enabling multilingual modules and adding languages to Drupal
  • Configuring language detection methods (URL prefix, domain, browser)
  • Translating content with the Content Translation module
  • Translating configuration like site name, taxonomy, and views
  • Translating the interface with Interface Translation
  • Setting up language switchers for multi-language navigation

Why It Matters

Half of the internet's users do not speak English as their first language. A multilingual site reaches wider audiences, improves user experience for non-English speakers, and ranks in multiple language-specific search engines. Drupal has the most robust multilingual capabilities of any major CMS — content, configuration, interface, and URL structure can all be translated. This is why governments, universities, and global enterprises choose Drupal for international sites.

Real-World Use

A European e-commerce company sells products in France, Germany, Italy, and Spain. Their Drupal site serves content in four languages. Each product page has translated title, description, and specifications. The checkout Process is translated to each language. URLs use language prefixes (/fr/produit, /de/produkt). Hreflang tags tell Google which language version to show in each country. The language switcher lets users toggle between versions. Content editors translate products using Drupal's translation UI without developer assistance.

Learning Path

flowchart LR
  A[SEO] --> B[Multilingual]
  B --> C[User Roles]
  C --> D[User Management]
  D --> E[Security Hardening]
  E --> F[Custom Modules]
  F --> G[Hooks]

Multilingual Modules

Drupal core ships with four multilingual modules:

Language — adds languages to the site and configures language detection.

Content Translation — enables translation of content entities (nodes, taxonomy, users, blocks).

Configuration Translation — translates configuration strings (site name, views, field labels).

Interface Translation — translates the Drupal UI and contributed module strings.

# Enable all multilingual modules:
drush en language content_translation config_translation locale

Adding Languages

  1. Go to Configuration > Regional and language > Languages
  2. Click "Add language"
  3. Select a language from the list or search
  4. Click "Add language"
# Add languages via Drush:
drush language-add fr
drush language-add de
drush language-add es
drush language-add it

# List installed languages:
drush language-info
# Output:
# en: English (default)
# fr: French
# de: German
# es: Spanish

Language Detection

Drupal supports multiple methods to detect a user's language.

URL Prefix

The most common method. Each language has a URL prefix:

https://example.com/en/about
https://example.com/fr/a-propos
https://example.com/de/uber-uns

Configure at Configuration > Regional and language > Language detection and selection:

# URL prefix language detection configuration:
language_negotiation:
  enabled:
    language-url: 0
  method: language-url
  url:
    source: path_prefix
    prefixes:
      en: en
      fr: fr
      de: de
      es: es

Domain

Use separate domains per language:

# Domain-based language detection:
language_negotiation:
  url:
    source: domain
    domains:
      en: example.com
      fr: example.fr
      de: example.de

Session and Browser

Session detection uses a saved preference. Browser detection matches the browser's Accept-Language header.

# Multiple detection methods with fallback:
language_negotiation:
  enabled:
    language-url: 0
    language-session: 1
    language-browser: 2
    language-selected: 3

Configuring Content Translation

Enable per Content Type

  1. Go to Structure > Content types > Edit (e.g., Article)
  2. Click "Language settings"
  3. Check "Enable language and translation"
  4. Select the language visibility: "Current user's language" or "Administration pages only"
# Enable translation for Article content type via Drush:
drush config-set language.content_settings.node.article \
  language_alterable true
drush config-set language.content_settings.node.article \
  third_party_settings.content_translation.enabled true

Enable per Field

Fields on translatable entities can be marked as translatable or entity-level.

  1. Go to Structure > Content types > Article > Manage fields
  2. Click "Edit" on a field
  3. Under "Language settings," select "Enable translation" for translatable fields
# Field translation settings:
field.body:
  translatable: true
field.field_image:
  translatable: false  # Image shared across languages
field.field_tags:
  translatable: true

Translating Content

Once language and translation are enabled, nodes show a language selector and a "Translate" tab.

Adding a Translation

  1. Create or edit a node
  2. Set the language (e.g., English)
  3. Save the node
  4. Click the "Translate" tab
  5. Click "Add" next to the target language (e.g., French)
  6. Fill in the translated title and body
  7. Save

Translation Workflow

Each translation is a separate version of the node. The source language version and target language version are linked. Edits to the source do not automatically update translations. Translators must manually update translations when the source changes.

<?php
// Programmatically creating a translation:
$node = \Drupal\node\Entity\Node::load(123);
if ($node->hasTranslation('fr')) {
  $translation = $node->getTranslation('fr');
  $translation->setTitle('Bonjour le monde');
  $translation->save();
} else {
  $translation = $node->addTranslation('fr', [
    'title' => 'Bonjour le monde',
    'body' => 'Contenu traduit',
  ]);
  $translation->save();
}

Configuration Translation

Translate configuration strings like site name, taxonomy terms, view labels, and block titles.

  1. Go to Configuration > Regional and language > Configuration translation
  2. Browse the list of translatable configuration
  3. Click "Translate" next to an item
  4. Enter translations for each language
# Example: site name translation:
system.site:
  name:
    en: 'My Website'
    fr: 'Mon Site Web'
    de: 'Meine Webseite'

Translating Taxonomy Terms

  1. Go to Structure > Taxonomy > Edit vocabulary
  2. Enable translation for the vocabulary
  3. Edit a term and select its language
  4. Use the Translate tab to add translations
# Taxonomy term translation:
taxonomy_term:
  tid: 5
  name:
    en: 'Technology'
    fr: 'Technologie'
    de: 'Technologie'

Translating Views

  1. Go to Configuration > Regional and language > Configuration translation
  2. Find your view in the list
  3. Translate the view name, description, and field labels

Interface Translation

Interface translation covers all text strings from Drupal core and contributed modules.

Using the Locale Module

# Enable Interface Translation:
drush en locale
  1. Go to Configuration > Regional and language > Interface translation
  2. Click "Translate"
  3. Search for a string to translate
  4. Enter the translated value

Importing .po Files

# Import a .po file:
drush locale-import fr /path/to/fr.po

# Export translations to .po:
drush locale-export fr > /path/to/fr_export.po

Localization Update Module

Automatically downloads translations from the community translation server:

composer require drupal/l10n_update
drush en l10n_update
  1. Go to Configuration > Regional and language > Translation updates
  2. Configure update frequency
  3. Run updates to download community translations

Language Switcher

The language switcher block lets users switch between languages.

  1. Go to Structure > Block layout
  2. Place the "Language switcher" block in a region
  3. Configure which languages to show
# Language switcher block configuration:
language_switcher:
  region: header
  visibility:
    request_path: ''
  settings:
    display: 0  # 0 = links, 1 = select dropdown
    hide_if_single: true

Language Switcher in Menus

You can add language switcher links directly in menus:

  1. Edit a menu item
  2. Under "Language settings," select the language
  3. The same menu item path can exist in multiple languages

Language-Neutral Content

Some content should not be tied to a specific language. Set the language to "Language neutral" (und) for:

  • Content that is the same in all languages
  • Technical pages that are not translated
  • Global site elements
<?php
// Creating language-neutral content:
$node = \Drupal\node\Entity\Node::create([
  'type' => 'page',
  'title' => 'Site Terms of Use',
  'langcode' => 'und',  // Language neutral
]);
$node->save();

Multilingual Views

Views can filter by language:

  1. Create or edit a View
  2. Add a filter for "Content language"
  3. Set to "Current user's language" to show only relevant translations
# View filter for multilingual:
display:
  default:
    display_options:
      filters:
        langcode:
          id: langcode
          table: node_field_data
          field: langcode
          relationship: none
          group_type: group
          admin_label: ''
          operator: '='
          value:
            current: 'current'  # Current user's language

Multilingual SEO

Hreflang Tags

The Metatag module (covered in the SEO tutorial) generates hreflang tags:

# Metatag hreflang configuration:
hreflang:
  en: '[current-page:url:absolute]'
  fr: 'https://example.com/fr[node:alias]'
  de: 'https://example.com/de[node:alias]'

Language-Specific Sitemaps

The XML Sitemap module can generate language-specific entries:

# Sitemap with language variants:
xmlsitemap:
  languages:
    en: true
    fr: true
    de: true

Common Mistakes

  1. Not enabling translation on fields: Enabling content translation on a content type but forgetting to mark individual fields as translatable means translated nodes still show the original field values.

  2. Mixing language detection methods: Using URL prefix and browser detection together without proper fallback configuration can confuse users who get redirected unexpectedly.

  3. Not translating interface strings: Enabling languages but not translating the UI means French users see a mix of French and English admin text.

  4. Missing hreflang tags: Without hreflang tags, Google may show the wrong language version in search results for multilingual sites.

  5. Translating content that should be shared: Some fields (like images) should not be translated — they should be shared across languages. Marking every field as translatable creates unnecessary duplication.

Practice Questions

  1. What are the four multilingual modules in Drupal core, and what does each one do?

  2. How do you configure URL prefix-based language detection, and what would the URLs look like for a site with English, French, and German?

  3. What is the difference between configuration translation and interface translation? Give an example of each.

  4. Challenge: Plan a multilingual Drupal site for a company operating in the United States, Spain, and Japan. Define the languages, the language detection method (consider SEO), the content types that should be translatable, the fields that should be shared vs translated, the URL structure, and the hreflang Strategy. Describe how you would handle multilingual SEO including sitemaps.

FAQ

What multilingual modules does Drupal core include?

Drupal core includes Language, Content Translation, Configuration Translation, and Interface Translation. These modules collectively allow you to build fully multilingual sites with translated content, configuration, and user interface.

How do I add a language to Drupal?

Go to Configuration > Regional and language > Languages and click 'Add language.' Select from the list of available languages. You can also add languages via Drush with drush language-add [langcode].

How does content translation work in Drupal?

Content translation creates separate language versions of an entity. Each translation has its own title, body, and field values. Translations are linked together so you can switch between languages or manage all translations from one interface.

What is the difference between configuration translation and interface translation?

Configuration translation translates site settings like the site name, taxonomy terms, and view labels. Interface translation translates UI strings from Drupal core and contributed modules like 'Submit' or 'Read more.'

How do I set up a language switcher?

Go to Structure > Block layout and place the Language Switcher block in a region. Configure which languages appear in the switcher and whether to show as links or a dropdown.

Mini Project

Goal: Build a fully multilingual Drupal site.

  1. Enable Language, Content Translation, Configuration Translation, and Interface Translation modules
  2. Add two additional languages: French and German
  3. Configure URL prefix language detection (/fr, /de)
  4. Enable content translation for the Article content type
  5. Mark title and body as translatable, but keep the image field shared
  6. Create an Article in English and add French and German translations
  7. Translate the site name using Configuration Translation
  8. Enable the language switcher block in the header
  9. Add hreflang tags via Metatag configuration
  10. Test the site by switching between languages and verifying translated content

What's Next

Now that you understand multilingual Drupal, proceed to user roles and permissions to learn about access control. After that, explore user management for registration and profiles.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro