i18n paths & views

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by penyaskito on January 20, 2012 at 9:29pm

Hi,

I'm wondering what people use for using different paths in a view for each language.

In the past, we approached this issue by creating nodes with the desired url, and embedding a view on it, but it doesn't seem like the best option.

I also heard of people that duplicate each view for each language, but doesn't seem to me like an scalable approach in big sites.

Recently we participated on developing i18_page_views module (yep, it lacks an 'n'), that makes possible putting different paths for each language.

I'd like to learn from others experience on this issue, and it there are any improvements on Drupal 7 or if this is something considered on the
Drupal 8 Multilingual Initiative.

Thanks in advance for your thoughts.

Categories: , , ,

Comments

Different approaches

Posted by kristen pol on January 21, 2012 at 8:51pm

I looked into this recently and here are the ways I see to handle it:

1) create a completely different view per language - this is most useful if you indeed will be having different data shown

2) use the i18_page_views module - this is most useful when the views are exactly the same but you want a different path per language - what I don't like about this option is that you have to use the "i18n page" display rather than the "page" display so it is not easy to add it in after the fact unless your "default" display configuration exactly matches your "page" display configuration - would be nice if this just altered the "page" display path options

3) use one view but filter based on interface language - this is most useful when the views are exactly the same and you want the paths to be the same for all

Kristen

Path translation

Posted by kristen pol on January 22, 2012 at 9:51pm

For #1, you can use the Path translation module (in i18n) to maintain your translation set.

Kristen

Thanks Kristen, didn't knew

Posted by penyaskito on January 22, 2012 at 10:13pm

Thanks Kristen, didn't knew about it. It seems that it was included in D7.

--
Christian López Espínola (@penyaskito)

D7 goodies

Posted by kristen pol on January 23, 2012 at 6:48pm

Ya, lots of good stuff in D7! I'm digging into it all in detail for the D7 i18n book I'm writing... hopefully out in March.

Kristen

Create one view for all

Posted by webflo on January 23, 2012 at 3:33pm

Create one view for all languages. Use i18nviews and create a path alias for every language for nice localized urls ;)

Path translation is pretty clever too.

i18nviews and menu

Posted by no2e on February 17, 2012 at 5:00pm

Create one view for all languages. Use i18nviews and create a path alias for every language for nice localized urls ;)

I think this will not work if you want to link the Views pages in a menu with translation mode "Translate and Localize". Because the menu needs the real system path (and not a path alias), the path is the same for those menu items. So all translated links show up on all languages. At least that's the case for me.

/edit: But I have the same problem with http://drupal.org/project/i18_page_views – so the only way that works for me is creating nodes, adding them to the menu and displaying Views blocks inside of the nodes.

/edit: Hm, now it seems to work with http://drupal.org/project/i18_page_views

Thanks

Posted by kristen pol on February 22, 2012 at 1:19am

Thanks for the tip... I was wondering if the path aliases were a good idea or not and now I'm thinking maybe not...

Kristen

Title?

Posted by merilainen on August 7, 2012 at 1:56pm

What about the title? If I can set a different path, the title should be different also...

Check this

Posted by gonssal on August 31, 2013 at 6:40pm

Too complicated to be Drupal-way

Posted by moniuch on December 28, 2012 at 11:28pm

Setting up a multilingual site is more difficult than Drupal era deserves, esp. when the paths and views go. i18_page_views should generate not only paths but also menu items, bind them into a path translation set, do that all automatically.
I also find it cumbersome to print urls in custom PHP (using url or l functions) so that they are looked up automatically. If, for instance, my view produces path "news", I would like to be able to put PHP one-liner as in : "print url('news')" and get proper links "/en/news", "/es/noticias", "/fr/nouvelles", etc. Currently my links are cross-rendered, as in "es/news" or absolute as is "/news".

And many many other nuisances.

So cloning a view is the only

Posted by pwiniacki on November 11, 2014 at 12:23am

So cloning a view is the only option for proper path to other language ?

Check

Posted by penyaskito on November 11, 2014 at 12:51am

--
Christian López Espínola (@penyaskito)

Any solution for Drupal 8?

Posted by aaronsssp on June 2, 2017 at 5:39pm

Any solution for Drupal 8?

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /