The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 24 posts ] 
Author Message
PostPosted: Wed Oct 17, 2007 10:16 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 14956
Location: **Translation Matters**
Just add in each override

JPlugin::loadLanguage( 'tpl_nameoftemplate' );

Then add the strings in the en-GB.tpl_nameoftemplate.ini file frontend file.

Enjoy !

EDIT:
Other solution

$lang =& JFactory::getLanguage();
$lang->load('tpl_nameoftemplate', JPATH_SITE); // or JPATH_ADMINISTRATOR if the template language file is only present in the admin language folder(s)

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Multilanguage in 1.7: http://help.joomla.org/files/EN-GB_mult ... torial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sat Oct 20, 2007 6:03 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Good find JM, a quick note though, the JPlugin::loadLanguage is not intended to be used in template override scope. I can not guarantee that this method will keep functioning in future versions.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Sun Oct 21, 2007 4:22 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 14956
Location: **Translation Matters**
I guess you guys will devise a better way to get the overrides to accept language strings in future versions (although keeping this works OK).
In the meanwhile, this will help all template designers and does not cost one line of code.  ;)

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Multilanguage in 1.7: http://help.joomla.org/files/EN-GB_mult ... torial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Tue Jun 24, 2008 3:24 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Jun 24, 2008 8:04 am
Posts: 5
Hello,

I'm sory but i don't understand where the en-GB.tpl_nameoftemplate.ini file has to be saved. Can you be more specific ?

Thanks


Top
 Profile  
 
PostPosted: Tue Jun 24, 2008 3:41 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 14956
Location: **Translation Matters**
fleuveblanc wrote:
Hello,

I'm sory but i don't understand where the en-GB.tpl_nameoftemplate.ini file has to be saved. Can you be more specific ?

Thanks

Some templates do not have that file, others do (milkyway).
If it does not exist, create it in languages/en-GB/
The file can also be loaded in a template package with the following tags in the xml
Code:
<languages>
      <language tag="en-GB">en-GB.name_of_template.ini</language>
</languages>

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Multilanguage in 1.7: http://help.joomla.org/files/EN-GB_mult ... torial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sat Jul 19, 2008 6:49 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Jan 25, 2008 8:12 am
Posts: 98
Location: Kuwait
thanks for the TIP
but I couldn't understand the thread if you got any full reference for overrides and the benefits of it
Please advice

thanks again

_________________
Mestslm Rady Be Tab3ek, 3sfor Fe El-7elm Masaknk :: Me7tar 3la Shat Shafayfk, Dh 3tor El Koon Men Ward
Rosheha Nasyeny Meen ANA!
My Hosting Company : http://www.sz4h.com


Top
 Profile  
 
PostPosted: Sun Jul 20, 2008 7:05 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 14956
Location: **Translation Matters**
This is used when you have occurences of JText in the index.php of your template and the template is distributed over the Net to people not using the same language as yours.

Example for Milkyway:
Code:
<p id="power_by">
<?php echo JText::_('Powered by') ?> <a href="http://www.joomla.org">Joomla!</a>.
<?php echo JText::_('Valid') ?> <a href="http://validator.w3.org/check/referer">XHTML</a> <?php echo JText::_('and') ?> <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.
</p>

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Multilanguage in 1.7: http://help.joomla.org/files/EN-GB_mult ... torial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Mon Jun 01, 2009 1:30 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Apr 14, 2009 8:16 am
Posts: 27
Location: Makassar, Indonesia
I'm newbie here, so I've got to subscribe this...
Thanks... :laugh: :laugh:


Top
 Profile  
 
PostPosted: Sat Oct 31, 2009 12:07 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sun Mar 18, 2007 12:50 pm
Posts: 332
Location: Netherlands
Thanks!

_________________
Cheers, Babs
-------------------
http://crossinghippos.com


Top
 Profile  
 
PostPosted: Mon Dec 07, 2009 5:23 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sun Feb 08, 2009 5:10 pm
Posts: 275
Thanks very much infograf768. Great Tip.

_________________
- http://www.divulgaterium.com: Divulgaterium - Free Business Website Directory
- http://www.egliseprimitive.org: Christian Website


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 10:54 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Feb 09, 2010 7:17 pm
Posts: 2
Thanks infograf768.

_________________
http://www.orjinaltextil.com


Top
 Profile  
 
PostPosted: Sun Mar 07, 2010 3:27 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Wed Feb 24, 2010 2:14 am
Posts: 56
@infograf768

Thank you very much. It was very helpfull.

_________________
http://seo-chief.com -Technology Blog -Technology News Keep yourself up-to-date with recent technology news
http://webwisesolution.net - Website Design - Develop and design websites with Joomla.


Top
 Profile  
 
PostPosted: Tue May 25, 2010 10:08 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue May 25, 2010 9:29 am
Posts: 4
Thanks for the tips !
Merci pour l'astuce :)

_________________
Développeur web:
http://www.yootint.com/ - Site corporate pour la pose de vitre teintée pour auto.


Top
 Profile  
 
PostPosted: Wed Jun 30, 2010 7:12 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Mon Jan 04, 2010 7:38 am
Posts: 98
To: infograf768

About, Just add in each override

JPlugin::loadLanguage( 'tpl_nameoftemplate' );

Then add the strings in the en-GB.tpl_nameoftemplate.ini file frontend file.

Hi
I am new in all this but learning :) Please, i like to know when this become useful. I would have thought that most template would come with English as the main language. Is this plugin for other languages?


Top
 Profile  
 
PostPosted: Wed Jul 14, 2010 6:08 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Mon Jun 21, 2010 11:56 am
Posts: 4
infograf768 wrote:
I guess you guys will devise a better way to get the overrides to accept language strings in future versions (although keeping this works OK).
In the meanwhile, this will help all template designers and does not cost one line of code.  ;)


I am agree with you.

David.


Top
 Profile  
 
PostPosted: Tue Aug 31, 2010 8:53 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
I wrote a very small plugin that does this for all components and addons (as well as Joomla core translation strings) so that it can be applied to any template with no code changes and can maintain separate translations in different addons (in case the same string is repeated).

See http://extensions.joomla.org/extensions ... tion/13147

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Tue Oct 19, 2010 4:26 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Tue Sep 13, 2005 12:22 am
Posts: 5034
Location: Omaha, Nebraska, USA
@Geraint - Thank you! It works beautifully! You just saved me a couple hours of coding. ;)

Five free Internets for you!

_________________
Kenneth Crowder - Omaha, Nebraska, USA
Global Moderator - Joomla! ...because open source matters
Recipes for people with food allergies: http://intolerantoffspring.com
Author of "Joomla! 1.5: Developing Secure Sites": http://www.lynda.com/home/DisplayCourse.aspx?lpk2=73559


Top
 Profile  
 
PostPosted: Sun Oct 31, 2010 7:16 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 28, 2010 4:10 pm
Posts: 15
anybody checked this if have problem with joomfish component ?

_________________
Please read forum rules regarding signatures: viewtopic.php?t=65


Top
 Profile  
 
PostPosted: Wed Nov 03, 2010 3:27 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
As the co-author of Joomfish I can confirm that this should have no impact on the behaviour joomfish.

This addon works on the Joomla language string translation and not your website content.

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Wed Mar 16, 2011 3:51 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Mar 16, 2011 3:40 pm
Posts: 1
Wow.. Thank you, Thank you, Thank you!!!

_________________
My Joomla Site --> http://www.meldo.com
http://www.TryTony.com


Top
 Profile  
 
PostPosted: Fri Jun 03, 2011 12:40 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Jun 03, 2011 12:22 pm
Posts: 4
Guys pls help me out on this topic. I get it when installing templates.

"Error! Could not find an XML setup file in the package" via the link below

viewtopic.php?f=469&t=625543


Top
 Profile  
 
PostPosted: Sun Sep 11, 2011 6:17 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Mon Sep 20, 2010 7:58 am
Posts: 791
Location: Jakarta - Indonesia
infograf768 wrote:
Just add in each override

JPlugin::loadLanguage( 'tpl_nameoftemplate' );

Then add the strings in the en-GB.tpl_nameoftemplate.ini file frontend file.

Enjoy !



Hi, infograf768

I'm in the process of overriding the output of com_search in J! 1.7 Frontend and try to use the trick above.

1. I edit the default_result.php, and then put the file in the template HTML folder, as for template override in Beez5.
Code:
<?php
   echo JText::sprintf('TPL_BEEZ5_COM_SEARCH_CATEGORY', $url);             
?>


2. Edit the en-GB.tpl_beez5.ini, by inserting a new entry
Code:
TPL_BEEZ5_COM_SEARCH_CATEGORY="%s"


It work perfectly without JPlugin::loadLanguage( 'tpl_nameoftemplate' );

My question, is it okay for J! 1.7 and how to use the
JPlugin::loadLanguage( 'tpl_nameoftemplate' );
in my case?

Thanks

_________________
Regards,
enbees


Top
 Profile  
 
PostPosted: Thu Sep 15, 2011 11:54 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Thu Sep 15, 2011 11:51 am
Posts: 1
Thank you very much infograf768. It was very helpfull


Top
 Profile  
 
PostPosted: Wed Nov 16, 2011 6:06 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Aug 20, 2008 4:09 pm
Posts: 224
Thank you!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ] 



Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group