Problem/Motivation
Views that filter by language using the ***LANGUAGE_language_interface*** langcode filter correctly limit SQL results to the current language, but still render nodes in their default language. This affects nodes where the default language differs from the current interface language
(e.g., a node created in English with a German translation will render in English on the German site).
The root cause is that the rendering_language view display setting was not set, defaulting to ***LANGUAGE_entity_translation*** (the entity's own default language). This means the langcode filter does the right thing at the query level, but the row renderer still loads and
displays the entity's default translation.
Additionally, the cases view was missing the langcode filter entirely, so it showed all content regardless of language.
Steps to reproduce
- Enable the
drupal_deconfig split (or any non-default language split) - Create a node in English, then add a German translation
- Visit the news, events, or cases listing page in German
- Observe that nodes with English as default language render in English instead of German
Proposed resolution
- Set
rendering_language: '***LANGUAGE_language_interface***'on all displays of thenews,events, andcasesviews - Add the missing
langcodefilter (***LANGUAGE_language_interface***) to all displays of thecasesview
Remaining tasks
- Review and merge the config changes
- Verify on staging that all three views only show translated content in the correct language
User interface changes
None. Views will now correctly display only content in the current interface language.
API changes
None.
Data model changes
None. Only view configuration is updated.
Issue fork la_eu-3582269
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
evilargest commentedThe changes look good to me. I tested all view blocks/sliders/listings for
news,events, cases,partners, andcategories, and all of those are language aware. Moving to RTBCComment #7
taran2l