Problem/Motivation

The different views that are displaying content in Umami, such as /recipes and /articles, display only original/translated items in the current language.
When adding a new language, the list of recipes and articles will appear empty in that language, until they will be translated to that language.

Proposed resolution

Change the settings of these views to display all available recipes in all languages.
When a new language is added displaying the view will display items in all languages.

Remaining tasks

Create a patch that uses the settings from this screenshot: https://www.drupal.org/project/language_hierarchy/issues/2825851#comment...

User interface changes

API changes

Data model changes

Release notes snippet

Comments

shaal created an issue. See original summary.

shaal’s picture

Title: Display all items in the current language + language fallback » Views should display items from all languages
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new17.76 KB

I created a patch for views to display:

  • All original items in current language
  • All translated items to current language
  • All items in other languages that are not translated to current language

These are the views this patch updated:

  • featured_articles
  • frontpage
  • promoted_items
  • recipe_collections
  • recipes
  • taxonomy_term
markconroy’s picture

This looks really good to me.

It shows OOTB Drupal can have fallbacks for languages/content and that languages have hierarchies that can easily be set.

There might be some detraction that we are showing content in a language that is not the currently selected language, but I think it's better to demo that Drupal has that capability and let people see how it works, that to not demo it and frustrate users with trying to figure out ways to achieve it.

So, for me, this is RTBC.

markconroy credited kjay.

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC

gábor hojtsy’s picture

Hm, does this mean the pages will display all the items, the more languages you have the more items?

shaal’s picture

Regarding #7 no, it will not display every translation of any content.

It's using Drupal's (awesome) language fallback mechanism.

The new setting provided by this patch will display each recipe only once.
If the recipe exist in the it will display the recipe in current_language, otherwise it will use language fallback and display the recipe in the next language fallback.

One of the benefits is that now, when adding a new language, front-page, recipes, articles will no longer show "no content available", but will show content. When that content get translated to the new language, it will show the translated version first.

* While working on this I learned that the order of the languages in the list (in /admin/config/regional/language) determines the language fallback Drupal will use.

gábor hojtsy’s picture

Title: Views should display items from all languages » Umami demo views should display items from all languages

Sounds great :) The order of languages indeed is used for language fallback and also for displaying the language switcher block in that same order. Contrib modules can decouple those two in case people are want alphabetic language switcher but a different language fallback :)

gábor hojtsy’s picture

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all, committed!

  • Gábor Hojtsy committed 1240a8a on 8.8.x
    Issue #3068721 by shaal, markconroy, alonaoneill, kjay, Gábor Hojtsy:...
lauriii’s picture

I'm wondering why do we want to show content from different languages on these lists? If I have chosen a language to be for example Spanish, I would prefer to only see content in Spanish since it's not cool to assume I would speak some other language. It's frustrating to see an interesting article on a list and after clicking it, you realize it's written in a language you don't speak. This isn't necessarily as big of a problem since we're talking of a demo, but I don't think we should be promoting bad practices.

gábor hojtsy’s picture

I don't think there is a "bad practice" really :) Some sites prefer to show only one specific language, some prefer to show content at least in some language while the translation is available. Some sites have entirely different trees of content for different languages. Eg. Lingotek's Drupal integration has a service where they machine-translate some content and then you can watch your visitor stats if that content gets traffic and if so, you can buy more professional translations for them to capitalize on that traffic. There are really all kinds of trees in this forest :)

lauriii’s picture

I think I might have misunderstood the issue summary when I first read it. What I first understood was that recipes were displayed in another language if it doesn't have a translation in the currently selected language. This would have lead to displaying content in language user doesn't necessarily speak, which would lead to poor UX. It seems like this is about something else which I think should be fine 😇

gábor hojtsy’s picture

@lauriii: currently Umami has all content in English and Spanish. It does not have content in any other language. So since all content is available in Spanish and English, you would not see Spanish or English on the other language pages. BUT once you add French, before this patch, your listing pages all went entirely empty. You did not have anything French after all. After this patch the lists will display a fallback language (depending on order of languages on the site). Whether your listing pages showing entirely empty is a bug or them showing a fallback language is a bug is really a design question. Some sites prefer no content ever in another language you did not want, some sites prefer a fallback language displayed.

lauriii’s picture

That's what I was trying to refer to as poor UX. I've never seen a popular website (besides websites specifically designed to teach another language) that would show untranslated content because of the UX concerns.

Here's an example. I'm assuming that we have a French-speaking user who doesn't speak English. The site has some recipes in French but it's a much smaller number compared to the number of recipes in English. They are trying to find a recipe but all they see is English recipes. There are 10 pages of recipes, so to confirm whether there are any recipes they would understand, they will have to navigate between pages. Some recipes might even have international names, such as Crème brûlée. To confrim whether that recipe has been translated, they would have to navigate to the page itself to see if it has been translated or not. Falling back to the default language makes sense to users who have a better understanding of the sites structure, but it doesn't help users. If there are no recipes in French, it doesn't help the user that there are recipes in English or Spanish if they don't speak those languages. It's much better to show immediately that there aren't any recipes, or that there are only 3 recipes in French.

smaz’s picture

I think we run into an issue where if someone installs the Umami demo in a language other than English or Spanish, they would see no content as content is filtered to their language.

I think a 'best' solution would be if no content exists in the installed language, fall back to the default but if there is some, only show content in that language? But I'm not sure that's possible with just core...

gábor hojtsy’s picture

@lauriii/@smaz: I think even then it's largely culture / use case dependent. I've asked Suzanne Dergacheva first to comment as well :)

pixelite’s picture

We build a lot of websites in Quebec, where many people are bilingual or used to seeing bilingual content. Some of our clients think it better to show the untranslated content rather than having less content in one language than another. (Our blog also works like this, showing some English blog posts on the French version of our site because we don’t translate many of our posts.) In some cases, we add a note that the content is not available in your current language so that users aren’t surprised.

I wouldn’t consider showing untranslated content a bug, but I agree that it could be confusing for audiences that aren’t used to seeing languages mixed in this way.

I can run a test of this and see what feedback I get from non-Drupal folks.

lauriii’s picture

Thank you for chiming in @pixelite! I agree that tech is a good example where the mixed language could be acceptable since a lot of the content is already in English. I also think it's very regional and depends on the use cases.

However, Umami is supposed to be an example of a consumer website of a food magazine. Therefore, it should be built to serve the general public. For example, for a website in France, serving content in English as a fallback doesn't make a lot of sense since according to Eurobarometer report 2012, 39% of the French population speaks English. Serving fallback content in English would lead to untranslated content being unreadable for at least 60% of the population. I'm also not too convinced that the remaining 40% would be too excited about using Crème brûlée recipe that has been written in English 😉

markconroy’s picture

We discussed this issue at length over a number of meetings.

During the discussion, I think we came to the conclusion that if we do not implement this some people might be annoyed because they will see no content in Drupal if their language is not supported. If we do implement this some people might be annoyed because they will see content in a language other then their own language if the content hasn't been translated.

What we then decided was that we should be trying to demo features of Drupal core "Out of the Box" and fallback languages for views results is one of those features (and one that not many people seem to know about apparently).

Speaking personally, I don't think we should focus so much on "how many people can speak English?" and more on "does this demonstrate another great feature of Drupal out of the box that users will be interested to know exists?".

We should also remember that if a node (node/1 for example) is not translated and someone clicks to see a translation of it, by default Drupal will show the original language. This issue aims to do the same with lists of content rather than just individual items.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.