The Joomla! Forum ™






Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Oct 14, 2009 11:09 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Nov 13, 2008 11:23 am
Posts: 27
Hi i developed a component and i am trying to use the language facility.

My component is named com_register, so i created a file on ./language named en-GB.com_register.ini
Inside this file i placed a couple of lines.

COMP_NAME=Name
COMP_INITIALS=Initials

Then, in the default.php if use it by doing:

<?php echo JText::_(COMP_NAME); ?>

I obtain: Notice: Use of undefined constant COMP_NAME - assumed 'COMP_NAME'

On the other hand if i use:
<?php echo JText::_('COMP_NAME'); ?>

I obtain: ·Name·
How can i get rid of these bullets at the beginning and at the end of the translation???

thanks in advance!
albert


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 12:42 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 9:58 am
Posts: 9902
Location: Hillerød - Denmark
Hi amoreno,
amoreno wrote:
On the other hand if i use:
<?php echo JText::_('COMP_NAME'); ?>

I obtain: ·Name·
How can i get rid of these bullets at the beginning and at the end of the translation???

When having activated Language Debug in the configuration, you will get these helpful bullets that indicates to you if a language key in the code has a corresponding string in the ini-file.

Had you used for example <?php echo JText::_('Name'); ?> in your code, and forgot to add a string in the ini-file for that key, and not having language debug on, then you probably wouldnt have noticed that the string was missing, because the output would be: Name

With language debug on and the string not present in ini-file you would see ?COMP_NAME? or the example ?Name? instead.

To get rid of the bullets, then just deactivate the handy Language debug ;)

_________________
Ole Bang Ottosen
redCOMPONENT Community Manager http://redcomponent.com
Personligt site www.ot2sen.dk
Dansk Joomla! support websted - joomla.dk


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 1:46 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Nov 13, 2008 11:23 am
Posts: 27
Ohh !!
thank you I was doing soo many tests than i completely forgot to deactivate the debug !!

thanks a lot !

albert


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 2:51 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 9:58 am
Posts: 9902
Location: Hillerød - Denmark
No problem at all.

Good to see your issue solved. :)

_________________
Ole Bang Ottosen
redCOMPONENT Community Manager http://redcomponent.com
Personligt site www.ot2sen.dk
Dansk Joomla! support websted - joomla.dk


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



Who is online

Users browsing this forum: No registered users and 114 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