When I'm using localizer + views it automatically changes the language !!
you can see it at:

http://new.tpico.ir/view/donya_darou

then:

http://new.tpico.ir/view/darou_darman

then:

http://new.tpico.ir/view/download

Comments

daveloper’s picture

I've to mention that it changes the language automaticaly by clicking on view links not language selector or somthing like that.

daveloper’s picture

Status: Active » Fixed

Stupid Cache !!!
The problem was because of the caching engine, on view urls

Roberto Gerola’s picture

Status: Fixed » Patch (to be ported)

Hi.

I discovered a little bug in views_cache.inc file that makes it incompatible with Localizer and probably also with i18n.

Here there is the patch

--- views_cache.inc.orig        2007-07-14 21:12:02.000000000 +0200
+++ views_cache.inc     2007-11-15 18:06:00.000000000 +0100
@@ -265,7 +265,8 @@
 }

 function _views_get_query(&$view, $args, $filters) {
-  if ($view->is_cacheable && ($cached = cache_get('views_query:' . $view->name, 'cache_views'))) {
+  global $locale;
+  if ($view->is_cacheable && ($cached = cache_get("views_query:$locale:" . $view->name, 'cache_views'))) {
     $info = unserialize($cached->data);

     $plugins = _views_get_style_plugins();
@@ -281,7 +282,7 @@
         'countquery' => _views_replace_args($info['countquery'], $info['args']),
     );
     if ($view->is_cacheable) {
-      cache_set('views_query:' . $view->name, 'cache_views', serialize($data));
+      cache_set("views_query:$locale:" . $view->name, 'cache_views', serialize($data));
     }
     $info = array_merge($info, $data);
   }