In D8, I have a website set up with 5 languages, using file path, like so:
website.com/en/link
website.com/en-us/link
website.com/fr-ca/link
etcetera.
I've made a view of blogs and resources. It includes a filter to current language selected for page and Not Specified-- this is to include articles that are intentionally set to Not Specified, so they show up for ALL languages. ( I don't want to have to turn 1000 blog posts into 4000 duplicates)
Problem is, the view is showing the link to items ONLY in the default language (EN) Regardless of what language I view the website in.
I'm using a hidden "Link to Content" field within a custom field for each item. I've UNchecked 'use absolute url'. I'm not sure what else to do. It doesn't make sense to me that it would be ignoring the site's current language.
If it's relevant, the link within the custom field is written like this:
<a href="{{ view_node }}?title={{ field_file_name }}&type={{field_resource_type}}">{{ title }}</a>
I also added in a "Content: Translation language" field, to verify I was looking at the correctly filtered language. the URL uses default language regardless of whether the item's language is specified or not.
Update: I've also ensured the bottom middle column in Views is set like this:
Rendering Language:Content language selected for page
This did not solve the problem. As a further test, I've also unchecked 'not defined' in my filter. While filtering to only nodes of the current language selected for page, I Still get URLs to the default language.
Also, the view has been translated into all relevant languages. Not sure how to change how the {{ view_node }} renders though. I assume it should be programmically pulling the current language when generating a URL. This {{ view_node }} is where the language is appearing. It seems like it should not be, though. The node alias shouldn't contain the language, I thought.
LANGUAGE
and setRendering Language:Interface text language selected for page
- this will link to the current language IF that entity exists in that language. Non-translated entities don't own a translated link, they will always point to the original language.current language selected for page
, you need a translation of the views page itself too.