What we learned when building multilingual Drupal 8

Parent Feed: 

So we released our first multilingual site a couple of weeks ago. And it still runs just fine! Throughout the journey there was a couple of issues we had to deal with and I'm going to walk you through each of them and tell you how we tackled them.

Do your homework

Not every contrib module does (or will) have translation support. Make sure you do some research and see that the module you need has it. Look through the issue queue and even better, play around a bit with it.

We had our Oh shit! moment when we realized Paragraphs did not have proper translation support yet. Luckily, there was an active issue that provided a working patch. For the record this patch is still on going and everyone contributing on it does some really awesome work.

So make sure you do some initial research to prevent you from ending up in a tricky situation later on in the process!

Our site has 2 languages and one of them has way more content than the other. The menu does not currently support or let you configure to hide these untranslated menu items. There's an on going issue but there are many aspects and different use cases to take into consideration.

For our use case we only want to show content in the current active language. We ended up using Content Language Access module which worked really well.

Do not change default language

Even though I wasn't able to reproduce the issue on a fresh Drupal 8 install but I believe it's worth mentioning anyways. Be careful when changing default language, especially if you're quite far in the development/staging phase (like some content been populated etc). We changed default language from English to Swedish, and I think that Drupal at some point missed something out which ended up in weird issues like not being able to translate some configuration. We ended up changing back and had to do some manual work like making sure that the exported configuration (through Configuration Manager) had the right langcode.

Drupal actually explicitly tells you that changing default language can be a bad idea. Instead you should change the language detection to use the other language you wish to have as a default language and you should be fine.

Filtering on a language neutral taxonomy in Views

We found an core bug when we were working on creating a listing of articles with Views.
We were only able to filter on the default language but not on our secondary language. You can read more on the Language Neutral Taxonomy cannot be filtered on issue.

RSS Tags: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web