I've been trying to display language-specific logos by adding the 'logo_path' variable to settings.php, as described here: http://drupal.org/node/313272

This setting appears to do something. If I look at the configuration page for any theme (or the default theme), then 'Path to custom logo' now includes the text 'This is a multilingual variable'.

But, despite this, it doesn't actually work for me. The same logo file is loaded for all languages - apparently whatever path/file I typed last. Basically it's still behaving as a single language setting.

Am I using the right variable name, 'logo_path'?

Is there some other way to get language-specific logos within i18n?

I found a couple of similar issues for D5: http://drupal.org/node/294693 and http://drupal.org/node/295468

I've tried this with various themes, including Garland, but that doesn't seem to make any difference.

There are some other modules that might handle this issue better than i18n, such as http://drupal.org/project/logotool or http://drupal.org/project/dynamic_logo - but I'm hoping to avoid bloating the installation, since i18n in D6 seems so close to being able to do it.

Comments

Jose Reyero’s picture

Status: Active » Fixed

Theme settings may work differently to regular variables, I've just added some notes here, http://drupal.org/node/313272

Let me know whether it is some help.

bsimon’s picture

Status: Fixed » Active

OK, that appears to be working very well in beta5. All the new possibilities really expand the capabilities of i18n.

Thanks very much

+++++++++++++++++++++++++++

Details for anyone else who is trying to do this:

I'm using a standard copy of the Zen theme. Looking in the database (use PHPmyAdmin, for example), the variable name I need to use is 'theme_zen_settings',

It looks like many themes use this same format: theme_THEMENAME_settings

So I added 'theme_zen_settings', to settings.php, as described here http://drupal.org/node/313272

BTW, this probably doesn't work with older versions of i18n - e.g. it causes an SQL syntax error in 6.x-1.0-beta4

bsimon’s picture

Status: Active » Fixed

set status active by mistake...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

El Bandito’s picture

To clarify Bsimon's very useful clarification. You need to add both 'theme_XXXXXX_settings' AND 'logo_path' to your settings.php as described in http://drupal.org/node/313272 ( where XXXXXX is the themename in lowercase ). You can then switch languages on the themes settings page and enter a different logo path for each language. Job done.

Hope this helps.

Dave

rmmcclay’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev

I would like to confirm that this works as Daves describes.

It's easy and logical.

Russ

Sinan Erdem’s picture

Status: Closed (fixed) » Active

After entering paths for different logos, the logo change happens only after I visit theme settings page each time... Any ideas? Even clearing all caches won't work...

gyunei’s picture

Issue tags: +I18n Logo

I'm having a similar issue - can't seem to get the second language logo to work, and would be grateful for any advice you might have. Using 6.18, chameleon theme (although I have replicated the problem with garland) and english(default)/french setup.

I've followed the steps above, adding the multilingual variables 'logo_path' and 'theme_chameleon_settings'. In admin/build/theme/settings/chameleon, I am able to see "this is a multilingual variable" next to the path to custom logo field. When I change the path in the english interface, it registers fine, but specifying any path (even the same one) in the french interface makes the logo disappear (gone from the source code as well), even when I switch back to the default language. I can only make the logo reappear if I switch back to english and re-save. I've tried putting the logo images in different directories, but it doesn't seem to make a difference.

Suggestions?

abs’s picture

I have the same issue as gyunei on 6.19 with sub-theme of Zen and Czech / English setup.

I enable multilingual setup as suggested in earlier post. Then I switch to English which is seconadary language and navigate to Theme settings. After uploading or just setting path to english logo, logo disappears (from both languages). Back in Czech language and theme setting I can set the former logo back.

Any ideas?

70111m’s picture

Same issue as in the two previous comments by gyunei and abs. I checked the right variable name in the MySQL DB, which is 'theme_TheThemeName_settings' and added it with 'logo_path' to the settings.php. Other language variables ('site_frontpage') are working on my site, except this one...

EDIT:
There is a workaround i found here: http://drupal.org/node/295468#comment-978730
Surely not the way it should work, but it fixes the problem until a solution is found.

gandhiano’s picture

I confirm this behavior (logo disappears after setting path for second language).

Workaround pointed out by #10 is a good tip and works perfectly, but of course, this problem should be properly fixed at some point.

kasiawaka’s picture

This is a solution that worked for me: http://drupal.org/node/313272#comment-4039288

It requires to use different values in settings.php then described in different documentation.

Hope that helps

GiorgosK’s picture

as per http://drupal.org/node/313272#comment-4039288
you should not add logo_path or theme_settings
because when entering logo of second language both logos dissapear

problem is that "This is a multilingual variable" does not appear below the variable and its confusing
thus this is still a valid issue that needs addressing

EDIT: spoke too soon seems that it does not work with subtheme of fusion

EDIT2: I ended up using

function phptemplate_preprocess_page(&$variables) {
  $logo = $variables["language"]->language.".png"; 
  $variables['logo'] = str_replace("en.png", $logo, $variables['logo']);    //replace en.png with LANG.png
}

BenasPlentas’s picture

Component: Code » Blocks

@GiorgosK - could you tell me where exactly you place this code from #13?

GiorgosK’s picture

In your theme's template.php file

Jose Reyero’s picture

Status: Active » Closed (fixed)

Feel free to add your solutions to the module's documentation pages.

bludrop’s picture

I18n Logo module seems to have "fixed" this problem: http://drupal.org/project/i18nlogo

silver157’s picture

Issue summary: View changes

#13
is this code work with ver 7.x ?

fanton’s picture

#18
in D7:

function THEMENAME_preprocess_page(&$vars) {
  $lang_code = $vars['language']->language;
  // replace logo.png with LANG_logo.png
  $vars['logo'] = str_replace('logo.png', $lang_code . '_logo.png', $vars['logo']);
}