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.084 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started