From: Roland Häder Date: Sat, 19 Aug 2017 15:07:03 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=977b667b22bfe87e477179a71afc19c1f61f110e;p=pizzaservice-war.git 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 Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index a6a7f5c5..02252c95 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -837,7 +837,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 00646efe..8bd44a6e 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -815,7 +815,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 diff --git a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java index 27408b33..2322bd28 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java @@ -149,10 +149,10 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements // 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 PizzaLocalizationSessionBean extends BasePizzaController implements // Iterate over whole map for (Map.Entry 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 PizzaLocalizationSessionBean extends BasePizzaController implements 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 PizzaLocalizationSessionBean extends BasePizzaController implements * @return Locale */ public Locale getLocale () { - System.out.println("Getting this.locale=" + this.locale); return this.locale; } @@ -201,7 +198,6 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements * @param locale Locale */ public void setLocale (final Locale locale) { - System.out.println("Setting locale=" + locale); this.locale = locale; } @@ -211,7 +207,6 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements * @return Language code */ public String getLocaleCode () { - System.out.println("Getting this.localeCode=" + this.localeCode); return this.localeCode; } @@ -221,7 +216,6 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements * @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 PizzaLocalizationSessionBean extends BasePizzaController implements 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 PizzaLocalizationSessionBean extends BasePizzaController implements 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 PizzaLocalizationSessionBean extends BasePizzaController implements // 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 PizzaLocalizationSessionBean extends BasePizzaController implements for (Map.Entry 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 PizzaLocalizationSessionBean extends BasePizzaController implements // 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());