6

I'm having an issue with translation of exposed filters in Views.

I'm using a text list field as an exposed filter in my view. The problem is that even though I translated the list terms via strings (Regional and Language >> translate interface >> translate) the terms always appear in the original language.

I checked but there is not an option in the view to show the translated terms in the filter. There are other exposed filters translated the same way that appear in the correct language, but they're not select lists but taxonomy terms.

I also checked the advanced views settings and the Localization translation method is already on "core". I don't know what else to check.

I'm using Better Exposed Filters and MEFIBS - More exposed forms in blocks for the exposed filters (I'm not sure if this may be related).

3 Answers 3

2

Option 1

Try something similar to what is mentioned in Comment #1 of issue # 1762488, i.e:

... visit 'Manage Display' and switch from "Default" to "Default translated".

Option 2

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

True, the Internationalizations Views module only has an alfa1 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?

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.

6
  • It's what I did to display the translated terms in the node, but It doesn't seem to affect the translation in the exposed filter. Commented Mar 31, 2016 at 8:09
  • You didn't mention in your question what I suggestion in option 1 (it could have been a possible explanation. However, since you don't mention "I18n views", I'm assuming you're not yet using that module yet (hence my option 2 I added ...). Commented Mar 31, 2016 at 8:26
  • I haven't got the internationalizations Views module, I'll try to see if it can help with this isssue and I'll say if It works. Commented Mar 31, 2016 at 8:41
  • Thanks for considering it. Curious for your additional feedback afterwards! Commented Mar 31, 2016 at 8:45
  • It works like charm. It allows to add the translated field as a filter instead of the original one. I had to add the new filter and remove the old one. It's just what I needed. Commented Mar 31, 2016 at 9:42
3

I can confirm this issue. While working with BEF, me too faced the same translation problem. Probably this is a bug in BEF module which do not handle translations properly. Meanwhile, to solve this issue I explicitly used a hook_form_views_exposed_form_alter() to wrap the non-translatable string in t().

May this helps you.

1
  • It wouldn't work if the original content is not in english (first thing to avoid for a multilingual site). But if I don't find any solution I'll try this. Commented Mar 31, 2016 at 7:59
1

You can Rewrite filter options:
enter image description here
__
enter image description here
__
enter image description here
__
enter image description here

2
  • 2
    But how could this be used to translate te view to 4 languages? It looks like it just overrides the text and would be applied to all languages. Commented Mar 31, 2016 at 8:05
  • 1
    It won't work for several languages unfortunately.
    – skorzh
    Commented Mar 31, 2016 at 8:18

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.