]> git.mxchange.org Git - jcore-utils.git/commitdiff
Added own resource bundles + some fixes
authorRoland Haeder <roland@mxchange.org>
Tue, 22 Sep 2015 09:41:51 +0000 (11:41 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 22 Sep 2015 09:41:51 +0000 (11:41 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
src/org/mxchange/localization/bundle_de_DE.properties [new file with mode: 0644]
src/org/mxchange/localization/bundle_en_US.properties [new file with mode: 0644]

index 5d95ce418175bbdd29d44f0642dd4a85d47bbbb4..308a82e0019dc7537352796796c2d6525dfe9209 100644 (file)
@@ -69,7 +69,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
 
                // Init message and key
                FacesMessage facesMessage = null;
-               String errKey = "error.unknown_id"; //NOI18N
+               String errKey = "ERROR_UNKNOWN_ID"; //NOI18N
 
                // Get client id
                final String clientId = component.getClientId();
@@ -93,7 +93,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
                                        errKey = String.format("ERROR_%s_IS_NULL", field.toUpperCase()); //NOI18N
 
                                        // Value it null
-                                       facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
                                }
 
                                // Abort here
@@ -106,7 +106,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
                // Valid field?
                if (!isValidField) {
                        // Invalid field
-                       facesMessage = new FacesMessage(MessageFormat.format(errKey, clientId));
+                       facesMessage = new FacesMessage(MessageFormat.format(this.getMessageStringFromKey(errKey), clientId));
                }
 
                // Debug message
index d64f5b53d3ede8d5ed0a793007d7c7da95fccbc3..c104de5222a3bd78764540327567643ab7c0fbdb 100644 (file)
@@ -59,7 +59,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
                                        // Value is empty
                                        errKey = String.format("ERROR_%s_IS_NOT_STRING", field.toUpperCase()); //NOI18N
 
-                                       facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
                                }
 
                                // Cast to string
@@ -70,7 +70,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
                                        // Value is empty
                                        errKey = String.format("ERROR_%s_IS_EMPTY", field.toUpperCase()); //NOI18N
 
-                                       facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
                                }
                        }
                }
diff --git a/src/org/mxchange/localization/bundle_de_DE.properties b/src/org/mxchange/localization/bundle_de_DE.properties
new file mode 100644 (file)
index 0000000..9f2ac26
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (C) 2015 Roland Haeder
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ERROR_AMOUNT_IS_NULL=Die Bestellmenge ist nicht gesetzt.
+ERROR_AMOUNT_IS_NOT_LONG=Die eingegebene Menge ist keine Zahl.
diff --git a/src/org/mxchange/localization/bundle_en_US.properties b/src/org/mxchange/localization/bundle_en_US.properties
new file mode 100644 (file)
index 0000000..be963e3
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (C) 2015 Roland Haeder
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ERROR_AMOUNT_IS_NULL=Order amount is not set.
+ERROR_AMOUNT_IS_NOT_LONG=The entered amount is not a number.