Forums

Multilanguage issues, have seen previous posts

betovarg 10 Aug, 2008
Hi,
Im trying to set up a form with multilangiage support, and I have read previous posts about it.
(http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=9752#9752 and http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=10092&st=0&sk=t&sd=a)

I asume the code I pasted works, because I get to see the form in the default language. Also, i tried pasting the echo code to receive the right case of my languages, but when i enter the echo bit of code the page shows up blank, it doesnt give me the case of the language. The eco code is:

echo $lang->getName();?>


and the code for the form is:
 <?php
    $lang =& JFactory::getLanguage();
    switch ( $lang->getName() ) {
      case 'Spanish':
      default:
    ?>
    Spanish form code
    <?php
      break;

      case 'English':
    ?>
    English
    <?php
      break;
    }
    ?>


Is there a reason why i get a blank screen when i use the echo?
im using joomla 1.5.4, with joomfish 2.0 beta

Thanx
Max_admin 10 Aug, 2008
Hi, actually your echo code should be exactly like this :

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


??
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 10 Aug, 2008
Hi betovarg,

Try
<?php
$lang =& JFactory::getLanguage();
echo $lang->getName();
?>
and the default needs to be the last case in the switch statement as it cathes anything that hasn't been specifically identified.
<?php
    $lang =& JFactory::getLanguage();
    switch ( $lang->getName() ) {
       case 'English':
?>
    English
<?php
      break;

      case 'Spanish':
      default:
?>
      Spanish form code
<?php
      break;
    }
 ?>

Bob
betovarg 11 Aug, 2008
Thank you for yor replies, actually quite fast!
I have this code pasted:

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

    <?php
        $lang =& JFactory::getLanguage();
        switch ( $lang->getName() ) {
           case 'English (United States) ':
    ?>
        English
    <?php
          break;

          case 'EspaƱol (spanish formal Internacional)':
          default:
    ?>
          Spanish form code
    <?php
          break;
        }
    ?>


So, first i can see the case code throught the echo, and then the form. But im still seeing always the default. I uninstalled the english (great brittain) from the languages in joomla, and modified the codes for the languages in joomfish, basically to change the english code from "us" to "en", as in "Itemid=53&lang=en".

You think my issue has something to do with it?

Thanx!
GreyHead 11 Aug, 2008
HI betovarg,

Possibly - having the debug echo statement should let you see what language codes Joomla is using. Then make sure they are matched in the switch code.

Bob
betovarg 11 Aug, 2008
Thank you!
I returned the joomfish codes to the defaults and now it seems to work. This can be marked as solved.

Thank you!
great component!
This topic is locked and no more replies can be posted.