2.8 Demonstrate ability to build multilingual websites using core multilingual capabilities
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
Or from the terminal use drush.
Read drushcommands.com to find out more about drush site install commands and arguments.
There are four modules that make up the multilingual support as a part of Drupal 8 core.
Add a new language
To add a new language 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.
If we look at the core example core/themes/stable/templates/content/node.html.twig
you can see by default the author_name variable is already configured to be translatable. ```
Other Resources
Last updated