SOLVED-Need form, validation, message to be bilingual?

Chacapamac 01 Jun, 2011
I Need my form, validation and message to be bilingual?

I’m using Joomfish? (French and English)

I like the send Joomla confirmation email to be in the right language as well...

Where to start?

Joomla 1.5.23

Thanks!
GreyHead 01 Jun, 2011
Hi Chacapamac ,

You start with the Multi Language action - that will let you translate the text in your form.

For the emails, at the moment the simplest option is probably my custom Email action (from here) which allows you to set a condition for sending an email; you'd set up two copies and make the sending conditional on the user language.

Bob
Chacapamac 01 Jun, 2011
I download the Email plugin and will try in an instant... But I gess I will have to go live to really test it (I’m working on a local Joomla installation with MAMP)

1— I was thinking that because my form is a User Joomla Registration that Joomla will send the normal confirmation email in the right language????

2— Are the normal Confirmation reply notice will be sent for my users to validate their inscription?

3— Are Joomfish/Joomla will send the appropriate Confirmation reply notice in the right language....?


For the translation of the form I will follow your excellent tutorial here :
http://chronoengine.com/tutorials/chronoforms-plugins/435-setup-a-multi-language-form.html

THANKS !


4— Should I use CFv4 Show HTML [GH] action
as it has multi-language support for the validation error messages. The action will load validation language files depending on the user's current language selection.?
GreyHead 01 Jun, 2011
Hi Chacapamac,

1 & 2: Yes I think so,

3: I'm not sure, haven't tried and ChronoForms isn't always Joomfish compatible.

The multi-lingual tutorial was written for ChronoForms 3.1 and CFv4 differs in several places.

I think that CFv4 RC1.9 has fixed some of the validation language bugs - but I still think my action handles it better for multi-lingual sites.

Bob
Chacapamac 01 Jun, 2011
Thanks, Youre plugin work almost perfectly

As the new kid on the block I’m, so far impressed.

This is my language from french to english...

ZONE D’INSCRIPTION (obligatoire)= REGISTRATION ZONE (required)
Votre Nom=Your Name
Votre nom reste confidentiel !=Your name is kept confidential
Choisir un nom d’usager=Choose a username
Votre alias sur EZH — GARDER EN NOTES — NÉCESSAIRE POUR LOGIN=Your alias on EZH — NECESSARY TO LOGIN
Adresse courriel=Email
Une adresse courriel valide.=A valid email address.
Entrer un mot de passe=Enter a password
Le mot de passe qui vous identifiera. GARDER EN NOTES — NÉCESSAIRE POUR LOGIN=Password to identify you — NECESSARY FOR LOGIN
Vérifier le mot de passe= Password verification
Entrer une seconde fois pour vérification.=Enter a second time to verify.
ZONE D’INFORMATION (optionnel)=INFORMATION ZONE
Qui étes-vous? (optionnel)=Who are you? (optional)
Organisation=Organisation
Association=Association
Club de hockey=Hockey Club
Ligue de hockey=Hockey Ligue
Fournisseur=Supplier
Fan=Fan
Dites-nous à quel groupe vous appartenez — (optionnel) Merci !=Tell us to what group you belong - (optional) Thank’s!
Laisser nous un commentaire=leave us a commentary
Laisser nous un message — (optionnel)=Leave us a message (optional)
FINALISER L’INSCRIPTION (obligatoire)=FINALISE YOUR REGISTRATION (required)
Entrer le code S.V.P=Enter the code S.V.P 
Pour éviter le “Spam” — Merci !=To avoid Spam — Thanks!
Soumettre votre inscription=Submit your registration


The only problems I have so far is:

The 3 Header Text are not translate (Header Text Element)
ZONE D’INSCRIPTION (obligatoire)
ZONE D’INFORMATION (optionnel)
FINALISER L’INSCRIPTION (obligatoire)
Max_admin 03 Jun, 2011
Hi,

Just a note, the default Email action should pass the email template through the "Multi language" as well😉

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Chacapamac 05 Jun, 2011
Well NOT SOLVED

It seem like certain parts of the validation are not translated
Stuff like:
Passwords do NOT match.
This field should NOT be empty
This field is required.
This field should NOT be empty
This field should contain alphabetic characters only.
This field should contain an email address.
Please choose a value

are not translated

Everything else that is input in Chrono seem to work perfect with your language action.....

Do you have an idea???
GreyHead 05 Jun, 2011
Hi Chacapamac,

These are all from the JavaScript validation - the bubble tips that show over the form?

Which version of the Show HTML action are you using?

Bob
Chacapamac 08 Jun, 2011
Thanks for your patience.... 🙂

Yes the Bubble Tips


Yes, they come (if I’m right) from the files formcheck-yui.js and the language files —> en.js of fr.js.

???? That don’t seem to work??????

I use the normal Show HTML not the GH version

What are the difference between Show HTML, Email and Show HTML (GH), Email (GH)
GreyHead 08 Jun, 2011
Hi Chacapamac,

The main difference in the [GH] actions (my 'advanced' versions) are listed here.

The Show HTML [GH] action includes code that will check the User's current language and load the appropriate Validation language file.

The standard Show HTML action (I think) loads the single language that you have specified on the Form JS Validation tab.

Bob
Chacapamac 08 Jun, 2011
I replace Show html with the GH

Clear joomla and browser cache

Validation balloon still only English????

Infos—
• Form in a lightbox
• Originating page url with the link to lightbox is ....................lang=fr



Should the “Enable JS Validation” be turn on or off. ( I try both)

When do you use JS validation?
GreyHead 08 Jun, 2011
Hi Chacapamac,

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

The JavaScript (JS) validation is the browser-side validation that show the error messages as bubbles.

Bob
Chacapamac 08 Jun, 2011
I will put the form live soon. I will overlook that problem and send you an url...

My last try is

Enable JS Validation = Yes

Show HTML (GH)

Clear all cache,history cookies.....

Notes:
• If I change the language in the JS Validation settings, the language of the bubbles changes.

I think the problems is related with the forms excluding the rest of the template to be alone in the lightbox and not bringing the originating language information....

I add that code —>
<?php
$uri =& JFactory::getURI();
if ( $uri->getVar('tmpl') != 'component' ) {
  $uri->setVar('tmpl', 'component');
  $mainframe->redirect($uri->toString());
}
?>
in the code to acheive that — (Form Type Custom)

Thanks
GreyHead 10 Jun, 2011
Hi Chacapamac,

I'm sorry but I'm not clear what your question is?

Bob
Chacapamac 11 Jun, 2011
The fom will be live soon —

The validation bubble dont get translated.
• If I changed the form language in chrono— the bubble take the new language
• If I change the language by Joomfish the forms and validation messages get translated but not the bubble (I understand it’s another system, I think!)

I think the problem have to do with the form being in a modal box....
polderguy 27 Nov, 2011
Chacapamac,

It seems as long as the jsvalidation_lang parameter is set to a value (eg en-GB)
that value will be used.
So first remove the value for the jsvalidation_lang parameter in the database.
(I have not found a way to do this from Joomla Admin - Forms Manager).

Then the code uses the strstr() function with a 3th argument (boolean) which was
introduced in PHP 5.3.0.
This function will fail if your PHP < 5.3.0.

If PHP < 5.3.0 replace the following line in cfaction_show_html_gh.php:

$short_tag = strstr($tag, '-', true);

with:

$short_tag = substr($tag,0,strpos($tag,'-'));

After taking care of both things it worked for me.

PolderGuy
GreyHead 28 Nov, 2011
Hi Polderguy,

I agree that there is a design problem with my Show HTML action. I has assumed that if a language was specifically set then it shouldn't change. What I hadn't factored in was that Max hasn't put a 'no value' option in the language selector so you set a language as soon as you save the Form after viewing the 'General' tab set :-( There's another thread about this problem in the forums here.

You can workaround this by commenting out the three lines shown below in cfaction_show_html_gh.php around line 180
	//	$short_tag = $form->form_params->get('jsvalidation_lang', '');
		// if ( !$short_tag ) {
			$lang =& JFactory::getLanguage();
			$tag = $lang->getTag();
			$dtag = $lang->getDefault();
			if ( !$tag ) {
				$tag = $dtag;
			}
			$short_tag = strstr($tag, '-', true);
		//}

You can also edit the strstr() line here - though it's probably more useful to upgrade your PHP version.

Bob
Max_admin 01 Dec, 2011
Hello,

A small code snippet in a "Custom code" box before the "Show HTML" action would do the trick:


<?php
$form->form_params->set('jsvalidation_lang', "new_Language");
?>


You can detect the "new_Language" and pass it some how.

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.