Different header for each language

General questions regarding the use of languages in Joomla! 1.5.

Moderator: General Support Moderators

Locked
slycrespo
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Wed Aug 19, 2009 10:36 pm

Different header for each language

Post by slycrespo » Sat Feb 25, 2012 12:09 pm

Hello!
On my joomla site (http://www.moj-otok.si) I have 4 different languages (slovenian, english, german and croatian). Now I want to have different header for each language. How I do that ?
Thanks for answers!
Sly

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30892
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Different header for each language

Post by Per Yngve Berg » Sat Feb 25, 2012 6:58 pm

Use a switch statement.

Code: Select all

switch ($this->language) {
    case 'de-de':
        echo "Deutsch";
        break;
    case 'en-gb':
        echo "English";
        break;
    case 'hr-hr':
        echo "croatian";
        break;
   case 'sl-si':
        echo "slovenian";
        break;
}

slycrespo
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Wed Aug 19, 2009 10:36 pm

Re: Different header for each language

Post by slycrespo » Sat Feb 25, 2012 7:05 pm

Thanks for your reply, but can you describe this more detailed ? I'm no coder... Thanks

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30892
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Different header for each language

Post by Per Yngve Berg » Sun Feb 26, 2012 12:43 am

You will find the <div class="art-header"> in index.php

Code: Select all

<div class="art-header header-<?php echo $this->language ?>">
<::before>
<::after>
</div>
Add to template.css:

Code: Select all

header-de-de::after { 
background-image: url("/templates/slycrespo001/images/header-de-de.jpg");
 }

header-en-gb::after { 
background-image: url("/templates/slycrespo001/images/header-en-gb.jpg");
 }

header-hr-hr::after { 
background-image: url("/templates/slycrespo001/images/header-hr-hr.jpg");
 }
You have to make the images.

slycrespo
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Wed Aug 19, 2009 10:36 pm

Re: Different header for each language

Post by slycrespo » Sun Feb 26, 2012 5:16 am

and where I have to put in the switch statement ?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30892
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Different header for each language

Post by Per Yngve Berg » Sun Feb 26, 2012 9:06 am

You don't need the switch statement. Just append the language to the image file name.
Save it in case you in the future needs something more complex.

slycrespo
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Wed Aug 19, 2009 10:36 pm

Re: Different header for each language

Post by slycrespo » Sun Feb 26, 2012 3:32 pm

Can you please write a more detailed procedure ? I'll be verry gratefull .. Thanks

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30892
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Different header for each language

Post by Per Yngve Berg » Sun Feb 26, 2012 3:41 pm

Extensions->Template Manager->slycrespo001->Edit Html

Find the line with "<div class="art-header">" and add the code and save

Edit CSS->template.css. Add the css to the file.

al_bozorgi
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Nov 15, 2011 11:54 pm
Location: iran
Contact:

Re: Different header for each language

Post by al_bozorgi » Wed Jul 04, 2012 8:46 am

Per Yngve Berg wrote:Use a switch statement.

Code: Select all

switch ($this->language) {
    case 'de-de':
        echo "Deutsch";
        break;
    case 'en-gb':
        echo "English";
        break;
    case 'hr-hr':
        echo "croatian";
        break;
   case 'sl-si':
        echo "slovenian";
        break;
}
thank you

bifipf
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Oct 03, 2012 2:33 pm

Re: Different header for each language

Post by bifipf » Wed Oct 03, 2012 2:52 pm

Hi people, im trying to customize Ifreedom-fjt template in Joomla 2.5 for multilanguage use. I really dont know how to change logo for each language, it would be great if could help me. I have same problem to change Slogan with switching language.
I try make changes here http://undercity.bonet.sk/~fody/index.php
I'm a newbie to these adjustmens :(

Thanks for any help

Peter

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Different header for each language

Post by infograf768 » Thu Oct 04, 2012 8:49 am

bifipf wrote:Hi people, im trying to customize Ifreedom-fjt template in Joomla 2.5 for multilanguage use. I really dont know how to change logo for each language, it would be great if could help me. I have same problem to change Slogan with switching language.
I try make changes here http://undercity.bonet.sk/~fody/index.php
I'm a newbie to these adjustmens :(

Thanks for any help

Peter
Thisis the 1.5 language forum.
See the tips here:
http://forum.joomla.org/viewtopic.php?f=617&t=718481
They are similar for logos, etc.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

bifipf
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Oct 03, 2012 2:33 pm

Re: Different header for each language

Post by bifipf » Thu Oct 04, 2012 12:19 pm

infograf768 wrote:
bifipf wrote:Hi people, im trying to customize Ifreedom-fjt template in Joomla 2.5 for multilanguage use. I really dont know how to change logo for each language, it would be great if could help me. I have same problem to change Slogan with switching language.
I try make changes here http://undercity.bonet.sk/~fody/index.php
I'm a newbie to these adjustmens :(

Thanks for any help

Peter
Thisis the 1.5 language forum.
See the tips here:
http://forum.joomla.org/viewtopic.php?f=617&t=718481
They are similar for logos, etc.

bifipf
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Oct 03, 2012 2:33 pm

Re: Different header for each language

Post by bifipf » Thu Oct 04, 2012 1:25 pm

Thx i have it:) Peter

bifipf
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Oct 03, 2012 2:33 pm

Re: Different header for each language

Post by bifipf » Fri Nov 09, 2012 6:50 am

I have done it rly hard way:) I created logo with text, because i wanted it in some style and this
was to easiest way for me. If you put this to correct place in index.php it helps.
You can see that it works at www.termotechna.sk.
Im noobie but allways learning:)

<?php if ($this->countModules('logo')) : ?>
<div class="logo">
<jdoc:include type="modules" name="logo" style="none" />
</div>
<?php elseif ($this->language == 'sk-sk') : ?>
<a href="<?php echo $this->baseurl ?>/">
<img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/logo.png" border="0" class="logo">
</a>
<?php elseif ($this->language == 'en-gb') : ?>
<a href="<?php echo $this->baseurl ?>/">
<img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/logo_en.png" border="0" class="logo">
</a>
<?php elseif ($this->language == 'de-de') : ?>
<a href="<?php echo $this->baseurl ?>/">
<img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/logo_de.png" border="0" class="logo">
</a>
<?php endif; ?>

I hope this helpp

Peter

ronaldo85
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 13, 2014 4:52 am

Re: Different header for each language

Post by ronaldo85 » Thu Nov 13, 2014 5:17 am

Fantastic contribution :laugh: Per Yngve Berg i took away a big headache thanks!!! :o :laugh:


Locked

Return to “Language - Joomla! 1.5”