Hi,

I'm running Drupal 4.7.9.

I am using the localizer module and have a site with English and French versions.

Everything is working well, though when I try and create a French version of a custom English block, I am unable to save a second, different French version - despite the fact that I am selectin the 'French" locale from the drop down.

Basically, whatever I type in the block appears under both locales.

I have read that it is possible to have different custom locale blocks, so what am I missing?

Thanks,

B-Dot

Comments

hbfkf’s picture

I am not a Localizer expert, but your question seems to be related to this issue. According to the latter, you have to create a block for each language, it seems.

B-Dot’s picture

Hey - thanks very much for that pointer.

On that page, I read this post by sun:

@deng: As of now, a block is stored separately for the selected language. If you the change the language only and submit an existing block again, you're overwriting the original block. In order to create translations for a block, you need to create a new block for each language. This behaviour will be changed in Localizer 2.0.
#8

...and have tried creating distinct versions of the block in each language.

However, there does not seem to be a way to specify that the english block appear when a user has selected english and the french block appear when the user has selected french: both blocks appear on both languages....

It occurs to me that perhaps a snippet of PHP that checks whick language is selcted is the way to go.

Does anyone know how to check that via PHP?

B-Dot

B-Dot’s picture

Status: Active » Fixed

OK, I reached out to my PHP guru and was told to try this, which worked perfectly:

<?php
global $locale;
if ($locale == 'fr') return TRUE;
?>

...to only show a block on Frech locale pages. Just substitute 'en' for English pages.

The only problem with this is that it will show the block on *all* pages of a given locale. It was suggested that the above snippet could be extended using "$_GET['q']" to select certain nodes.

Roberto Gerola’s picture

It seems to me that you didn't patch the block module.

Anonymous’s picture

Status: Fixed » Closed (fixed)