deploying a language into a component

A place to discuss Joomla! translation matters.

Moderator: wendhausen

Locked
amoreno
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Thu Nov 13, 2008 11:23 am

deploying a language into a component

Post by amoreno » Wed Oct 14, 2009 11:09 am

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

User avatar
ot2sen
Joomla! Master
Joomla! Master
Posts: 10381
Joined: Thu Aug 18, 2005 9:58 am
Location: Hillerød - Denmark
Contact:

Re: deploying a language into a component

Post by ot2sen » Wed Oct 14, 2009 12:42 pm

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
Dansk frivillig Joomla! support websted - joomla.dk
OpenTranslators Core Team opentranslators.org

amoreno
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Thu Nov 13, 2008 11:23 am

Re: deploying a language into a component

Post by amoreno » Wed Oct 14, 2009 1:46 pm

Ohh !!
thank you I was doing soo many tests than i completely forgot to deactivate the debug !!

thanks a lot !

albert

User avatar
ot2sen
Joomla! Master
Joomla! Master
Posts: 10381
Joined: Thu Aug 18, 2005 9:58 am
Location: Hillerød - Denmark
Contact:

Re: deploying a language into a component

Post by ot2sen » Wed Oct 14, 2009 2:51 pm

No problem at all.

Good to see your issue solved. :)
Ole Bang Ottosen
Dansk frivillig Joomla! support websted - joomla.dk
OpenTranslators Core Team opentranslators.org


Locked

Return to “Translations”