changeset 634:291ac2e2bcf5

Set translateable messages for the parent fieldset.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 16 Mar 2015 17:31:13 +0100
parents 1e1534482bfd
children def8def373e8
files app/view/widget/base/CheckBox.js app/view/widget/base/ComboBox.js app/view/widget/base/Datetime.js app/view/widget/base/TextField.js resources/i18n/Lada_de-DE.properties
diffstat 5 files changed, 25 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/widget/base/CheckBox.js	Mon Mar 16 17:23:27 2015 +0100
+++ b/app/view/widget/base/CheckBox.js	Mon Mar 16 17:31:13 2015 +0100
@@ -56,7 +56,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showWarnings(warnings);
+            var i18n = Lada.getApplication().bundle;
+            var warningText = i18n.getMsg(this.name) + ': ' + warnings;
+            fieldset.showWarningOrError(true, warningText);
         }
     },
 
@@ -73,7 +75,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showErrors();
+            var i18n = Lada.getApplication().bundle;
+            var errorText = i18n.getMsg(this.name) + ': ' + errors;
+            fieldset.showWarningOrError(false, '', true, errorText);
         }
     },
 
--- a/app/view/widget/base/ComboBox.js	Mon Mar 16 17:23:27 2015 +0100
+++ b/app/view/widget/base/ComboBox.js	Mon Mar 16 17:31:13 2015 +0100
@@ -66,7 +66,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showWarnings(warnings);
+            var i18n = Lada.getApplication().bundle;
+            var warningText = i18n.getMsg(this.name) + ': ' + warnings;
+            fieldset.showWarningOrError(true, warningText);
         }
     },
 
@@ -83,7 +85,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showErrors();
+            var i18n = Lada.getApplication().bundle;
+            var errorText = i18n.getMsg(this.name) + ': ' + errors;
+            fieldset.showWarningOrError(false, '', true, errorText);
         }
     },
 
--- a/app/view/widget/base/Datetime.js	Mon Mar 16 17:23:27 2015 +0100
+++ b/app/view/widget/base/Datetime.js	Mon Mar 16 17:31:13 2015 +0100
@@ -61,7 +61,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showWarnings(warnings);
+            var i18n = Lada.getApplication().bundle;
+            var warningText = i18n.getMsg(this.name) + ': ' + warnings;
+            fieldset.showWarningOrError(true, warningText);
         }
     },
 
@@ -78,7 +80,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showErrors();
+            var i18n = Lada.getApplication().bundle;
+            var errorText = i18n.getMsg(this.name) + ': ' + errors;
+            fieldset.showWarningOrError(false, '', true, errorText);
         }
     },
 
--- a/app/view/widget/base/TextField.js	Mon Mar 16 17:23:27 2015 +0100
+++ b/app/view/widget/base/TextField.js	Mon Mar 16 17:31:13 2015 +0100
@@ -54,7 +54,9 @@
         this.down('textfield').markInvalid('');
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showWarnings(warnings);
+            var i18n = Lada.getApplication().bundle;
+            var warningText = i18n.getMsg(this.name) + ': ' + warnings;
+            fieldset.showWarningOrError(true, warningText);
         }
     },
 
@@ -71,7 +73,9 @@
         img.show();
         var fieldset = this.up('fieldset[collapsible=true]');
         if (fieldset) {
-            fieldset.showErrors();
+            var i18n = Lada.getApplication().bundle;
+            var errorText = i18n.getMsg(this.name) + ': ' + errors;
+            fieldset.showWarningOrError(false, '', true, errorText);
         }
     },
 
--- a/resources/i18n/Lada_de-DE.properties	Mon Mar 16 17:23:27 2015 +0100
+++ b/resources/i18n/Lada_de-DE.properties	Mon Mar 16 17:31:13 2015 +0100
@@ -30,3 +30,4 @@
 # Field names
 ##
 entnahmeOrt: Entnahmeort
+test: Testdatensatz

http://lada.wald.intevation.org