15

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?

1 Answer 1

41

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).
6
  • Any solution for the same issue but for D7? May 26, 2016 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, 2017 at 11:06
  • In some cases you may also want to select "Distinct" from the query settings of each display. In a few instance I have seen duplicate content output still, and selecting distinct fixed it. Apr 9, 2021 at 21:19
  • Where exactly 2. Select "Interface text language selected for page" is located?
    – Bobík
    Apr 17, 2021 at 16:13
  • Select "Interface text language selected for page" for "Rendering" language. Located on the middle column of the view admin page. Under 'No results behavior', 'Pager'.
    – DimaS
    May 29 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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