i am using joomfish for mulitilingual support on my website i add this php code below to the forms but joomfish does not use the
?lang=XX in the url every time only the first time you enter how can i make it show it even though it doesn't have that.
?lang=XX in the url every time only the first time you enter how can i make it show it even though it doesn't have that.
<? if (($_GET['lang']) == 'en')
{
$error = 'Please fill in the requiered fields';
$firstname = 'First Name: ';
$lastname = 'Last Name: ';
$companyname = 'Company Name: ' ;
$companytitle = 'Title: ' ;
$email2 = 'Email: ' ;
$telephone = 'Phone: ' ;
$interest = 'Service of Primary Interest: ' ;
}
else if (($_GET['lang'] == 'es'))
{
$error = 'Por favor llena los campos obligatoios marcados con un asteriscos.';
$firstname = 'Nombre: ';
$lastname = 'Apellido: ';
$companyname = 'Nombre de Compañia: ' ;
$companytitle = 'Titulo: ' ;
$email2 = 'Correo Electronico: ' ;
?>
Hi,
I'm not sure what you mean by "does not use the ?lang=XX in the url every time"? Is this when the page is submitted and there is a validation problem? Or when you use the same url a second time?
Bob
I'm not sure what you mean by "does not use the ?lang=XX in the url every time"? Is this when the page is submitted and there is a validation problem? Or when you use the same url a second time?
Bob
Hi,
You can switch joomfish languages by this variable :
This time languages by its name at the language manager!
Cheers
Max
You can switch joomfish languages by this variable :
<?php
global $mosConfing_lang;
if ($mosConfing_lang == 'english')
{
$error = 'Please fill in the requiered fields';
$firstname = 'First Name: ';
$lastname = 'Last Name: ';
$companyname = 'Company Name: ' ;
$companytitle = 'Title: ' ;
$email2 = 'Email: ' ;
$telephone = 'Phone: ' ;
$interest = 'Service of Primary Interest: ' ;
}
else if ($mosConfing_lang == 'espanish')
{
$error = 'Por favor llena los campos obligatoios marcados con un asteriscos.';
$firstname = 'Nombre: ';
$lastname = 'Apellido: ';
$companyname = 'Nombre de Compañia: ' ;
$companytitle = 'Titulo: ' ;
$email2 = 'Correo Electronico: ' ;
?>
This time languages by its name at the language manager!
Cheers
Max
Hi,
I'm pretty certain that Max meant to type $mosConfig_lang (without the extra 'n').
This is also a good place to use a switch statement:
Post edited by: GreyHead, at: 2007/06/20 13:50<br><br>Post edited by: GreyHead, at: 2007/06/20 13:53
I'm pretty certain that Max meant to type $mosConfig_lang (without the extra 'n').
This is also a good place to use a switch statement:
global $mosConfig_lang;
switch ( $mosConfig_lang) {
case 'espanish':
$error = 'Por favor llena los campos obligatoios marcados con un asteriscos.';
$firstname = 'Nombre: ';
$lastname = 'Apellido: ';
$companyname = 'Nombre de Compañia: ' ;
$companytitle = 'Titulo: ' ;
$email2 = 'Correo Electronico: ' ;
$telephone = 'Phone: ' ;
$interest = 'Service of Primary Interest: ' ;
break;
case 'english':
default:
$error = 'Please fill in the required fields';
$firstname = 'First Name: ';
$lastname = 'Last Name: ';
$companyname = 'Company Name: ' ;
$companytitle = 'Title: ' ;
$email2 = 'Email: ' ;
$telephone = 'Phone: ' ;
$interest = 'Service of Primary Interest: ' ;
break;
}
Bob
Post edited by: GreyHead, at: 2007/06/20 13:50<br><br>Post edited by: GreyHead, at: 2007/06/20 13:53
Yeah, good catch, thanks Bob!!!
Hi
I'm new to Chronoforms. I don't know where I have to put this code for switching the languages.
Thanks for your help.
Cheers
Chini
I'm new to Chronoforms. I don't know where I have to put this code for switching the languages.
Thanks for your help.
Cheers
Chini
Hi chini,
Exactly what are you trying to do?
There's an example in this thread of a form that switches between two languages depending on the language the user has in their profile. Would this do what you need?
Bob
Exactly what are you trying to do?
There's an example in this thread of a form that switches between two languages depending on the language the user has in their profile. Would this do what you need?
Bob
This is great! I was just asked about this.. where exactly do you put this wonderful bit of code? Does it go in the form html area or called in a file?
Hi,
You can do this in the form HTML box, use the $mosConfig_lang global variable to switch between different form codes based on language :
You can do this in the form HTML box, use the $mosConfig_lang global variable to switch between different form codes based on language :
<?php
global $mosConfig_lang;
if($mosConfig_lang == 'english'){
?>
English form code here
<?php
}else{
?>
French form code goes here
<?php
}
?>
Thank you so much! Worked great!
I'm testing this great component and my site is in spanish, can some one tell me how can I change the language only for the validation message errors?
Thanks in advance
Jos
Thanks in advance
Jos
Hi Jos,
The error messages are all in components/com_chronocontact/js/validation.js near the end of the file (around line 228). I think you can just replace the English phrase with a Spanish one. Here's the first one:[code] ['required', 'This is a required field.', function(v) {[/code]Bob
The error messages are all in components/com_chronocontact/js/validation.js near the end of the file (around line 228). I think you can just replace the English phrase with a Spanish one. Here's the first one:[code] ['required', 'This is a required field.', function(v) {[/code]Bob
thanks for your answer Bob,
To test, I changed only that line...
from:
['required', 'This is a required field.', function(v) {
to
['required', 'Este dato es requerido.', function(v) {
But now, it doesn't work the validation and using firebug it show me errors in the "v has no properties" in "validation.js" file.
Any clue how to fix that?
Regards
Jos
BTW I just paid for a license of your component.
To test, I changed only that line...
from:
['required', 'This is a required field.', function(v) {
to
['required', 'Este dato es requerido.', function(v) {
But now, it doesn't work the validation and using firebug it show me errors in the "v has no properties" in "validation.js" file.
Any clue how to fix that?
Regards
Jos
BTW I just paid for a license of your component.
Hi Jos,
Thanks for buying the license.
Changing the validation.js file works OK for me (see image). Please check carefully that there aren't any typos creeping in. I also had to force a cache refresh of the form page to get the new text to show up.
Bob
<br><br>Post edited by: GreyHead, at: 2008/01/04 12:15
Thanks for buying the license.
Changing the validation.js file works OK for me (see image). Please check carefully that there aren't any typos creeping in. I also had to force a cache refresh of the form page to get the new text to show up.
Bob

Thanks Bob, now is working.
I was using Joomla Xplorer to edit that file and at the end it was inserting " " instead of spaces, I don't no way, but the good news is that now is working my translation.
Regards
Jos<br><br>Post edited by: GreyHead, at: 2008/01/05 12:36
I was using Joomla Xplorer to edit that file and at the end it was inserting " " instead of spaces, I don't no way, but the good news is that now is working my translation.
Regards
Jos<br><br>Post edited by: GreyHead, at: 2008/01/05 12:36
Hey guys,
I am kind of getting the point of how to make the forms work with Joom!Fish. But i have like 6 languages on my site. What is the code then going to be? I'm totally not a PHP coder. I use the latest Chronoforms and Joomfish version.
Thanks in advance
I am kind of getting the point of how to make the forms work with Joom!Fish. But i have like 6 languages on my site. What is the code then going to be? I'm totally not a PHP coder. I use the latest Chronoforms and Joomfish version.
Thanks in advance
For joomla 1.5.x U need to use the following code :-)
thanks
RZ software
http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6516777
$lg = &JFactory::getLanguage();
$language = $lg->getBackwardLang();
thanks
RZ software
http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6516777
This topic is locked and no more replies can be posted.