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

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.

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.

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

Anonymous's picture

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.

Gábor Hojtsy's picture

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 :)

martinyde's picture

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.

Gábor Hojtsy's picture

If you want English default configuration, you should set your site default to English. Drupal updates config to Danish because you set to primarily have the site in Danish, so it does what you asked for.

estoyausente's picture

"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 ;-)

Gábor Hojtsy's picture

Thanks, updated!

Add new comment