Score:0

Views Block Language Detection

in flag

I have a site with two languages (EN/FR). I have a Content Type (Article). I have a Block built with Views that is displayed on the Article Node page. This Views Block has a translation.

When the user switches to FR, all other Blocks and UI components detect and render in this language. Even if the user visits a node that does not have a FR translation, it will render the rest of the site in FR.

However, Views Blocks do not seem to adhere to the selected language. I must be missing something?

When a user changes the language of the site to FR, all translated interfaces should adhere to that, no?

Jaypan avatar
de flag
Views blocks consist of two translatable parts - the configuration (the view) and the content. You have to translate the configuration through the interface, have you don this? Or is the content of the block the wrong language? If so, you'll have to add a filter for the content language.
ymdahi avatar
in flag
Hmm... I don't know - I added translations in the Tab in the view-edit page that reads "Translate View". Regarding adding a filter: I would like the Views Block to display the user's selected language instead of the node's language. For example, if the node is only in EN, and the user is set to FR, I still want the FR version of the Views Block to show. Any help would be appreciated.
Jaypan avatar
de flag
You'll need to set the filter on the content language then, and set it to use the current interface language.
ymdahi avatar
in flag
Any chance you have a few minutes to walk me through this? I can pay you for your time.
Jaypan avatar
de flag
You should remove your address. You'll get spammed! I'll try to post an answer below later
ymdahi avatar
in flag
Thanks mate, I really appreciate your help.
Score:0
de flag

In the view, add a new filter on 'translation language', and then for the filter, check the 'Interface text language selected for page' box, and save the view. This will filter the content of the view to the current language.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.