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.
gscholman 23 Oct, 2008
Hey guys,

Hope you have a solution for this also, i want my form not in 2 different languages but in 8 (english, usa, dutch, german, polish, italian, french and russian). English and USA can be the same language. I really hope there is a solution for this beceause i really need this.

Regards,

Gijs
lw_d 23 Oct, 2008
Both methods above would work, as you can see, I couldn't get mine working with php language change, I instead, I inserted calls to the language file.

Either method could be adapted to include on of 8 languages.

Perhaps others can provide the php for listing more than two options in the PHP, I'm no PHP expert.
gscholman 24 Oct, 2008
That would be great, beceause i'm no PHP expert either. Anyway i should paste the PHP code provided in previous posts in my form code? I tried that but that is not really working...

Thank's in advance!

Regards,

Gijs
Max_admin 24 Oct, 2008
Hi Gijs,

Show me here a "piece" of your form code with one or two fields with their labels and I will show you an example!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gscholman 24 Oct, 2008
<div  class="form_item">
<div class="form_element cf_heading">
<h4 id="" class="cf_text">Personal details:</h4></div>
<div class="clear"> </div></div>
<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Name:</label><input class="cf_inputbox required" maxlength="150" size="30" id="text_2" name="text_2" type="text"></div>
<div class="clear"> </div></div>
<div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Organisation:</label><input class="cf_inputbox required" maxlength="150" size="30" id="text_3" name="text_3" type="text"></div>
<div class="clear"> </div></div>
<div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Address:</label><input class="cf_inputbox required" maxlength="150" size="30" id="text_4" name="text_4" type="text"></div>


These are the first 3 fields. I didn't yet label all the fields with a unique name (made this form with the Form wizard).
Max_admin 24 Oct, 2008
Ok, all you need to do is to replace labels in your code like :
Name
with:
<?php echo JText::_( 'NAME' ) ?>
for example and then go to the language file of your site and add:
NAME=Name
or
Name=Nom
whatever your language was.

Cheers,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 24 Oct, 2008
Hi gscholman,

Just to add a bit to Max's reply. You can safely use the format of
<?php echo JText::_( 'Please enter your name' ) ?>
If there is a language define like
PLEASE ENTER YOUR NAME=Geef uw naam
nl-NL.com_chronocontact.ini file or
PLEASE ENTER YOUR NAME=Inserisci il tuo nome
in the it-IT.com_chronocontact.ini file then Joomla will use these values depending on the current language setting for the site or the user. If the entry isn't found then it will default to 'Please enter your name'.

Bob
gscholman 24 Oct, 2008
Guys this is absolute fantastic it works great!! Thank you verry verry much, ill get a license soon to show my appreciation for your great and fast help!
disciple 01 Jan, 2009
Hi, I'm attaching the code I'm trying to use according what I read in the forums (I use joomla 1.5.8 and Joomfish 2.0) - I've have tried the 2 options you suggested and in both I can't get it work. I will begin with the first option:
1.
<?php
    $lang =& JFactory::getLanguage();
    echo $lang->getName();
    switch ( $lang->getName() ) {
    {
      case 'English':
    ?>


[b]
<div  class="form_item"><div class="form_element cf_heading"><h3 id="" class="cf_text">Online Trading Platform</h3></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_text"><span class="cf_text">Please fill the details below in order to open a new account</span></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Name</label><input class="cf_inputbox required validate-alphanum" maxlength="50" size="30" id="text_2" name="text_2" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Name :: Please fill your name here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Last Name</label><input class="cf_inputbox validate-alphanum" maxlength="50" size="30" id="text_4" name="text_4" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Last Name :: Your last name</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Phone</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_6" name="text_6" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Phone :: Your Home/Office number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Mobile</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_7" name="text_7" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Mobile :: Your Mobile number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Email</label><input class="cf_inputbox required validate-email" maxlength="50" size="30" id="text_5" name="text_5" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Email :: like myemail@myhost.com</div><div class="clear"> </div></div></div>
<div  class="form_item"><div class="form_element cf_button"><input value="Online Trading" name="undefined" type="submit"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Online Trading :: Continue to online trading</div></div><div class="clear"> </div></div>[/b]

    <?php
      break;

      case 'Hebrew':
      default:
    ?>
    <div  class="form_item"><div class="form_element cf_heading"><h3 id="" class="cf_text">Online Trading Platform</h3></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_text"><span class="cf_text">אנא מלא את הפרטים הבאים כדי לפתוח חשבון</span></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Name</label><input class="cf_inputbox required validate-alphanum" maxlength="50" size="30" id="text_2" name="text_2" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Name :: Please fill your name here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Last Name</label><input class="cf_inputbox validate-alphanum" maxlength="50" size="30" id="text_4" name="text_4" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Last Name :: Your last name</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Phone</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_6" name="text_6" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Phone :: Your Home/Office number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Mobile</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_7" name="text_7" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Mobile :: Your Mobile number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Email</label><input class="cf_inputbox required validate-email" maxlength="50" size="30" id="text_5" name="text_5" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Email :: like myemail@myhost.com</div><div class="clear"> </div></div></div>
<div  class="form_item"><div class="form_element cf_button"><input value="Online Trading" name="undefined" type="submit"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Online Trading :: Continue to online trading</div></div><div class="clear"> </div></div>
<?php
      break;
}
?>
In this case I get this error: Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}'' in C:\xampp\htdocs\gofxtrade\components\com_chronocontact\chronocontact.html.php(320) : eval()'d code on line 5

2. In this case I've tried this:
<div  class="form_item"><div class="form_element cf_heading"><h3 id="" class="cf_text">Online Trading Platform</h3></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_text"><span class="cf_text"><?php echo JText::_( 'Please fill the details below in order to open a new account' ) ?></span></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Name</label><input class="cf_inputbox required validate-alphanum" maxlength="50" size="30" id="text_2" name="text_2" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Name :: Please fill your name here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Last Name</label><input class="cf_inputbox validate-alphanum" maxlength="50" size="30" id="text_4" name="text_4" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Last Name :: Your last name</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Phone</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_6" name="text_6" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Phone :: Your Home/Office number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Mobile</label><input class="cf_inputbox validate-number" maxlength="50" size="30" id="text_7" name="text_7" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Mobile :: Your Mobile number</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Email</label><input class="cf_inputbox required validate-email" maxlength="50" size="30" id="text_5" name="text_5" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Email :: like myemail@myhost.com</div><div class="clear"> </div></div></div>
<div  class="form_item"><div class="form_element cf_button"><input value="Online Trading" name="undefined" type="submit"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" width="16" height="16"></a><div  class="tooltipdiv">Online Trading :: Continue to online trading</div></div><div class="clear"> </div></div>
I've created inside \language\he-IL\ directory the file he-IL.com_chronocontact.ini and put the [english=hebrew] lines BUT it doesn't work.

Thank you very much for your help
GreyHead 01 Jan, 2009
Hi disciple,

The Error message is because you have a misplaced { in your code. The first block should be something like this
<?php
$lang =& JFactory::getLanguage();
// echo $lang->getName(); // <--only use this in testing to get the correct language name
switch ( $lang->getName() ) {
     case 'Hebrew' :
?>
        //put the Hebrew form html here 
<?php
        break;
        case 'English' :
        default :
?>
        //put the English form html here 
<?php
        break;
}
?>

Bob
disciple 01 Jan, 2009
Thank you!!! It works now.
ifritz 11 Jan, 2009
Works for me too. But how do you handle the "requires fields" advice text?
Translation within the source code? Or is there a possibility to change the text
in the form code menu?
GreyHead 11 Jan, 2009
Hi ifritz,

You can add it in the title attribute of the tag that calls the validation
<input . . . class='required' title="You gotta type stuff in here!" />
There's also an option to put it in a separate div but I forget the syntax - ask me tomorrow if you need it.

Bob
ifritz 12 Jan, 2009
Nae bother. Works great for me. Thx a lot.
bobanmak 25 Mar, 2009
Nice threat overhere, but I really need some help.
I'm using 2 chrono forms and 4 languages in my web site, but i can't understend some things here.
1. How can i see my form code? ( so i can replace labels)
2. Which method is easy to use to make this working.?
3. Which language file I need to edit and add the fields?

( Sorry for my language mistakes🙂 )
GreyHead 25 Mar, 2009
Hi bobanmak,

The latest release RC3 has a multi-language plugin that you can try out.

Bob
bobanmak 27 Mar, 2009

Hi bobanmak,

The latest release RC3 has a multi-language plugin that you can try out.

Bob



Thanks Bob,
this release it's very good🙂 Congratulations!
But I need a little bit help here.. What I need to put in "Language Strings" , can u give me a sample :

Boban
Max_admin 27 Mar, 2009
Hi,

regarding the plugin in the link, can you please reply in that thread so the owner can respond to your problem ? the plugin is not mine and I may not be able to help with it yet!

regarding the built in Chronoforms plugin for multi language, tell me please what are you trying to translate ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
bobanmak 28 Mar, 2009

Hi,

regarding the plugin in the link, can you please reply in that thread so the owner can respond to your problem ? the plugin is not mine and I may not be able to help with it yet!

regarding the built in Chronoforms plugin for multi language, tell me please what are you trying to translate ?

Max



I'm trying to translate the frontend form with the intro text (I need 4 languages site). I need some help for the syntax, an what I need to put in "Language Strings" . Please give me an example . ( I use the latest rc3 chrono forms version)

Boban
Max_admin 28 Mar, 2009
Hi Boban,

you must have the multi language plugin enabled in the plugins tab of the form!

now in the forms manager, check the form and open the multi language plugin config page!

follow the guidelines in the page, here is my config for a 2 languages form, English and french with English set as the default language!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
bobanmak 31 Mar, 2009

Hi Boban,

you must have the multi language plugin enabled in the plugins tab of the form!

now in the forms manager, check the form and open the multi language plugin config page!

follow the guidelines in the page, here is my config for a 2 languages form, English and french with English set as the default language!

Cheers
Max


Thanks a lot. This is so simple, and very helpfull.

Boban
steveg 03 Apr, 2009
Thanks for the instructions. Very helpful!

i found the plugin offered by simpleweb did not work for me. The multi language plugin in RC3 was much better.
chelramsey 04 Apr, 2009
I am able to translate 1 string on my form, but can not seem to translate the actual form element labels?

Any word on how to accomplish this?
GreyHead 04 Apr, 2009
Hi Chel,

I see you found the thread,

I think you just add the text you want to translate on a new line

Label1=This is the label for this field
Label2=This is the label for the other field
===
Label1=Dette er betegnelsen for dette område
Label2=Dette er betegnelsen for de andre områder

Bob
chelramsey 04 Apr, 2009
Yes I did🙂

Ok let me try that. Will report! I was not using Label 1= I was putting the actual string Ihr Name=Nome etc
Max_admin 07 Apr, 2009

Ok let me try that. Will report! I was not using Label 1= I was putting the actual string Ihr Name=Nome etc



this should work fine too!🙂

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zencso 08 Apr, 2009
Hi guys,

This multi language plugin is brillinat!

Is it possible to translate somehow the validation messages (like This is a required field.) as well?
I was not able to do that with the above plugin. Nevertheless find the file including these verification terms, but have no idea what to do?

If you have any suggestions, please let me know.

Thx in advance
GreyHead 08 Apr, 2009
Hi zensco,

There are a couple of ways round this - the easiest is to use a title attribute e.g. title='Ovo polje je obavezan unos' in the input tag.

Bob
zencso 08 Apr, 2009
Hi Bob,

Thanks for your quick action!
Honestly as I am not experienced with chronoforms it is a bit too much for me :-)
What is the imput tag? Where should I paste the above title attribute?

Please detail this trick!

Thanks
GreyHead 08 Apr, 2009
Hi zensco,

This is basic html - there are good tutorials at w3schools.com

Bob
zencso 09 Apr, 2009
Contrary to the fact I have checked several tutorials I cannot overcome this issue.

Could you please provide me with some exact examples?
Your help would be highly appreciated.

Thx in advance
Max_admin 10 Apr, 2009
Hi zencso,

please show me your form code and tell me one field of those you want to change the validation message for!

Regards
Max
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.

VPS & Email Hosting 20% discount
hostinger