maybe this can help

http://www.wicket-wiki.org.uk/wiki/index.php/Validation_Messages


-Igor


On 2/8/06, karthik Guru <[EMAIL PROTECTED]> wrote:
May be you can try something like this ..

username.addLabel(new StringResourceModel("label.username", this, null));

In page.properties

label.username=languageSpecificUsername
RequiredValidator=Field '${label}' is required --> should translate to

'Field languageSpecificUsername is required'

-karthik

On 2/8/06, Jesper Preuss <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to localize the error output from the ComponentFeedbackPanel.
>
> My form checks for required inputs, and then it prints the error. But
> I would like to translate the label it uses, because I write my code
> in english, but the username and password should be translated.
>
> This will come out with the following text "Field 'username' is
> required" and "Field 'password' is required".
>
> But what I would like to do is change the username in the
> usernameError and passwordError.
> I would like it to output the following text "Field
> 'languageSpecificUsername' is required" and "Field
> 'languageSpecificPassword' is required".
>
> Don't know if I have to add something to the ComponentFeedbackPanel,
> so it translates the username to languageSpecificUsername?.
>
>
> The form class:
> public class PersonForm extends Form
> {
>         public PersonForm(String id, PersonBean person)
>         {
>                 super(id, new CompoundPropertyModel(person));
>                 this.person = person;
>                 TextField username = new TextField("username");
>                 username.add(RequiredValidator.getInstance());
>                 add(username);
>                 ComponentFeedbackPanel usernameFeedback = new
> ComponentFeedbackPanel("usernameError", username);
>                 add(usernameFeedback);
>
>                 TextField password = new TextField("password");
>                 password.add(RequiredValidator.getInstance());
>                 add(password);
>                 ComponentFeedbackPanel passwordFeedback = new
> ComponentFeedbackPanel("passwordError", password);
>                 add(passwordFeedback);
>         }
> }
>
> The property file:
> RequiredValidator=Field '${label}' is required
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to