This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 3 voices.

Last updated by Harshad 8 years ago.

Assigned support staff: Harshad.

Author Posts
March 11, 2012 at 1:07 pm #51353

motiva

Hello,

I am doing a site for a conference that will be in 4 languages. The name of the conference will be an image file, and each language should have the name of the conference translated accordingly. Is it possible to serve a different logo image for each site through WPML? I couldn't find anything on the handling of images for translation.

Thanks.

March 11, 2012 at 2:56 pm #51370

sparkit
This answer solved user's issue.

this is not too difficult, but you'll need to do some coding. there is another post about it: http://wpml.org/forums/topic/home-button-in-3-languages-different-jpg-header-logos-for-each-language/

if you use the string translation, however it is easier by using the get text: find the logo bit in the template (possibly header file ) and modify the image link. then in the string translation use the link to the logo in the different language

<a href="<em><u>hidden link</u></em>" title="<?php _e('tooltip text','name of your theme');?>"><img src="<?php _e('<em><u>hidden link</u></em>','name of your theme');?>"/></a>

hope this helps

March 11, 2012 at 4:02 pm #51376

motiva

Hi Sparkit,

Thanks for the info. I did a search and didn't come up with those links. I will look through everything. If I can do it through string translation, better. In your example above, do I copy exactly as is except for changing the theme name and img logo? I'm not sure what tooltip text is for.

thanks.

March 11, 2012 at 4:59 pm #51394

Harshad

Hello Motiva,

Thanks for getting in touch with us.

Yes you can make use of WPML Language Constant ICL_LCANGUAGE_CODE.

Please try something like this.

if (ICL_LANGUAGE_CODE == 'en') { // English
link to english logo
} else if (ICL_LANGUAGE_CODE == 'ja') { // Japanese
link to japanese logo
} else if (ICL_LANGUAGE_CODE == 'ko') { // Korean
link to korean logo
}

Thanks,

Harshad

March 15, 2012 at 4:32 pm #52265

motiva

Hello,

I tried Harshad's method by putting the following in the functions.php file, but it's not working.

if (ICL_LANGUAGE_CODE == 'en') { // <em><u>hidden link</u></em>
} else if (ICL_LANGUAGE_CODE == 'es') { // <em><u>hidden link</u></em>
} else if (ICL_LANGUAGE_CODE == 'ca') { // <em><u>hidden link</u></em>
} else if (ICL_LANGUAGE_CODE == 'fr') { // <em><u>hidden link</u></em>
}

Is this not correct? What am I doing wrong?

For testing, I only have english and Español enabled?

the site is hidden link

March 16, 2012 at 6:33 am #52302

Harshad

Hi Motiva,

What you are doing needs some modifications, you need insert the link into img tags.

Then add the code into your header.php file where you display your logo.

<?php
if (ICL_LANGUAGE_CODE == 'en') { ?>

<img src="<em><u>hidden link</u></em>"/>

<?php
} else if (ICL_LANGUAGE_CODE == 'es') { ?>
<img src="<em><u>hidden link</u></em>" />

<?php
} else if (ICL_LANGUAGE_CODE == 'ca') {?>
<img src="<em><u>hidden link</u></em>" />

<?php
} else if (ICL_LANGUAGE_CODE == 'fr') {
?>
<img src="<em><u>hidden link</u></em>"/>
<?php
}
?>

Thanks,

Harshad

The topic ‘[Closed] Can I have a different header logo image for each language’ is closed to new replies.