Forums

New JS Validation Language

drkoray 16 Jul, 2011
Hi,
First thank You very much for this nice work Chronoform.
I made a form and can send without any problem.
But i want use a language that is not in the LS Validation Language list. I want use turkish language. I copied the en.js file under js\formcheck\lang folder translated a bit and renamed to tr.js and uploaded to the same folder.
But i can't see Turkish in the list.
What shall i do? What is my mistake?
Sincerely

I use Joomla 1.6.3 and Chronoforms 4.0 RC1.9
My form address is: http://www.tgd.org.tr/index.php?option=com_chronoforms&chronoform=TGD_ERCP_Calisma_Grubu
GreyHead 16 Jul, 2011
Hi drkoray,

It looks as though the list isn't updated automatically.

If you edit administrator/components/com_chronoforms/views/edit.php around line 82 you'll see
		<?php echo $HtmlHelper->input('params[jsvalidation_lang]', array('type' => 'select', 'label' => 'JS Validation Language', 'value' => $params->get('jsvalidation_lang', 'en'), 'options' => array('en' => 'English', 'fr' => 'French', 'de' => 'Deutsch', 'nl' => 'Dutch', 'es' => 'Spanish', 'da' => 'Danish', 'it' => 'Italian', 'jp' => 'Japanese', 'cn' => 'Chinese', 'ru' => 'Russain', 'pt' => 'Portugese', 'gr' => 'Greek', 'pl' => 'Polish', 'ro' => 'Romanian', 'fa' => 'Farsi'), 'default' => 'en')); ?>
You can add more languages to this list
<?php 
echo $HtmlHelper->input('params[jsvalidation_lang]', 
  array(
    'type' => 'select', 
    'label' => 'JS Validation Language', 
    'value' => $params->get('jsvalidation_lang', 'en'), 
    'options' => array(
      'en' => 'English', 
      'cn' => 'Chinese', 
      'da' => 'Danish', 
      'de' => 'Deutsch', 
      'nl' => 'Dutch', 
      'fa' => 'Farsi',
      'fr' => 'French', 
      'gr' => 'Greek', 
      'it' => 'Italian', 
      'jp' => 'Japanese', 
      'pl' => 'Polish', 
      'pt' => 'Portugese', 
      'ro' => 'Romanian', 
      'ru' => 'Russian', 
      'es' => 'Spanish', 
      'tr' => 'Turkish'
    ), 
    'default' => 'en'
  )
);
?>

Bob
drkoray 16 Jul, 2011
Hi bob,
Thank You very much.
The problem is solved.
I attached my translated tr.js file.
If i update, it i will send it too. Perhaps You can include it to the next versiyon of Chronoforms.
Sincerely,
GreyHead 16 Jul, 2011
Hi drkoray,

Teşekkür ederim - which I can say but not spell :-(

Bob
Zahorijs 03 Jan, 2012
Thank you, GreyHead, for your help!

I wanted to give back, so I made a Latvian translation.
GreyHead 03 Jan, 2012
Hi Zahorijs,

Thank you.

Bob
ifritz 28 Feb, 2012
Does this apply to Joomla 1.5 and CF V4 RC3.2 as well? As i am looking for the language settings for the validation.
GreyHead 28 Feb, 2012
Hi iFritz,

Not sure what you are asking but the only change I saw in the latest release is the addition of a Slovakian translation.

Bob
ifritz 29 Feb, 2012
Hi Bob,

i was looking into my edit.php, and could not find any lines like the ones shown above...
Basically i was looking for the default value of the validation language in the forms.
GreyHead 29 Feb, 2012
Hi ifritz,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.

Bob
ifritz 29 Feb, 2012
Its 4.0 RC3.2.
GreyHead 29 Feb, 2012
Hi iFritz,

Try /components/com_chronoforms/js/formcheck/lang/en.js

Bob
ifritz 19 Mar, 2012
Ok, but where can i define which default language to use on validation?
I'm using three languages....
GreyHead 20 Mar, 2012
Hi ifritz,

If the standard Show HTML action isn't picking up the language then try using my Custom Show HTML action; that should load the correct validation language automatically. (Note: it may need a little updating to match the latest release of CF - let me know if you find any problems).

Bob
LouisTran 29 May, 2012
Thanks, but my site is multi language and i want to display the error message belong the language which users are using. I created 3 form (all same) for each language. English is ok but Korean and vietnamese i did not find in JS validation.

I created new and copied a language file vi.js to /formcheck/lang but its also not appear in js validation language

Maybe i did something wrong but dont know, pls help
GreyHead 31 May, 2012
Hi LouisTran,

Please check this post from earlier in the thread.

Bob
fuxo 05 Dec, 2012
Hi Bob,
here is Slovak translation of validation messages.
You can include it to the next version of Chronoforms.
GreyHead 05 Dec, 2012
Hi fuxo,

Thank you. I've added it to the languages FAQ here

Bob
SubCon 29 Jan, 2013
I have translated to hebrew, so you could add this.
[attachment=0]he.zip[/attachment]

Also I found a few typo's in the english version:
line 16:
differs: "This value must be different of %0"
I guess it should be "from"

line 19:
lengthmax: "The length is incorrect, it must be at max %0"
better The length is incorrect, it must be at max of %0
or The length is incorrect, it must be %0 characters max

line 21:
words_min : "This field must concain at least %0 words, currently: %1 words"

-----------------------

I also have a suggestion as for the way the translation is implemented.
Since Chronoforms core file must be edited (edit.php) It becomes void if I update the component. So I guess a better solution would be to add an option to translate and it would be saved into database. Or/and
to scan the formcheck/lang directory for the current joomla language like en-GB.js he-IL.js etc.. Of course in edit.php en-GB can be changed to just "en" by taking only 2 first letters of the string, but may be problematic if there are more than 1 language with the same 2 first letters...

---------------
Thanks
GreyHead 30 Jan, 2013
Hi SubCon,

Thanks I've added your comments on the English version and the Hebrew version to the FAQ.

I agree with you about the drop-down generation. Hopefully Max will pick this up in a future release.

Bob
This topic is locked and no more replies can be posted.