Support a language fallback and/or rendering language

Created on 27 September 2017, almost 7 years ago
Updated 28 July 2023, 11 months ago

Our use case is showing a listing of product entities from a Search API index. We want to show exactly 1 of every node that matches the filters. The item should be rendered in the user's selected language if available, or in the default language if not.

This is how we've set up all of our standard (non-search API) views to achieve this:

  1. Add a filter for "Default translation" being TRUE
  2. Select "Interface text language selected for page" for the Rendering Language in the view.

However, in Search API, the "Rendering Language" setting isn't available, making this approach not work. I believe this is probably because every translation in the index is a unique, separately-indexed item.

Is there some other way to achieve what we need given the options available in a Search API view?

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Views integration

Created by

πŸ‡ΊπŸ‡ΈUnited States bmcclure West Virginia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΉAustria mvonfrie

    I have more or less the same issue with an indexed view for Commerce products, with Drupal 10.1 and all contrib modules up-to-date.

    But in contrast to the others my problem is not the language of the contents (as they are theoretically in English and German, but currently there are no English translations of them). My problem is the interface language of the view. The site default language is EN (for technical reasons) and the content default language is German. This means the main language of the view is English and it is fully translated to German. But when I show it in German (/de/products) everything on the site is German except of the static view texts (title, global text area in the header, ...) is English. How do I get the view to display in the negotiated language correctly?

  • Status changed to Closed: won't fix 11 months ago
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    That sounds like an entirely unrelated problem. Please create a new issue for that.

Production build 0.69.0 2024