Posted by Duncan_S on August 6, 2008 at 9:14am
I've searched high and low for how to implement multilingual images in Drupal 5.x, but I don't think I'm looking in the right places and I've had no luck thus far.
So, how do you folks generally implement language specific images? Spread your knowledge, I implore.
Comments
Image and other HTML tags
Possibly useful: "Language dependant html tags - like alt and title"
Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.
I've actually already got
I've actually already got your Language Sections module installed on the site (great little tool it is, too, so thanks for that!), so I'll see what it can do in this regard.
Hope it helps
Cool. Well I haven't tried doing "multilingual images" but I remembered that post from somebody who was doing something like that and seemed to find that the LS module helped. The current dev version has a "default" section which may be useful... allows something like:
=== es ===
Spanish stuff.
=== qz ===
Stuff for all languages except Spanish.
=== qq ===
Stuff for ALL languages.
Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.
I'm not sure what you mean
I'm not sure what you mean with "multilingual images" but if you want to store images and maintain a "translation" relationship between these images I would recommend http://drupal.org/project/image + http://drupal.org/project/i18n and then enable the multilingual attribute for the "Image" content type. That way you can create an image for each language and link them together as translations.
simpler method?
I have a theme which has embedded images. I would like those images to change based on the language which is chosen...anyone have any suggestions?
Ronnie
Say that you have a header
Say that you have a header image in English (header_en.png) and in Spanish (header_es.png). In your page.tpl.php you could do:
<?phpecho mytheme_header_image()
?>
And in your template.php you put
<?phpfunction mytheme_header_image() {
global $language;
return path_to_theme() . '/images/header_' . $language->language . '.png';
}
?>
Viola! That's the first option that comes to mind.