From 8e9a1c4b3709f168664e501d41ae2354061f249a Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Sat, 19 Aug 2017 17:07:03 +0200
Subject: [PATCH] Please cherry-pick: - removed debug lines, were to noisy and
 the localization bug has been fixed - company name and legal status are no
 longer separated, some other i18n   strings may still write about it
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Signed-off-by: Roland Häder <roland@mxchange.org>
---
 .../FinancialsLocalizationSessionBean.java    | 28 +++++--------------
 .../localization/bundle_de_DE.properties      |  2 +-
 .../localization/bundle_en_US.properties      |  2 +-
 3 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java b/src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java
index 24bf5bd7..f9d9e08b 100644
--- a/src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java
+++ b/src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java
@@ -149,10 +149,10 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 		// Is locale code set?
 		if (this.getLocaleCode() == null) {
 			// Throw NPE
-			throw new NullPointerException("this.localeCode is null");
+			throw new NullPointerException("this.localeCode is null"); //NOI18N
 		} else if (this.getLocaleCode().isEmpty()) {
 			// Throw IAE
-			throw new IllegalArgumentException("this.localeCode is empty");
+			throw new IllegalArgumentException("this.localeCode is empty"); //NOI18N
 		}
 
 		// Default new locale is null, will be handled later
@@ -161,7 +161,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 		// Iterate over whole map
 		for (Map.Entry<String, Locale> entry : this.getSupportedLocales().entrySet()) {
 			Locale foundLocale = entry.getValue();
-			System.out.println(MessageFormat.format("foundLocale={0},this.localeCode={1}", foundLocale, this.getLocaleCode()));
 
 			// Does the language match?
 			if (Objects.equals(foundLocale.toString(), this.getLocaleCode())) {
@@ -175,10 +174,9 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 		this.clear();
 
 		// Has a matching locale
-		System.out.println("newLocale=" + newLocale);
 		if (null == newLocale) {
 			// Throw NPE
-			throw new NullPointerException("this.localeCode=" + this.getLocaleCode() + " cannot be found.");
+			throw new NullPointerException("this.localeCode=" + this.getLocaleCode() + " cannot be found."); //NOI18N
 		}
 
 		// Then change it
@@ -191,7 +189,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 	 * @return Locale
 	 */
 	public Locale getLocale () {
-		System.out.println("Getting this.locale=" + this.locale);
 		return this.locale;
 	}
 
@@ -201,7 +198,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 	 * @param locale Locale
 	 */
 	public void setLocale (final Locale locale) {
-		System.out.println("Setting locale=" + locale);
 		this.locale = locale;
 	}
 
@@ -211,7 +207,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 	 * @return Language code
 	 */
 	public String getLocaleCode () {
-		System.out.println("Getting this.localeCode=" + this.localeCode);
 		return this.localeCode;
 	}
 
@@ -221,7 +216,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 	 * @param localeCode Language code
 	 */
 	public void setLocaleCode (final String localeCode) {
-		System.out.println("Setting localeCode=" + localeCode);
 		this.localeCode = localeCode;
 	}
 
@@ -243,7 +237,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 	public void init () {
 		// Get default locale
 		Locale defaultLocale = FacesContext.getCurrentInstance().getApplication().getDefaultLocale();
-		System.out.println("defaultLocale=" + defaultLocale);
 
 		// Add it to list
 		this.getSupportedLocales().put(defaultLocale.toString(), defaultLocale);
@@ -255,7 +248,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 		while (iterator.hasNext()) {
 			// Get next locale
 			Locale supportedLocale = iterator.next();
-			System.out.println("supportedLocale=" + supportedLocale);
 
 			// Add it
 			this.getSupportedLocales().put(supportedLocale.toString(), supportedLocale);
@@ -266,10 +258,7 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 
 		// Is no country code found?
 		if (requestLocale.getCountry().isEmpty()) {
-			// Then try to find one
-			System.out.println("Request locale is without country information, looking up in map ...");
-
-			// Get language from it
+			// Then try to find one, get language from it
 			String language = requestLocale.getLanguage();
 			Boolean found = Boolean.FALSE;
 
@@ -277,7 +266,6 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 			for (Map.Entry<String, Locale> entry : this.getSupportedLocales().entrySet()) {
 				String languageCode = entry.getKey();
 				Locale foundLocale = entry.getValue();
-				System.out.println(MessageFormat.format("languageCode={0},language={1}", languageCode, language));
 
 				// Does the language match?
 				if (languageCode.startsWith(language)) {
@@ -310,14 +298,12 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsController
 		// Is the locale language_country at least?
 		if (null == locale) {
 			// Throw NPE
-			throw new NullPointerException("locale is null");
-		} else if (!locale.toString().contains("_")) {
+			throw new NullPointerException("locale is null"); //NOI18N
+		} else if (!locale.toString().contains("_")) { //NOI18N
 			// Throw IAE
-			throw new IllegalArgumentException(MessageFormat.format("locale={0} does not have country information set.", locale));
+			throw new IllegalArgumentException(MessageFormat.format("locale={0} does not have country information set.", locale)); //NOI18N
 		}
 
-		System.out.println("Changing locale to " + locale + " ...");
-
 		// Set locale + code here
 		this.setLocale(locale);
 		this.setLocaleCode(locale.toString());
diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties
index b503fa80..b6f5e13d 100644
--- a/src/java/org/mxchange/localization/bundle_de_DE.properties
+++ b/src/java/org/mxchange/localization/bundle_de_DE.properties
@@ -858,7 +858,7 @@ ADMIN_CONTACT_BUSINESS_DATA_LEGEND=Basisdaten fuer geschaeftlichen Kontakt:
 #@TODO Please fix German umlauts!
 ADMIN_CONTACT_BUSINESS_DATA_LEGEND_TITLE=Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein.
 ADMIN_BUSINESS_DATA_COMPANY_NAME=Firmenname:
-ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Bitte geben Sie den Firmennamen ohne Rechtsform ein.
+ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Bitte geben Sie den Firmennamen inklusive Rechtsform ein.
 ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS=Rechtsform (z.B. GmbH):
 ADMIN_BUSINESS_DATA_COMPANY_EMAIL_ADDRESS=Haupt-Email-Adresse:
 #@TODO Please fix German umlauts!
diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties
index 5c2afc04..667e5b55 100644
--- a/src/java/org/mxchange/localization/bundle_en_US.properties
+++ b/src/java/org/mxchange/localization/bundle_en_US.properties
@@ -825,7 +825,7 @@ ADMIN_CONTACT_BUSINESS_DATA_LEGEND=Basic data for business contact:
 #Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein.
 ADMIN_CONTACT_BUSINESS_DATA_LEGEND_TITLE=Enter basic data for a business contact.
 ADMIN_BUSINESS_DATA_COMPANY_NAME=Company name:
-ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Please enter the company's name without legal status.
+ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Please enter the company's name including legal status.
 ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS=Legal status (e.g. Inc.):
 ADMIN_BUSINESS_DATA_COMPANY_EMAIL_ADDRESS=Main email address:
 BUTTON_ADMIN_CONTINUE_BUSINESS_CONTACT_PERSON=Add basic data
-- 
2.39.5