6

This is probably very easy but endless searching has proved fruitless - there's lots of UI changes between the D7 and D8 versions of these modules it seems.

What I want to do is create a blog in two languages. The default language is English. Mostly, the author will be translating the articles to Italian. However, I would like to create the blog view such that:

  1. only one translation shows in the list, per node
  2. if viewing the site in italian but there is no translation of a specific list item to italian, the english version shows (fall back to default language)
  3. if he's only written an italian version, show that anyway instead of the non-existent english one

The options in views are similar looking to everywhere else, but in those other places this isn't really an issue. In standard nodes, the fallback kicks in automatically. Any ideas of how to configure this?

22

I think your requirements can be restructured into the following:

  1. Show all content once.
  2. Show the content in the current language, fall back to the other.

Then it becomes pretty easy:

  1. Add the "Default Translation" filter to a view. That basically ensures that all your nodes are shown once because each node can only have one default translation.
  2. Select "Interface text language selected for page" for "Rendering" language. That will attempt to display the site in the current language and fall back if that's not available. (Interface text sounds a bit misleading, but unless you explicitly enabled separate content language negotiation, that's the same as the content language).
  • Any solution for the same issue but for D7? – Peter Lozovitskiy May 26 '16 at 12:01
  • Thanks for the tip! Simple but not obvious. One other point worth mentioning: the "Rendering Language" option seems to be specific to each display. You have to change it on each display, you can't just to it on the Master display. – s427 Jan 12 '17 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.