Forums

chrono with joomfish

NickN 23 Jun, 2008
Hi there! Hope you have an solution for me how to use two language form with joomfish. Have tried to put both in one form with this code:
<?php
$lang =& JFactory::getLanguage();
switch ( $lang->getName() ) {
  case 'english':
?>
english form code
<?php
  break;

  case 'nederlands':
  default:
?>
Dutch form code
<?php
  break;
}
?>
......but this solution is not working for me. Form jumps to default language and stays there. Do someone knows how to?
I'm using Joomla 1.5 face-meh-blank
GreyHead 25 Jun, 2008
Hi NickN,

Add a line of code to echo $lang->getName() and see what values are being returned. This *should* work if you have the correct (case-sensitive) values in the cases.

Bob
NickN 25 Jun, 2008

Hi NickN,

Add a line of code to echo $lang->getName() and see what values are being returned. This *should* work if you have the correct (case-sensitive) values in the cases.

Bob



Tnx for the replay Bob. I have replaced the code:
switch ( $lang->getName() )

With this one:
echo $lang->getName();?>

This is the replay I have:
Parse error: syntax error, unexpected T_CASE in W:\var\www\test\components\com_chronocontact\chronocontact.html.php(83) : eval()'d code on line 72

I supposed to change the case to right one (line 72 is the case)? Is this right?
NickN 25 Jun, 2008
Resolved!!!:woohoo:
Thank you man to point me the right way. My case was not right, echo showed me the right language. Replaced and runs like hell🙂
Great tool, time to by a license😉
lw_d 20 Oct, 2008
Can somebody post the final code to use, following the original code and the edits, but can get it working.

Thanks
Lee
Max_admin 20 Oct, 2008
Hi Lee,

whats your joomla version ? can you show me the progress you made with the code, the steps above posted by Bob are straight forward.

cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lw_d 21 Oct, 2008
Hi Max, my Joomla version is 1.5.7, I am working locally, since the site is still in production, I will try to upload today and pm you a link.

Thanks
Lee
Max_admin 21 Oct, 2008
you can show me the final code you made only, the one you have in the HTML box!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lw_d 21 Oct, 2008
I have tried loads of variations, here is what I have at the minute:

<?php
$lang =& JFactory::getLanguage();
echo $lang->getName();
switch ( $lang->getName() ) {
 {
  case 'english':
?>

english form code

<?php
  break;

  case 'welsh':
  default:
?>
Welsh form code


This displays no content.

Thanks
lw_d 21 Oct, 2008
I have also tried this:

<?php
$lang =& JFactory::getLanguage();
echo $lang->getName() ) {
 {
  case 'english':
?>

english form code

<?php
  break;

  case 'welsh':
  default:
?>
Welsh form code
Max_admin 21 Oct, 2008
you should try this :

    <?php
    $lang =& JFactory::getLanguage();
    echo $lang->getName();
    switch ( $lang->getName() ) {
    {
      case 'english':
    ?>

    english form code

    <?php
      break;

      case 'welsh':
      default:
    ?>
    Welsh form code
 <?php
      break;
}
?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lw_d 22 Oct, 2008
Unfortunately, I still don't see any text, can't figure it out😟

Lee
lw_d 22 Oct, 2008
I have managed to create a bilingual form by adding the labels as <?php echo JText::_( 'LABELHERE' ) ?>, I can then go into the two language files and create to separate labels, not sure if this is a good way of doing it, but it works for me.

Thanks
GreyHead 22 Oct, 2008
Hi lw_d,

That's how the language files work in the basic Joomal 1.5 (without Joomfish) so it sounds perfect.

Bob
lw_d 22 Oct, 2008
Thanks Bob, its a solution I really like, obviously a manual one, but that's perfect for me.

Lee
Max_admin 22 Oct, 2008
Good idea!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.