Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 10:24 am (All times are UTC )

 





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

Joined: Thu Nov 13, 2008 11:23 am
Posts: 14
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
  E-mail  
 
Posted: Wed Oct 14, 2009 12:42 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar
Online

Joined: Thu Aug 18, 2005 9:58 am
Posts: 8101
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 - Joomla! Translation Coordination Team
Joomla Leadership Team - Production Working Group - i18n/l10n/translation

Webløsninger og professionel support http://www.ot2sen.dk | Dansk Joomla! support - http://joomla.dk/


Top
  E-mail  
 
Posted: Wed Oct 14, 2009 1:46 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

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

thanks a lot !

albert


Top
  E-mail  
 
Posted: Wed Oct 14, 2009 2:51 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar
Online

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

Good to see your issue solved. :)

_________________
Ole Bang Ottosen - Joomla! Translation Coordination Team
Joomla Leadership Team - Production Working Group - i18n/l10n/translation

Webløsninger og professionel support http://www.ot2sen.dk | Dansk Joomla! support - http://joomla.dk/


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

Quick reply

 



Who is online

Users browsing this forum: No registered users and 21 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 © 2000, 2002, 2005, 2007 phpBB Group