In Depth Guide : Acquia Certified Developer Drupal
  • IN DEPTH GUIDE: ACQUIA CERTIFIED DEVELOPER - DRUPAL 8 EXAM
  • Test Format
  • Domain 1.0: Fundamental Web Development Concepts
    • 1.1 Demonstrate knowledge of HTML and CSS
    • 1.2 Identify Javascript and jQuery programming concepts
    • 1.3 Demonstrate the use of Git for version control
  • Domain 2.0: Site Building
    • 2.1 Demonstrate ability to create and configure Content Types with appropriate fields and field sett
    • 2.2 Demonstrate ability to configure Display Modes for building custom form and view modes for core
    • 2.3 Demonstrate ability to create and use Taxonomy vocabularies and terms for classification and org
    • 2.4 Demonstrate ability to configure Block types, manage Blocks library and configure Block layouts
    • 2.5 Demonstrate ability to build main and alternative navigation systems by using Menus
    • 2.6 Demonstrate ability to create and configure Views for building content list pages, blocks and fe
    • 2.7 Demonstrate ability to use Configuration Management capabilities for exporting site configuratio
    • 2.8 Demonstrate ability to build multilingual websites using core multilingual capabilities
    • 2.9 Demonstrate ability to build RESTful web application using core Web Services capabilities
  • Domain 3.0: Front end development (theming)
    • 3.1 Given a scenario, demonstrate ability to create a custom theme or sub theme.
    • 3.2 Demonstrate knowledge of theming concepts
    • 3.3 Demonstrate ability to use Twig syntax
    • 3.4 Demonstrate ability to build or override Twig templates for defining layout content
    • 3.5 Demonstrate ability to write template pre-process functions for overriding custom output
  • Domain 4.0: Back end development (coding)
    • 4.1 Demonstrate ability to write code using core and Object Oriented PHP
    • 4.2 Demonstrate ability to develop Custom Modules using Drupal API for extending Drupal functionalit
    • 4.3 Demonstrate ability to store and retrieve data using code
    • 4.4 Demonstrate ability to work with other essential APIs
    • 4.5 Demonstrate ability to write code using Drupal Coding Standards
    • 4.6 Demonstrate ability to analyze and resolve site performance issues arising from site configurati
    • 4.7 Demonstrate ability to analyze and resolve security issues arising from site configuration or cu
  • Other Resources
Powered by GitBook
On this page
  • Configure a default language on site install
  • There are four modules that make up the multilingual support as a part of Drupal 8 core.
  • Add a new language
  • Configure translatable entities
  • Translate a node
  • Twig Manipulation for multi-language
  • Other Resources
  1. Domain 2.0: Site Building

2.8 Demonstrate ability to build multilingual websites using core multilingual capabilities

Previous2.7 Demonstrate ability to use Configuration Management capabilities for exporting site configuratioNext2.9 Demonstrate ability to build RESTful web application using core Web Services capabilities

Last updated 7 years ago

Review how to start a site with a new default language. Review how to configure multilingual entities. Review Twig multilingual manipulation.

Configure a default language on site install

To setup a new site default language on site install chose the language on /core/install.php

Or from the terminal use drush.

drush si --locale=es

Read to find out more about drush site install commands and arguments.

An example of a basic multilingual site install with standard installation.

There are four modules that make up the multilingual support as a part of Drupal 8 core.

Once logged in, navigate to admin/modules and scroll till you see the module group, Multilingual.

Add a new language

To to a site, navigate to /admin/config/regional/language. In the screenshot below Spanish was added as a new supported language. Drupal now supports over 94 languages.

Detection and selection

Configure translatable entities

Translate a node

Twig Manipulation for multi-language

Twig comes with filters to translate the value inside of the twig templates.

There is the `

twig tag as well as the |t` filter. Strings are only translated once you visit a page using that language.

you can see by default the author_name variable is already configured to be translatable. ```

full example of `core/themes/stable/templates/content/node.html.twig`:



```twig
{#
/**
 * @file
 * Theme override to display a node.
 *
 * Available variables: ----

#}
<article{{ attributes }}>

  {{ title_prefix }}
  {% if not page %}
    <h2{{ title_attributes }}>
      <a href="{{ url }}" rel="bookmark">{{ label }}</a>
    </h2>
  {% endif %}
  {{ title_suffix }}

  {% if display_submitted %}
    <footer>
      {{ author_picture }}
      <div{{ author_attributes }}>
        {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
        {{ metadata }}
      </div>
    </footer>
  {% endif %}

  <div{{ content_attributes }}>
    {{ content }}
  </div>

</article>

Other Resources

Define how to decide which language is used to display page elements (primarily text provided by modules, such as field labels and help text). The order in which detection method is used depends on the ordering of each detection method. The URL path is high on the default setup for commonly separated nodes that have the language in the URL path, for example, example.com/es/node1. Another use is language based on .

Navigate to /admin/config/regional/content-language to choose which entities to translate. Fields can also be enabled or disabled to be translated depending on site's preferences.

Once the content type "article" was configured for translation a new tab appears in the local actions menu.

Click to add a new translation.

Although this node is translated, someone still needs to translate the content.

If we look at the core/themes/stable/templates/content/node.html.twig

core example
Configure Multilingual Sites on Drupal.org
OS Training 5 Steps to Build a Drupal 8 Multi-lingual Site
drushcommands.com
add a new language
browser detection