Joom!Fish and Javascript validation messages

tonalt 08 May, 2008
Hello

I just moved to ChronoForms from FacileForms, because FacileForms wasn't supporting Joomla! 1.5. And ChronoForms seems to be great, thanks for that. But...

I have now read all posts here concerning about Joom!Fish translations etc.. My idea to handle form translation is to make a form in one language, and after that copy it and just replace all texts with desired language and name your form like myFrom_languageCode. After that make one content page in your Joomla! for the form and put there {chronocontact}myFrom_languageCode{/chronocontact} (you got to install chronocontact plugin and enable it). Then you can translate this content page with Joom!Fish and just change the myFrom_languageCode depending on your language.

But.. there still is problem with the javascript validation messages. All I found here is to edit strings in components\com_chronocontact\js\validation.js, but that is hard coding, and the strings doesn't change depending on your selected language in Joom!Fish.

I have a site with 3 languages (English, Finnish and Swedish), and I'm now thinking that I have to change the source code of the Chrono component to get around with this.. copy the validation.js for all the languages like validation_en.js, validation_fi.js, validaion_se.js, and just load the right one depending on the selected language.
GreyHead 09 May, 2008
Hi tonalt,

Yes, I'm afraid that is a real problem. It just needs someone to pull out the language variables into a separate file . . . It has been suggested that the easy way to do that would be to generate the js files on the fly from a PHP master.

Bob
laurent21 14 Jul, 2010
Hello, I have got a forms in two languages. I use Joomfish to manage the translation. For the validation, what is the code to include the right language file (validation-en.js...) in the form?
Thanks if you can help
Laurent
GreyHead 26 Jul, 2010
Hi laurent21 ,

There isn't a validation-en.js file (or for any other language) :-(

Bob
laurent21 26 Jul, 2010
Hi, I found a solution: in Chronocontact.html.php (www\components\Chronocontact)
I replaced:
<script src="<?php echo $CF_PATH.'components/com_chronocontact/js/'; ?>jsvalidation2.js" type="text/javascript"></script>:
by:
<script src="<?php echo $CF_PATH.'components/com_chronocontact/js/'; ?>jsvalidation2-<?php echo $_GET['lang']; ?>.js" type="text/javascript"></script>

I then duplicated the validation2.js as validation2-en.js and validation2-fr.js so I can custom messages by languages

I hope this helps!
Laurent
This topic is locked and no more replies can be posted.