I'm working on a multilingual drupal site and its all up and running, but I've just began to create views to filter specific content types and noticed that the if I create a page using the views module there is no option to provide different paths based on the language. I've been pulling what little hair I have out for the last hour and wondered if there was an obvious answer or a solution for this?

Cheers
Andrew

Comments

sahuni’s picture

I'm interested too
I'd like something like "/bisses" for French and "/suonen" in German

jsartin’s picture

You have 2 nodes say site.com/en/chicken and site.com/es/pollo

Once you have your view sorting them in (via taxonomy, node, or content type fields) add a filter that is "Node translation: Language" and choose the option in Current user's Language. Once you have done that when viewing the view in English, you get /chicken and in Spanish you get /pollo

sahuni’s picture

I'm speaking of the path of the view, not of the path of the nodes.
When you create a view, display page, you give a path to that page.
Same display offers 2 languages possibilities, depending of Current user's Language, as you said.
But there is no way to give a different path for 2 languages, or if there is, I don't know how to.
Any idea?

jsartin’s picture

I have not tried this personally. Are you using Views 2 on Drupal 6? if so, try to add another page view and give the new view a different path?

I am not at a PC to connect to the admin of my views to verify my guess.

zijun2000’s picture

Thank you for your answers .Its good for me,but how could I translate the title of the view?

sahuni’s picture

I posted also in issue in module issue queue and got back an idea :
Use Site building -> URL aliases -> Add alias . It works for me.
But i think this should be handled directly in the view, so that all paths can be managed in one place.

andrew_hoffi’s picture

That's how I got around it in the end. Thanks for the comments guys!

Thanks
Andrew
-------------------
www.hoffi.com

ytokan’s picture

thank's for your idea
a little complexe with a lot of views and language but it's works great.
Yto

Scott McCabe’s picture

I know you found a suitable solution, but for anyone else weighing their options:

One way is to add a page display for each language.

Each page display can have its own path to meet your needs.

Each page display can filter its content with a language filter (node translation: language).

peacog’s picture

Adding a page display for each language is not the best solution, because there is no relationship between the page displays as far as locale is concerned. If you do it that way your language switcher won't work. Adding an URL alias is the right way to go.

allexx’s picture

For correct work we need separate menu item for eac language.
So, how about creating new page(with new menu item) with PHP filter and content:

echo views_page('nodes_by_type','page_4');

In my case
'nodes_by_type' - View name
'page_4' - needed page of the view

It worked for me.

www.yo-design.ru

LarsKramer’s picture

Here is a small tutorial about how to add an alias for another language:

http://www.bariswanschers.com/blog/translating-views-paths-drupal

robertoperuzzo’s picture

In my multilingual website I have a view with this kind of URL company-search/%/products.
What about this, how can I translate it?

I tried the "small tutorial", but it didn't work in this case.

maxlife58’s picture

Same request for me.
Did you find any solution?

Stessa richiesta anche per me.
Hai trovato qualche soluzione?

Thanks

robertoperuzzo’s picture

Hi maxlife58,
I found this module https://www.drupal.org/project/path_alias_xt, but I haven't tested yet.
Probably with this you can merge the "small tutorial" and use contestual filter args into path alias.
If you'll do write a feedback.

maxlife58’s picture

Hi Roberto,
I use this module on my site, It does its job well, when it comes to replace the taxonomy/term/% URLs, but unfortunately it does not work for the translations, even using the method specified in the "small tutorial", if you find some solution, please leave a comment.

Thank you

Max