Git-Host / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
0 stars 1 forks source link

Form submit message - internationalize #179

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not sure if this is the issue but I can not find the way to have language 
support for the message when the form is submitted.
I look in the form template and find the div tag as:
<div id="messages-$form.name"> </div>

But how can I have different languages for the message produced.
Is it possible? If not it should be.

Original issue reported on code.google.com by adis.kat...@gmail.com on 30 Mar 2010 at 11:58

GoogleCodeExporter commented 9 years ago
You can change form template to add i18n messages:

find lines showing success message:

      if (r.result == 'success') {
         formInfo(r.message);
         $('#form-$form.name')[0].reset();
      }

You can add i18n success messaging:

var successMessages = {
  en : 'Successfully submitted', 
  ru : 'Успешная отправка'
};

      if (r.result == 'success') {
         formInfo(successMessages['$language.code']);
         $('#form-$form.name')[0].reset();
      }

$language is a velocity variable injected into Velocity context during form 
rendering 
and it stores current LanguageEntity.

i18n for error messages implemented for regex field checks. For mandatory 
errors you 
can use way showed above.

Original comment by kinyelo@gmail.com on 11 Apr 2010 at 10:02

GoogleCodeExporter commented 9 years ago
(Update our templates and documentation.)

Original comment by ted.husted on 6 Jan 2011 at 9:27

GoogleCodeExporter commented 9 years ago

Original comment by ted.husted on 6 Jan 2011 at 9:28

GoogleCodeExporter commented 9 years ago
Is it imposible to use
$message.successmessage?

Original comment by NosovK on 29 Apr 2011 at 10:49