How to set up Drupal default front page (view) to open in other language than default
I need to open view with particular path as front page. Everything would be nice except the view must be open in another开发者_运维技巧 language than default (english).
Tryinig to prefix language in Site information settings or adding path alias with that prefix fails as Drupal says "tha path xxx is invalid" 'cause Drupal prefixes language automatically.
I've come up to thought to hack the core function or override front page method with custom code.
Is there any solution by means of configuration?
Precision: I need INTERFACE language (menus etc.) to be changed, not only the view content.
Can't you add a filter to the view specifing the language you want it to use? (View -> Filters -> Node Language -> Is one of ...)
If you just want to change the language, you can do that by changing the global $language in a preprocess function for that view.
You can use language_list()
to get an array of active languages and overwrite the global $language with one from the list. You need to do this in a preprocess function, look at the theme information in your view to get more info about it.
精彩评论