Drupal 8 multilingual tidbits 3: simple language setup, optional English

Gábor Hojtsy 3 min read

Up to date as of October 16th, 2015.

As I've outlined in the previous post Drupal 8 core now has 4 core modules to deal with language support. This tidbit will be about the simple language setup features provided by Language module, which is the base for every other language feature.

Image

Language module provides a simple language overview screen. You can reorder existing languages, remove languages (except the site default language, which on the screenshot is English) and add new languages. It is not anymore possible to have enabled and disabled languages on your site. This feature resulted in a confusing mess where some places and permission combinations allowed for the use of disabled languages and it was used as a means to stage certain new content. Just use proven content staging techniques (or unpublished posts) for new language content.

One really great news is that the removal feature applies to English even (if it is not set as the default language)! In prior Drupal versions, you can disable English but you cannot remove it ever from your website, because the built-in interface relied on it. Now that restriction is lifted and you can just remove English. Your website interface will still fall back on the built-in English text (will not disappear), but we don't need a configured language entry to be able to do that. We think that many (probably most) foreign language single language sites will not need English configured at all, so if you install in a foreign language, we don't even configure English for you.

Image

Editing a language is now limited to the name and the direction of the language only. All the details related to how the system figures out which language to use (paths and domains for example) are unified under negotiation and detection. See that in the next tidbit!

Issues to work on

  • Once you configure a language, it will be available across everything in Drupal; content, configuration translation, etc. It would be great to have a system where some languages are not exposed in all environments. See https://drupal.org/node/1314250 for a discussion on such a system. Does not seem very likely for core unfortunately at this point. May need to be a contrib module that does massive form altering at different places based on configuration.
  • DONE! Changing the default language was moved out of this screen in https://drupal.org/node/1803638 but not everyone who used the system since then agreed this was a clear improvement. We may need to revisit this change and possibly roll it back based on further reviews and changes since then in core with language assignment. See https://www.drupal.org/node/2153937
  • DONE! Drupal 8 has a great new Tour module which can be used to write user guides for certain features. There is a whole set of tours proposed for multilingual features. The language pages are covered in https://drupal.org/node/2017471
  • DONE! Languages still use a database table for configuration, so cannot be staged and pushed to live with the configuration system (or names translated with configuration translation). A great issue at http://drupal.org/node/1754246 explores moving them to the configuration system. This needs reviewers and support bringing it home. It is an important one to get complete coverage for language staging and deployment.
  • DONE! Even if you don't have English configured on your site, if you go edit configuration that has a language selector, it should not suddenly switch language. English needs to be present (and selected by default) in these cases. That is not currently the case. See and help with http://drupal.org/node/1936216 as you can.

Comments 14

Anonymous (not verified) Tue, 06/18/2013 - 13:42 Permalink

how about string translation in D8? In D7 and prior string translation is
based on default language, if default language is changed all translated
strings for a language are gone.

String based translation in Drupal 8 is limited to shipped software strings, which are always sourced (and already provided) in English. Even if you don't have English configured on your site, we can manage this fallback. All the other things that string translation was used in Drupal 7 (eg. configuration translation for views, menus, etc) is now handled in a separate configuration translation system that can handle varying source languages. Read more about this in future tidbits :)

We are running a site with default language 'da' but want all our config in 'en' with a translations/da folder for translated config. Whenever a module is installed most of the active config has its language set to 'da'. Will this setup only work with an english default language, or is something else causing all active config to be set to 'da' when new modules are installed.

estoyausente (not verified) Wed, 01/13/2016 - 15:03 Permalink

"Drupal 8 has a great new Tour module which can be used to write user guides for certain features. There is a whole set of tours proposed for multilingual features. The language pages are covered in https://drupal.org/node/2017471 "

it is already fixed ;-)

CathyRoberson (not verified) Fri, 05/20/2016 - 09:03 Permalink

Drupal 8 is a massive undertaking. In my drupal 8 website is ok, but the language switcher block is missing. What could be the problem?

Mike Zak (not verified) Thu, 07/28/2016 - 17:06 Permalink

Hello there!!

Is it a good practice to disable all multilingual modules in Drupal 8 if you don't have a multilingual Drupal site? Or you have to keep enabled at least the Language module?

Thanks !!

Flo (not verified) Thu, 07/06/2017 - 15:42 Permalink

Hello,

I'm sorry if this question has been asked before, but it seems I'm unable to find an answer.

I'm handling a site in three different languages. English is the default language for the back end. When translating a content type from the back end and choosing another language (French or German), the interface language changes and sets itself in the language I chose to translate my content to. Is it clear?

My goal is to keep the English as my default language for all back end interfaces, especially when translating a content. Is it possible? If yes, how?

Thank you.

Sinan (not verified) Mon, 09/11/2017 - 15:02 Permalink

If we have a monolingual site and if it is not English, what is the best way to achieve that performance-wise? It is possible to add a second language, set it as default and make translations but will it be a performance issue?