Translate Logo Text & Logo Slogan

Premium, Furniture Joomla Design Shop Template with K2Store support
GK User
Sat Jan 26, 2013 9:05 pm
Hi all,

We have a bilingual site and we are using the Black and White template. For the translation we are using FaLang, and we are just missing an option to translate the theme settings ("logo text" and "logo slogan").

Is there any way around this translation? Or is there a way to duplicate the template and use different settings for different languages?

Thanks!
User avatar
Fresh Boarder

GK User
Sun Jan 27, 2013 10:24 pm
Please try this way. Open file logo.php from template/layoyts/blocks directory and fin this lines :

Code: Select all
$logo_text = $this->getParam('logo_text', '');
$logo_slogan = $this->getParam('logo_slogan', '');


then replace it with :

Code: Select all
$logo_text = JText::_('TPL_GK_LANG_LOGO_TEXT');
$logo_slogan = JText::_('TPL_GK_LANG_LOGO_SLOGAN);


Then just add this two phrases TPL_GK_LANG_LOGO_TEXT, TPL_GK_LANG_LOGO_SLOGAN to language file - this allows you to display different text for every language version. Of course since this change the text from template settings will not work.
User avatar
Platinum Boarder

GK User
Wed Jan 30, 2013 12:06 am
Thanks @bkrztuk. I think you pointed us in the right direction but we must be missing something, because it's still not working.

1) We have made the sustitution on logo.php that you mention.

2) We have found the language file in /language/en-GB/en-GB.tpl_gk_black_and_white.ini. Is this the one you meant?

3) We have then created a file for each one of the other languages:
-/language/en-US/en-US.tpl_gk_black_and_white.ini (English US)
-/language/es-ES/es-ES.tpl_gk_black_and_white.ini (Spanish)

4) And finally, on each of those files, we have added the lines with the actual translated text:
TPL_GK_LANG_LOGO_TEXT="our custom text for this language"
TPL_GK_LANG_LOGO_SLOGAN="our custom slogan for this language"

Are we missing something? Are we not editing the proper language files maybe?

Thanks.
User avatar
Fresh Boarder

GK User
Fri Feb 01, 2013 9:38 am
Files looks ok, and after your changes any text is visible or just it shows 'TPL_GK_LANG_LOGO_TEXT' ?
User avatar
Platinum Boarder

GK User
Fri Feb 01, 2013 7:26 pm
It still shows the text on the template settings, as if we hadn't change anything... I wonder if there is some cache that we haven't flush yet or something like that.
User avatar
Fresh Boarder

GK User
Mon Feb 04, 2013 9:34 am
Maybe I don't give your proper description - when you make changes described in my previous post the Logo Text in template doesn't matter. Logo text & slogan will be loading from language file and template settings are not working in this case but that is solution which allows you to use different text/slogan for particular language.
User avatar
Platinum Boarder

GK User
Tue Feb 05, 2013 6:21 pm
Hello bkrztuk,

Thanks for your help. I hope you can keep guiding us through this, since we haven't been able to make it work!!!

First, we found that the language file already has the sentences you mention:

Code: Select all
TPL_GK_LANG_LOGO_TEXT="Logo Text"
TPL_GK_LANG_LOGO_TEXT_DESC="Main text of the logo (works only with text logo type)"
TPL_GK_LANG_LOGO_SLOGAN="Logo slogan"
TPL_GK_LANG_LOGO_SLOGAN_DESC="Slogan under the main text of the logo (works only with text logo type)"


So we understand that there was a problem of duplication. But still that should have shown "logo text" in our header, as we edited logo.php substituting the reference $logo_text so it is as follows:

Code: Select all
$logo_text = JText::_('TPL_GK_LANG_LOGO_TEXT');
$logo_slogan = JText::_('TPL_GK_LANG_LOGO_SLOGAN');


I think that's where the issue is. This is how our logo.php file looks like, the section that is working now since we are using logo_type: text.

Code: Select all
<?php if ($this->getParam('logo_type', 'image')!=='none'): ?>
     <?php if($this->getParam('logo_type', 'image') == 'css') : ?>
     <h1 id="gkLogo">
          <a href="./" class="cssLogo"></a>
     </h1>
     <?php elseif($this->getParam('logo_type', 'image')=='text') : ?>
     <div id="LogoNWT-wrap">
    <a href="./">
          <img src="images/logo2.png" alt="<?php echo $this->getPageName(); ?>" />
    </a>
     <div id="LogoNWT-wrap2">
     <h1 class="gkLogo text">
         <a href="./blog">
             <span><?php echo $this->getParam('logo_text', ''); ?></span>
         </a>
     </h1>
              <small class="gkLogoSlogan"><?php echo $this->getParam('logo_slogan',''); ?></small>
     </div>
     </div>

    <?php elseif($this->getParam('logo_type', 'image')=='image') : ?>
    <h1 id="gkLogo">
          <a href="./">
          <img src="<?php echo $logo_image; ?>" alt="<?php echo $this->getPageName(); ?>" />
          </a>
     </h1>
     <?php endif; ?>
<?php endif; ?>


So looking into the <h1> for the text option, we are pulling
Code: Select all
<?php echo $this->getParam('logo_text', ''); ?>
<?php echo $this->getParam('logo_slogan',''); ?>


And since there is no change in what is being shown in the front end, we are assuming that we are still pulling the title from the settings instead of from the language file. Shouldn't we be looking into something like?

Code: Select all
<?php echo $this->'TPL_GK_LANG_LOGO_TEXT'; ?>
<?php echo $this->'TPL_GK_LANG_LOGO_SLOGAN'); ?>
User avatar
Fresh Boarder

GK User
Tue Feb 05, 2013 11:45 pm
All is fine apart this code :

Code: Select all
<?php echo $this->getParam('logo_text', ''); ?>
<?php echo $this->getParam('logo_slogan',''); ?>


replace it with

Code: Select all
<?php JText::_('TPL_GK_LANG_LOGO_TEXT'); ?>
<?php echo JText::_('TPL_GK_LANG_LOGO_SLOGAN'); ?>


and it should working in other case I don't have idea what can be wrong.
User avatar
Platinum Boarder

GK User
Wed Feb 06, 2013 6:05 pm
Good, thanks a lot!

Why does one sentence include echo but not the oher? Don't they work the same way?
User avatar
Fresh Boarder

GK User
Fri Feb 08, 2013 1:42 pm
It is related how it is designed in Jooma! when you use JText Joomla! can detect it and replace with text from language file.
User avatar
Platinum Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.