JS Validation Language

saber 06 Sep, 2013
Hi, I have two forms on a single language site, one for english and one for german speaking visitors. I set the field "JS Validation Language" to the according language in each form (english/german).
Still in both forms the error messages appear in german - the default language of the site.
Unfortunately I can't find out what I am doing wrong.
Thank you for your help!
saber 06 Sep, 2013
Thank you Greyhead, but that's what I did to choose the language. Unfortunately with no results.
GreyHead 06 Sep, 2013
Hi saber,

Then most likely something isn't setting the Joomla! language correctly :-(

Please post a link to the form so I can take a quick look.

Bob
GreyHead 06 Sep, 2013
Hi saber,

As the articles in the countries can vary the language management ist not solved by the language-function of Joomla in this website but by categories.

So, I was correct, the Joomla! language isn't being set correctly.

How do you identify the language for each page? You'll need that information to set the correct language in the form. You can do that by setting the current Locale in a Load JS action in your form.

Bob
saber 08 Sep, 2013
Hi Bob, thank you for your explanations!
I read and tried a lot but don't succeed in getting messages in another language than the default language of Joomla.

What exactly do I need to write in the Load JS action? Should the line
set.Locale('en-US');

do the job or do I have to write something more or different into the "action"-field?

In your FAQ there is an example for setting the language in a custom code action like this:
<?php
$form->form_params->set('jsvalidation_lang', 'xx');
?>

Shouldn't this work in my case also?
Thanks in advance for your answer!
GreyHead 09 Sep, 2013
Hi saber,

I think that for the validation to work you need to use the second one (the Locale works for the DatePicker but I don't think the validator check the locale :-( ).

Bob
saber 10 Sep, 2013
Thank you Bob.
Unfortunately the second one does not seem to have any effect on the language either.
Do you have another idea how to solve the problem?
GreyHead 10 Sep, 2013
Hi saber,

What are you putting in place of xx? And how do you know which language tag to use there?

Bob
saber 10 Sep, 2013
Hi Bob, I tried with "en" and "en-GB" because I thougt that this code would "choose" the english language file for the error messages (en.js). Apparently I understood it totally wrong, sorry.

I need to tell the form to choose a particular "error-language-file" regardless from the language-settings in Joomla. As I will have to build the form in several languages it would be great if there is a solution for that. Otherwise I have to set the error message in every single field, which means a lot of work... - but its not the end of the world ;-)

Simone
GreyHead 10 Sep, 2013
Hi saber,

I think that 'en' or 'de' should be what is needed.

I'll test when I have time but it probably won't be tomorrow as I'm out for most of the day.

Bob
saber 11 Sep, 2013
Thank you Bob!
And no hurry - a solution would be great but it is not that urgent.
saber 14 Oct, 2013
Hi Greyhead
I knock at your door again as now I need a solution for my language problem quite soon. It would be great if you could find the time to have a look at it.
Thanks a lot in advance!
This topic is locked and no more replies can be posted.