From 55853756424fdc40255d1b135ae21045cb0f4721 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sat, 5 Mar 2011 13:07:17 +0100 Subject: [PATCH] prepare sonia.rest.js for localization --- .../src/main/webapp/resources/js/sonia.rest.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.rest.js b/scm-webapp/src/main/webapp/resources/js/sonia.rest.js index a76b4e8a91..a33ad86502 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.rest.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.rest.js @@ -33,6 +33,9 @@ Ext.ns("Sonia.rest"); Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, { + errorTitleText: 'Error', + errorMsgText: 'Could not load items. Server returned status: {0}', + constructor: function(config) { var baseConfig = { autoLoad: false, @@ -48,8 +51,8 @@ Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, { this.removeAll(); } else { Ext.MessageBox.show({ - title: 'Error', - msg: 'Could not load items. Server returned status: ' + status, + title: this.errorTitleText, + msg: String.format( this.errorMsgText, status ), buttons: Ext.MessageBox.OK, icon:Ext.MessageBox.ERROR }); @@ -155,6 +158,8 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { Sonia.rest.FormPanel = Ext.extend(Ext.FormPanel,{ + okText: 'Ok', + cancelText: 'Cancel', addText: 'Add', removeText: 'Remove', @@ -172,8 +177,8 @@ Sonia.rest.FormPanel = Ext.extend(Ext.FormPanel,{ defaultType: 'textfield', buttonAlign: 'center', buttons: [ - {text: 'Ok', formBind: true, scope: this, handler: this.submit}, - {text: 'Cancel', scope: this, handler: this.cancel} + {text: this.okText, formBind: true, scope: this, handler: this.submit}, + {text: this.cancelText, scope: this, handler: this.cancel} ] }