I am actually interested in the sitemenu module that I have come to like that cannot handle internationalization

is there something that I can do to it to make it obey localizer or is that something that localizer should handle ?

One more question:
Is Localizer compatible with Category module because I could probably find another solution to my problem using category. (what other modules is it compatible with ?)

Comments

Roberto Gerola’s picture

>Is Localizer compatible with Category module because I could probably find another solution to my problem using category.
localizer is compatible with taxonomy module.
What is your problem exactly ?

giorgosk’s picture

Sitemenu creates automatically a menu from the taxonomy vocabularies that I chose

Localizer actually translates the headings of each category displayed with sitemenu
but it does not translate the vocabulary words under each category

You can take a look at it on my test site (http://www.xiosweb.com/dru)
sitemenu creates the Properties Block on the left

Thanks for the concern

Roberto Gerola’s picture

>Sitemenu creates automatically a menu from the taxonomy vocabularies that I chose
Ok, and because it doesn't store the translations, you cannot see them.

Sitemenu should be modified.

giorgosk’s picture

What should I look for ? though ?

should I use for example t() function or localizer_t() ?
I am really new to the drupal way of things, I could use some guidance ? (not details of course)

Roberto Gerola’s picture

localizer_t is for internal use. Forget it.
And you shouldn't use the t() function to translate your menu items.

giorgosk’s picture

Title: What does a module need to have in order to obey localizer's rules » Localizer with sitemenu, not displaying correct language when sitemenu uses caching

Roberto I have narrowed down my problem.

I am using sitemenu module in conjunction with localizer

its working correctly when the sitemenu is not caching its content (don't know if I saying it correctly look in this issue here if you want http://drupal.org/node/119809)

is there a way for localizer to notify another module that the locale has changed ?
in that case the other module destroys the cache before displaying something to the user

giorgosk’s picture

I understand that sitemenu is using the hook_taxonomy to destroy the cache when taxonomy changes

function sitemenu_taxonomy($op, $type, $object) {
  // Expire the sitemenu cache when a taxonomy is added/changed/deleted
  $use_cache = variable_get(SITEMENU_CACHING, 1);
  if ($use_cache) {
    cache_clear_all('sitemenu', 'cache', TRUE);
  }
}

I there something similar I can make from inside sitemenu module ?

thanks

Roberto Gerola’s picture

Hi.
Glad to know that the problem is only with cache.

The problem is that the cache should be stored and also restored
with a key that contains also the current language.

I have already written a little function that do this for Drupal
page caching.

You should take a look here :
$key = $base_root . request_uri();
if(function_exists('cache_key')) $key=cache_key($key);
cache_set($key, $data, CACHE_TEMPORARY, drupal_get_headers());

This is an example that I have extract from one of my patch.

You should find in sitemenu code the calls that read and write the cache
and use as key, something like this :

$key='sitemenu';
if(function_exists('cache_key')) $key=cache_key($key);

Let me know if you need help.

Roberto Gerola’s picture

Sorry, a typing error :
The problem is that the cache should be stored and also read