Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to localize messages on the buttons at DateRangeDialog ?

    I'd like to localize messages which appear on clear,ok and cancel buttons in DateRangeDialog. This dialog is used e.g. when you choose filtered values for listgrid and listgridfield has Date type.

    I've found the following javascript code in ISC_Forms.js:

    if(isc.Window){isc.defineClass("DateRangeDialog","Window");isc.A=isc.DateRangeDialog;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.askForRange=function isc_c_DateRangeDialog_askForRange(_1,_2,_3,_4){var _5=isc.DateRangeDialog.create({allowRelativeDates:_1!=null?_1:true,rangeItemProperties:_2,callback:_4},_3);_5.show()}
    );isc.B._maxIndex=isc.C+1;isc.A=isc.DateRangeDialog.getPrototype();isc.A.isModal=true;isc.A.showModalMask=true;isc.A.dismissOnEscape=true;isc.A.autoCenter=true;isc.A.width=380;isc.A.height=140;isc.A.vertical="true";isc.A.showMinimizeButton=false;isc.A.headerIconProperties={src:"[SKIN]/DynamicForm/DatePicker_icon.gif"};isc.A.headerTitle="Select Date Range";isc.A.mainLayoutDefaults={_constructor:"VLayout",width:"100%",height:"100%",layoutMargin:5};isc.A.rangeFormDefaults={_constructor:"DynamicForm",numCols:1,width:"100%",height:"100%",autoParent:"mainLayout"};isc.A.rangeItemDefaults={_constructor:"DateRangeItem",allowRelativeDates:true,showTitle:false};isc.A.buttonLayoutDefaults={_constructor:"HLayout",width:"100%",height:22,align:"right",membersMargin:5,autoParent:"mainLayout"};isc.A.clearButtonDefaults={_constructor:"IButton",height:22,width:80,title:"Clear",autoParent:"buttonLayout",click:function(){this.creator.clear()}};isc.A.okButtonDefaults={_constructor:"IButton",height:22,width:80,title:"OK",autoParent:"buttonLayout",click:function(){this.creator.accept()}};isc.A.cancelButtonDefaults={_constructor:"IButton",height:22,width:80,title:"Cancel",autoParent:"buttonLayout",click:function(){this.creator.cancel()}};isc.A.buttonAutoChildren=["buttonLayout","clearButton","okButton","cancelButton"];isc.A.destroyOnClose=true;isc.A=isc.DateRangeDialog.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.initWidget=function isc_DateRangeDialog_initWidget(){this.title=this.headerTitle;this.Super("initWidget",arguments);this.addAutoChild("mainLayout");this.addAutoChild("rangeForm",{$76z:true,items:[isc.addProperties({},this.rangeItemDefaults,this.rangeItemProperties,{name:"rangeItem",fromDate:this.fromDate,toDate:this.toDate,dateDisplayFormat:this.dateDisplayFormat})]});this.rangeItem=this.rangeForm.getField("rangeItem");this.rangeItem.canvas.numCols=1;this.addAutoChildren(this.buttonAutoChildren);this.addItem(this.mainLayout)}

    There are three buttons with default titles. We can easily change it when we edit load_skin.js e.g.:

    if(isc.DateRangeDialog) {
    isc.DateRangeDialog.changeDefaults("cancelButtonDefaults", {
    icon: "[SKIN]actions/cancel.png",
    title : "My Cancel"
    });
    }

    It's great but I need to have a localized message on the button, so I tried to add a new message with a key in SmartGwtMessages.java (and appropriate property files):

    @DefaultMessage("Cancel")
    @Key("dateRangeDialog_cancelButtonTitle")
    String dateRangeDialog_cancelButtonTitle();

    But this doesn't work at all.
    Does anybody has got proper path to these buttons, which we can set up in SmartGwtMessages or known any other way to change these buttons' messages ?
    Last edited by behemot; 3 Nov 2010, 04:44.

    #2
    Support for this will be added in a few days.

    Comment


      #3
      The following i18n labels have been added :

      dateRangeDialog_clearButtonTitle=Clear
      dateRangeDialog_okButtonTitle=OK
      dateRangeDialog_cancelButtonTitle=Cancel

      You can update the translation resource bundles on the 99translations Smart GWT project page.

      Sanjiv

      Comment

      Working...
      X