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:
I'm using Joomla 1.5 face-meh-blank
<?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
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
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
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?
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😉
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😉
Can somebody post the final code to use, following the original code and the edits, but can get it working.
Thanks
Lee
Thanks
Lee
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
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
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
Thanks
Lee
you can show me the final code you made only, the one you have in the HTML box!
Cheers
Max
Cheers
Max
I have tried loads of variations, here is what I have at the minute:
This displays no content.
Thanks
<?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
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
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;
}
?>
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
Thanks
Hi lw_d,
That's how the language files work in the basic Joomal 1.5 (without Joomfish) so it sounds perfect.
Bob
That's how the language files work in the basic Joomal 1.5 (without Joomfish) so it sounds perfect.
Bob
Thanks Bob, its a solution I really like, obviously a manual one, but that's perfect for me.
Lee
Lee
Good idea!
This topic is locked and no more replies can be posted.