Customizing standard messages

Hi all

I am fairly new to smartGWT and am slowly getting the hang of things, but I still got a long way to go.

For instance, I try to follow smartclient documentation for i18n, especially the “Framework message localization” chapter.

I would like to perform following action: isc.Validator.addClassProperties({requiredField:“Custom Message”});

How can perform this while using smartGWT ?

I suspect that I am an ass, but I’m stuck!

Thanks

Ok, am an ass. Got it.

private native void setValidatorMessages()/-{
$wnd.Validator.addClassProperties({requiredField:“Custom Message”});
}-
/;

Localization of DateItem and DateChooser -month and weekday names.

I have some related questions:

(1) Is it possible to do the same thing via Java code rather than JSNI/JavaScript? Or, as an alternative, is there any way to set Validator Message at design-time in JavaScript rather than run-time, similar to how custom scrollbars are turned off?

(2) Please advise me how to localize month and weekday names in DateItem and DateChooser. In DateChooser.js there is this code:

    getDayNames : function () {
        if (isc.DateChooser._dayNames == null) {
            // Don't hard-code day-names -- we need them to be localizeable
            // isc.DateChooser._dayNames = ["Su", "Mo","Tu", "We", "Th", "Fr", "Sa"]
            var dateObj = new Date();
            isc.DateChooser._dayNames = Date.getShortDayNames(2);
            
        }
        return isc.DateChooser._dayNames;
    },

I have tried returning hardcoded array of localized values but it did not work. I was not able to spot any other place in code where I could localize month and weekday names.

Thank you!

There is an open issue . Star it