component programming, xml file

This forum is for general questions about extensions for Joomla! 2.5.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
alireza-s
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Feb 06, 2013 3:55 pm

component programming, xml file

Post by alireza-s » Thu Jul 17, 2014 7:07 am

hi, i am going to create a new component.
i am using JText keys for translating in my xml form files.
i have a field type="list" with to options that i want use JText String Keys in the values. but it doesn't translated.
how can i use JText string keys in the value part of option fields in the xml forms to be translated?

i used a code like this but the COM_MYCOMPONENT_KEY_VALUE didn't translated!

<field type="list" ...>
<option value="COM_MYCOMPONENT_KEY_VALUE">COM_MYCOMPONENT_KEY</option>
</field>

thanks in advance!

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: component programming, xml file

Post by H13 » Sat Jul 19, 2014 8:03 pm

Hi, value is not translated as this item must be unique - not different for each language.

Value is not visible for users on the website so it is not translated, it is inside html code and when you e.g. submit the form, this is an unique item which is recognized for storing information to database.

So such item is not tranlsated because it cannot be translated - to be unique - to have the possibility to manage it after sending a form (storing parameters)

Is there any reason, why you need to have translated the value?

Jan
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

alireza-s
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Feb 06, 2013 3:55 pm

Re: component programming, xml file

Post by alireza-s » Wed Jul 23, 2014 8:29 am

Thanks for your answer Jan
my point was to show the string values to the end-users directly, instead of showing 1, 2, ... . but i got the point why Joomla doing this.
I think i should use a mapping function to show the strings to the users.
thanks again.


Locked

Return to “Extensions for Joomla! 2.5”