3

I have a multilingual site for Properties with 2 languages ( English - Arabic ) and I have a view that give me the all properties that I need to sell.

But when I enter to this view every multilingual content will duplicate like is shown in this image:

enter image description here

This is the filter criterion :

enter image description here

Any idea to solve the duplication problem?

0

6 Answers 6

3

after searching I found the solution for my problem :

This may happen if you have applied filters on any date field. So.

in Views Advanced Settings under OTHER options, select "Query Setting" and check "Distinct" option.

enter image description here

That's it .

1

You need to add a filter by language as well. You can set the value to "Current user's language" to make it select the language based on the current selected language in the site. You can also create two views displays, one for each language.

2
  • Dude i tried that by adding filter by language "Current user's language" but its not work! when am choosing the another language the arabic one its give me no result in sell page !! i think because the language for the content in english i dont know :S Aug 14, 2016 at 12:32
  • I ran into this issue as well and your suggestion helped me fix this. Jan 15, 2019 at 14:46
1

Try using the Internationalizations Views module, which extends the i18n module with multilingual support for Views.

It allows to add the translated field as a filter instead of the original one, which may be what you're looking for.

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

Note: Filtering Views results in a multi language site can sometimes be challenging, as illustrated also in discussions such as in How to filter views results to the current language nodes.

0
1

I had the same problem in D8, I simply solved adding in the view a filter "Content: Translation language" and setting it to " Interface text language selected for page":

setting language filter

NO need to set DISTINCT or REDUCE DUPLICATES

0

I don't see any entity translation in core, and following the documentation says to use "Content Translation".

I have solved my problem following the solution of adding a new "Filter Creteria" in the view (Content: Translation language (= Interface text language selected for page) described in https://www.drupal.org/forum/support/translations/2016-11-24/solved-translated-content-duplicate-on-a-view-with-choosen

0

If you have content in multilanguages you have to make some changes to your view.

Firstly, you have to go to the "Filter criteria" section and add a new rule, such like this: enter image description here

Then you have to "Language" section and add this: enter image description here

And finally you have to "Query settings" and check the Distrit data enter image description here

1

Your Answer

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

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