Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Multilanguage for JDOM 15 Apr 2012 06:05 #1989

How can I use the component generated language variables into JDOM output?

Please Log in or Create an account to join the conversation.

Re: Multilanguage for JDOM 15 Apr 2012 08:45 #1995

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In JDom, you can call getExtension() to return the current component alias 'com_xxxx'.

With that, you can reconstruct a language var.

Second possibility is to send them in parameters of the control that need it (declare them in __construct)
(see example in html.form.input.select)
Coding is now a piece of cake
The following user(s) said Thank You: Tomaselli

Please Log in or Create an account to join the conversation.

Re: Multilanguage for JDOM 15 Apr 2012 10:27 #1998

Thanks, admin you pointed me to the right direction.
for anyone who may need it, this is how I did:

added the following code in PHP file of the jdom item:
$language = JFactory::getLanguage();
$language->load('com_XXXX');


then you can just use the variable. for example:

$strYES = "COMXXXX_FIELD_ONLINE";
$strNO = "COMXXXX_FIELD_OFFLINE";

for reference:
docs.joomla.org/Specification_of_language_files
The following user(s) said Thank You: devil

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.056 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started