Forums

Bug in Locales ?

alec6w 20 Nov, 2014
Hello,

My Joomla site is in French and language.
I set in locales tab i add my 2 fr_fr and en_gb with language Strings
In french #LOGIN=identifiant
In english #LOGIN=connexion
In then designer tab, i add a textbox with label #LOGIN.

I debug a litlle the code to find the problem.
In Components\com_chronoforms5\chronoforms\libs\form.php function translate(159)
$texts and $locals seem to be OK :

$texts = Array ( [0] => [LOGIN:] [1] => [#MERCI] [2] => [#AVANT] )
$locals = Array ( [0] => Login [1] => Thank you [2] => Welcome )

and $ data before str_replace(...
$data = '0000contactcontactloadload11submitsubmitfilefilechronoformchronoform11111111'

I'm not sure, but the str_replace could not work.
Please, can you help me ?

Regards.
GreyHead 20 Nov, 2014
Hi alec6w,

What isn't working exactly? You haven't said what the problem is?

I did notice that you say that locale string is #LOGIN but the code you posted uses LOGIN:

Bob
alec6w 20 Nov, 2014
Oups,

Wrong code
$texts and $locals seem to be OK :

$texts = Array ( [0] => [#LOGIN] [1] => [#MERCI] [2] => [#AVANT] )

$locals = Array ( [0] => Login [1] => Thank you [2] => Welcome )

In front office, i see #LOGIN and #AVANT instead of 'Login' and 'Welcome'

Regards
alec6w 21 Nov, 2014
Answer
I answer to myself.
It can be usefull

Simply, do not create a LANG_STRING like #mylangsring if Strict Match is set to Yes. It doesn't work.
Change to something like #mylangsring# with Strict Match to Yes.

LANG_STRING like #mylangsring will work with Strict Match set to No.

Voila
GreyHead 21 Nov, 2014
Hi alec6w,

Thank you, I didn't know that.

Bob
scree 15 Apr, 2015
Hi alec6w,

can you please repost your answer, I do not understand what you mean and I almost try all the possibilities. If I understood well: You mean, when I am using "locales", switch the STRICT MATCH to "No". Than use #NAME# as label for input field and than use the string in locales tab as follows: NAME=whatsoever

Do I have to allow some plugin for it?

Just do not work for me.
scree 15 Apr, 2015
I got it, I used the "-" character instead the underscore, so my language tag was wrong. You you are right, set the STRICT MATCH to "No", than use input fileds name without "#" (just the plain text - in uppercase). And than use just a normal string as "USERNAME=whatsoever". Than the form is translated depends on active site language. And what I found next in the last tab "Validation" you can choose the validation messages to be fixed in some language or dependant on active site language.
This topic is locked and no more replies can be posted.