CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to set lcMessages for CiviEvent Registration in Joomla
Pages: [1]

Author Topic: Best way to set lcMessages for CiviEvent Registration in Joomla  (Read 1002 times)

culturedtech

  • Guest
Best way to set lcMessages for CiviEvent Registration in Joomla
March 29, 2009, 06:19:53 pm
Hello.

I am looking for the best way to set the language in CiviEvent registration within Joomla.  This is a single-language CiviCRM install with 2-language Joomla using Joomfish. 

Currently I am doing this by: setting lcMessages in "com_civicrm/civicrm/CRM/Core/BAO/Setting.php" using the JFactory::getLanguage() function.  I have also modified Register.tpl, etc with {ts}..{/ts} tags.

This works, but I don't think it is the most stable way of doing it.  Is there a better way, for example by:

1) modifying one of the files in "/com_civicrm/civicrm/CRM/Event" such as CRM/Event/Form/Registration.php to set lcMessages?

2) modifying com_civicrm/civicrm/CRM/Utils/System/Joomla.php to set lcMessages?

Thanks.


culturedtech

  • Guest
Re: Best way to set lcMessages for CiviEvent Registration in Joomla
March 29, 2009, 06:28:33 pm
I forgot to mention the reason why I don't think modifying BAO/Setting.php is the best way:

setting lcMessages in Setting.php as described in another post conflicts with a multi-language CiviCRM install.  Although I am not using a multilanguage CiviCRM install, only a multilanguage Joomla install, this shows that setting lcMessages in Setting.php is not optimum.

The reason i don't use multilanguage CiviCRM is because I don't care how the label fields are stored in the database (which is what happens in multilanguage); I only need the label strings to be translated to the user during CiviEvent registration, and using {ts}..{/ts} is sufficient along with setting lcMessages.

Cheers.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Best way to set lcMessages for CiviEvent Registration in Joomla
March 30, 2009, 05:31:00 am
Quote from: culturedtech on March 29, 2009, 06:19:53 pm
I have also modified Register.tpl, etc with {ts}..{/ts} tags.

Is this a modification that could be useful to others? If so, can you share it with us, so we can put it in the next version?

Quote
This works, but I don't think it is the most stable way of doing it.  Is there a better way, for example by:

1) modifying one of the files in "/com_civicrm/civicrm/CRM/Event" such as CRM/Event/Form/Registration.php to set lcMessages?

2) modifying com_civicrm/civicrm/CRM/Utils/System/Joomla.php to set lcMessages?

I think either of these can be modified; I’m not 100% sure, but I guess both would be run before the strings are translated.

One thing you could try doing is making the Joomla! drop-down language switcher (if that’s what you’re using) trigger a CiviCRM-related page reload with the proper lcMessages set. Another approach would be to make the user go to the the CiviEvent forms through clicking a button; if that button would submit a minimal form with just the lcMessages set properly, CiviCRM should pickup the lcMessages setting from the POST variables (rather than from an explicit GET in the page’s URL).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to set lcMessages for CiviEvent Registration in Joomla

This forum was archived on 2017-11-26.