Welcome, Guest
Username: Password: Remember me

TOPIC: Multilanguage for JDOM

Multilanguage for JDOM 15 Apr 2012 06:05 #1989

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
How can I use the component generated language variables into JDOM output?
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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 administrator has disabled public write access.
The following user(s) said Thank You: Tomaselli

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

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
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 administrator has disabled public write access.
The following user(s) said Thank You: devil
Time to create page: 0.082 seconds

Get Started