Forums

THANKS MESSAGE IS NOT TRANSLATED

GreyHead 30 Jun, 2012
Hi glambrecht ,

Have you added Multi-Language actions to the On Submit event?

Bob
glambrecht 02 Jul, 2012
No I had only the ones ON LOAD
Now I have - and some of it is ok
the thanks message on the web i fine both in English and German
but the mail to the user - only has translated half of the message!

this is what I have in the form:

KÆRE=DEAR
TAK FOR DIN BESKED=THANKS FOR YOUR MESSAGE
DU HØRER FRA MIG MEGET HURTIGT=I WILL ANSWER VERY SOON
VENLIG HILSEN=BEST REGARDS
VI SVARER DIG HURTIGST MULIGT= WE WILL REPLY SHORTLY
SEND=SEND
RYD=CLEAR

and this is the message, I get by mail:
KÆRE GRETHE, (KÆRE is not translated)

THANKS FOR YOUR MESSAGE.
DU HØRER FRA MIG MEGET HURTIGT. (this sentence is not translated)

BEST REGARDS
TIENDEGAARDEN
SUSANNE NØHR
glambrecht 03 Jul, 2012
in backend - I found out that it was about the Danish (and Norwegian) letters æ, ø and å
when I changed them it was all right.
BUT MUCH WORSEyou cannot fill out the form as a customer, if you have a name with æ, ø or å - and that is
really bad - as 20% of our names are with æ, ø or å - and a customer, just wanting to book a
room has no chance of knowing why she cannot fill out the form
GreyHead 03 Jul, 2012
Hi glambrecht,

Yes I spotted that as the likely cause yesterday but didn't find time to reply.

I use 'place-markers' for translated forms like #DEAR#=Dear that avoids problems with special characters and makes it very clear if any translations are missing.

The problem with the Name fields is probably that you have enabled alphanumeric validation and it uses a strict definition of alpha i.e. a-z, A-Z plus dash, space and underscore

ChronoForms isn't clever enough to switch the validation by language, nor is is practical to include all possible UTF-8 letters. The best suggestion is to add a Custom Serverside validation. Please see this post for an example.

Bob
glambrecht 11 Jul, 2012
I've put in:
<?php
$data =& $form->data['input_name'];
$regex = '/^[ÅÄÖÆØa-z ._-]+$/i';
if ( isset($data) && $data ) {
  if ( preg_match($regex, $data) === false ) {
    $form->validation_errors['input_name'] = "Invalid data";.
    return false;
  }
}
?>


and when I try to registre with a name of Grethe Nøhr - I get a black box saying "navn x" (name x).
it's good that I know why!
but I would like that the customers could fill out the form with Æ Ø or Å
is that not possible?
glambrecht 11 Jul, 2012
I've put in the code as stated above - so now there's a new problem:
when I fill out the form (without Æ, Ø or Å)
I get this message on the website:
Parse error: syntax error, unexpected '.'
/home/www/tiendegaarden.dk/administrator/components/com_chronoforms/form_actions/custom_serverside _validation/custom_serverside_validation.php(16) : eval()'d code on line 6
TAK FOR DIN BESKED. VI SVARER DIG HURTIGST MULIGT
Powered By ChronoForms - ChronoEngine.com

where is the problem?
is it the confirmation mail to the customer? which in line 6 contains Ø as this IS the name of the owner of the site

"KAERE grethe lambrecht,

TAK FOR DIN BESKED.
DU KAN VENTE SVAR FRA MIG MEGET HURTIGT.

VENLIG HILSEN
TIENDEGAARDEN
SUSANNE NØHR"

(if so - I cannot use this validation in my form)
GreyHead 11 Jul, 2012
HI glambrecht,

There's a stray . at the end of line 6 please delete it.

Bob

PS I've updated the original post.
glambrecht 11 Jul, 2012
??? THERE'S NO STRAY
I just put " " around the text to show you!

what about Æ Ø Å?
GreyHead 11 Jul, 2012
Hi glambrecht,

Please only shout after you've looked. See the code in your post a little earlier in this thread. This line has a . at the end.
$form->validation_errors['input_name'] = "Invalid data";.

Bob
glambrecht 11 Jul, 2012
sorry my mistake
(I was not shouting - but had capitals on, as I was translating in the form)
will look again
glambrecht 11 Jul, 2012
Thanks I found it
and found out how to use Æ Ø Å - in front end (not in back end mails) - but this was the most important
GreyHead 13 Jul, 2012
Hi glambrecht,

In the Emails I think you can use HTML entities, copy and paste, or use the rich text editor. Any of these should allow you to use almost any character.

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