diff app/controller/grid/Probenehmer.js @ 1003:15d8c64049d1 stammdatengrids

Datensatzerzeuger now uses the server. Added i18n to confirmation messages
author Dustin Demuth <dustin@intevation.de>
date Fri, 15 Jan 2016 14:42:29 +0100
parents b21421ba6917
children 77e22ad5cc84
line wrap: on
line diff
--- a/app/controller/grid/Probenehmer.js	Wed Jan 13 14:50:28 2016 +0100
+++ b/app/controller/grid/Probenehmer.js	Fri Jan 15 14:42:29 2016 +0100
@@ -40,6 +40,7 @@
      * On failure it displays a message
      */
     gridSave: function(editor, context) {
+        var i18n = Lada.getApplication().bundle;
         context.record.save({
             success: function(record, response) {
                 //Do Nothing
@@ -48,12 +49,12 @@
               var json = response.request.scope.reader.jsonData;
               if (json) {
                 if (json.message){
-                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
+                    Ext.Msg.alert(i18n.getMsg('err.msg.save.title')
                         +' #'+json.message,
-                        Lada.getApplication().bundle.getMsg(json.message));
+                        i18n.getMsg(json.message));
                    } else {
-                         Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
-                            Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
+                         Ext.Msg.alert(i18n.getMsg('err.msg.save.title'),
+                            i18n.getMsg('err.msg.generic.body'));
                    }
               }
             }
@@ -90,8 +91,10 @@
     remove: function(button) {
         var grid = button.up('grid');
         var selection = grid.getView().getSelectionModel().getSelection()[0];
-        //TODO: i18n
-        Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn) {
+        var i18n = Lada.getApplication().bundle;
+        Ext.MessageBox.confirm(i18n.getMsg('delete'),
+                                i18n.getMsg('confirmation.question'),
+                                function(btn) {
             if (btn === 'yes') {
                 selection.destroy({
                     success: function() {
@@ -101,16 +104,16 @@
                         var json = response.request.scope.reader.jsonData;
                         if (json) {
                             if (json.message){
-                                Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title')
+                                Ext.Msg.alert(i18n.getMsg('err.msg.delete.title')
                                     +' #'+json.message,
-                                    Lada.getApplication().bundle.getMsg(json.message));
+                                    i18n.getMsg(json.message));
                             } else {
-                                Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
-                                    Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
+                                Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'),
+                                    i18n.getMsg('err.msg.generic.body'));
                             }
                         } else {
-                            Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
-                                Lada.getApplication().bundle.getMsg('err.msg.response.body'));
+                            Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'),
+                                i18n.getMsg('err.msg.response.body'));
                         }
                     }
                 });

http://lada.wald.intevation.org