1

I have several articles on my website in different languages. I would like to create a page on which only the articles in a certain language are displayed based on the url.

  • Only show articles in english when user is on www.website.com/en/blog
  • Only show articles in french when user is on www.website.com/fr/blog

How can I do that? I have Internationalization, Entity and Views.

My language detection/selection settings are, in the order:

  1. URL (path prefix)
  2. Default
  3. User

I have two languages: english (default) and french.

All my articles have the vocabulary "Blog (taxonomy) > story (term)"

The only thing is, I'm not very good at using Views so I would need a really "step by step" explanation, because it is not really intuitive to me.

Many thanks for your help!

enter image description here

enter image description here

2 Answers 2

0

Use the Internationalizations Views module, which extends the i18n module with multilingual support for views.

Also, to make view results correspond to the language switcher, add a filter for Content Translation: User's Current Language, which is the language that an authenticated user has set in the user settings (it is NOT the same as the current browser language or the site language).

Note: The Internationalizations Views module only has an alfa version for D7, but right now there are over 41K users using this version. Therefor I think "DEV" is not a valid release qualifier for that version anymore, because +41K users can't be wrong, right?

PS: I'm assuming this question is about D7.

5
  • Thanks @Pierre ! However this is not working completely for me. Is there anything else I should do?
    – Benjamin
    Commented Mar 30, 2017 at 19:33
  • @Benjamin "not working" is impossible to debug. Please improve your question by including an export of your view, and maybe als explain what the missing part is why you wrote "completely". That may help to pinoint the missing piece to get it to work ... "completely". OK? Commented Mar 30, 2017 at 19:36
  • thanks for your answer. By "completely" I mean, none of my articles are showing up on the View, nothing: it makes it an empty page with just the View title ("Blog"). I edited my original post with screenshots of my View configuration, maybe this can help! Thanks again
    – Benjamin
    Commented Mar 30, 2017 at 20:47
  • @Benjamin in your screenprint I do not see any filter that matches what I suggested in my answer ... Moreover, "I" am assuming you use node translation ... (your question does not say that you're using entity translation). Commented Mar 31, 2017 at 8:42
  • Thank you @Pierre.Vriens - it was written on the fifth line from the beginning that I was using Entity. So I guess you can't help me with that config? Many thanks anyway, have a good day.
    – Benjamin
    Commented Apr 1, 2017 at 9:50
0

I finally found the solution, I used the Select translation module to add a new filter to Views. My configuration is as below:

enter image description here

Thank you everyone for your precious help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.