From d6903b6b1fbd100dd9a22d65c517e8d5016f926b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 15 Sep 2015 09:58:46 +0200 Subject: [PATCH] =?utf8?q?Translation=20update:=20-=20internationalized=20?= =?utf8?q?a=20lot=20more=20strings=20+=20translated=20them=20to=20English?= =?utf8?q?=20-=20added=20doctype=20in=20output=20pages=20(not=20templates)?= =?utf8?q?=20-=20added=20XML=20definition=20in=20all=20pages=20where=20abs?= =?utf8?q?ent=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../localization/bundle_de_DE.properties | 29 +++++++++----- .../localization/bundle_en_US.properties | 31 ++++++++++----- .../beans/basket/BasketWebBean.java | 39 ++++++++++++++++--- .../beans/basket/BasketWebController.java | 7 ++++ web/WEB-INF/templates.dist/admin_page.xhtml | 1 + web/WEB-INF/templates.dist/guest_page.xhtml | 1 + web/WEB-INF/templates/base.tpl | 10 ++++- web/WEB-INF/templates/basket/mini_basket.tpl | 13 +++++-- .../templates/basket/mini_basket_empty.tpl | 13 ++++++- .../generic/gender_selection_box.tpl | 1 + web/WEB-INF/templates/guest/guest_base.tpl | 20 ++++++---- web/WEB-INF/templates/guest/guest_footer.tpl | 1 + .../templates/guest/guest_login_form.tpl | 1 + web/WEB-INF/templates/guest/guest_menu.tpl | 37 ++++++++++-------- web/admin/admin_logout.xhtml | 1 + web/admin/category.xhtml | 5 ++- web/admin/index.xhtml | 1 + web/admin/product.xhtml | 5 ++- web/basket.xhtml | 9 +++-- web/bye.xhtml | 1 + web/customer/login.xhtml | 1 + web/customer/lost_passwd.xhtml | 1 + web/customer/register.xhtml | 1 + web/imprint.xhtml | 8 ++-- web/index.xhtml | 2 + web/item_added.xhtml | 9 +++-- web/privacy.xhtml | 2 + web/terms.xhtml | 2 + 28 files changed, 184 insertions(+), 68 deletions(-) diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index fdb786d8..d5721ad2 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -18,16 +18,15 @@ GENDER_UNKNOWN=Unbekannt GENDER_MALE=Herr GENDER_FEMALE=Frau GENDER_COMPANY=Firma -MiniBasketTag.basket_is_empty=Der Warenkorb ist leer. -MiniBasketTag.last_item=Zuletzt hinzugefuegt: {0} -MiniBasketTag.additional_items=Es befinden sich noch {0} weitere Produkte im Warenkorb. -MiniBasketTag.to_basket=Zum Warenkorb -MiniBasketTag.header=Warenkorb +MINI_BASKET_IS_EMPTY=Der Warenkorb ist leer. +MINI_BASKET_LAST_ITEM=Zuletzt hinzugefuegt: {0} +MINI_BASKET_ADDITIONAL_ITEMS=Es befinden sich noch {0} weitere Produkte im Warenkorb. +MINI_BASKET_TITLE=Warenkorb ADMIN_CATEGORY_HAS_NO_PARENT=Keine Elternkategorie YES=Ja NO=Nein ADMIN_PARENT_CATEGORY_CANNOT_BE_NULL=Elternkategorie darf nicht leer sein. -ADMIN_CATEGORY_MUST_BE_SELECTED=Es muss eine Kategorie ausgewaehlt werden. +ADMIN_CATEGORY_MUST_BE_SELECTED=Es muss eine Kategorie ausgew\u00e4hlt werden. ERROR_AMOUNT_IS_NULL=Die Bestellmenge ist nicht gesetzt. BUTTON_TITLE_ADD_ITEM_TO_BASKET=F\u00fcgt das Produkt dem Warenkorb hinzu. INPUT_TITLE_ENTER_ITEM_AMOUNT=Geben Sie hier die Bestellmenge ein. @@ -60,16 +59,16 @@ SUB_TITLE_ADMIN_PRODUCTS=Diese Produkte sind erstellt worden: PAGE_TITLE_ADMIN_PRODUCTS=Produkte BUTTON_RESET_FORM=Formular zur\u00fccksetzen BUTTON_EDIT_ENTRIES=\u00c4ndern -BUTTON_DELETE_ENTRIES=L\u00f6schen +BUTTON_ADMIN_DELETE_ENTRIES=L\u00f6schen ADMIN_ADD_PRODUCT_TITLE=Neues Produkt hinzuf\u00fcgen: ADMIN_ADD_CATEGORY_TITLE=Neue Kategorie hinzuf\u00fcgen: CATEGORY=Kategorie: PLEASE_FILL_ALL_FIELDS=Bitte alle Felder ausf\u00fcllen: -BUTTON_ADD_CATEGORY=Kategorie hinzuf\u00fcgen +BUTTON_ADMIN_ADD_CATEGORY=Kategorie hinzuf\u00fcgen ADMIN_ENTER_PRODUCT_TITLE=Produktbezeichnung: ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE=(z.B. Pizza Italia) IS_AVAILABLE=Verf\u00fcgbar: -BUTTON_ADD_PRODUCT=Produkt hinzuf\u00fcgen +BUTTON_ADMIN_ADD_PRODUCT=Produkt hinzuf\u00fcgen ADMIN_ADD_PRODUCT_NOTICE_TITLE=Hinweise zum Hinzuf\u00fcgen von Produkten: ADMIN_ADD_PRODUCT_NOTICE_LINE1=Beim Preis keine W\u00e4hrungszeichen (wie \u20ac usw.) eingeben. ADMIN_ADD_PRODUCT_NOTICE_LINE2=Kommastellen mit Punkt, nicht mit Komma abtrennen. @@ -93,3 +92,15 @@ LINK_CUSTOMER_REGISTER_TITLE=Anmeldung als neuer Kunde LINK_CUSTOMER_REGISTER=Neuer Kunde LINK_CUSTOMER_PASSWORD_TITLE=Neues Passwort erstellen LINK_CUSTOMER_PASSWORD=Passwort vergessen? +LINK_TO_BASKET=Zum Warenkorb +LINK_CONTINUE_SHOPPING=Weiter einkaufen +LINK_CONTINUE_SHOPPING_TITLE=Klicken zum Fortfahren mit dem Einkauf. +PAGE_TITLE_INDEX_SHOW_BASKET=Warenkorb anzeigen +SUB_TITLE_INDEX_SHOW_BASKET=Alle im Warenkorb befindlichen Artikel: +GUEST_ITEM_TITLE=Artikel: +BUTTON_CHANGE_ITEM_AMOUNT=\u00c4ndern +PAGE_TITLE_INDEX_IMPRINT=Impressum +SUB_TITLE_INDEX_IMPRINT=Impressum +PAGE_TITLE_INDEX_ITEM_ADDED=Produkt zum Warenkorb hinzugef\u00fcgt +SUB_TITLE_INDEX_ITEM_ADDED=Produkt zum Warenkorb hinzugef\u00fcgt +GUEST_ITEM_ADDED_TO_BASKET=Der Artikel {0} wurde zum Warenkorb hinzugef\u00fcgt. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index f8e18cc2..530f47c3 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -16,11 +16,10 @@ GENDER_UNKNOWN=Unknown GENDER_MALE=Mr. GENDER_FEMALE=Mrs. GENDER_COMPANY=Company -MiniBasketTag.basket_is_empty=The basket is empty. -MiniBasketTag.last_item=Last added item: {0} -MiniBasketTag.additional_items=There are {0} items in the basketController. -MiniBasketTag.to_basket=To basket -MiniBasketTag.header=Basket +MINI_BASKET_IS_EMPTY=The basket is empty. +MINI_BASKET_LAST_ITEM=Last added item: {0} +MINI_BASKET_ADDITIONAL_ITEMS=There are {0} items in the basketController. +MINI_BASKET_TITLE=Basket ADMIN_CATEGORY_HAS_NO_PARENT=No parent category YES=Yes NO=No @@ -41,7 +40,7 @@ LINK_CHANGE_IN_BASKET=Change in basket SINGLE_ITEM_PRICE=Single price: CHANGE_ITEM_AMOUNT=Change ordered amount: TOTAL_ITEM_PRICE=Sub total: -TOTAL_ORDER_PRICE=Gesamtsumme: +TOTAL_ORDER_PRICE=Total: NO_ITEMS_ADDED_TO_BASKET=There are no items in the basket. ITEM_NOT_ORDERED=Not ordered. PAGE_TITLE_ADMIN_WELCOME=Welcome to administration area @@ -58,16 +57,16 @@ SUB_TITLE_ADMIN_PRODUCTS=These products has been created: PAGE_TITLE_ADMIN_PRODUCTS=Products BUTTON_RESET_FORM=Reset form BUTTON_EDIT_ENTRIES=Edit -BUTTON_DELETE_ENTRIES=Delete +BUTTON_ADMIN_DELETE_ENTRIES=Delete ADMIN_ADD_PRODUCT_TITLE=Add a new product: ADMIN_ADD_CATEGORY_TITLE=Add a new category: CATEGORY=Category: PLEASE_FILL_ALL_FIELDS=Please fill out all fields: -BUTTON_ADD_CATEGORY=Add category +BUTTON_ADMIN_ADD_CATEGORY=Add category ADMIN_ENTER_PRODUCT_TITLE=Product title: ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE=e.g. Pizza Italia IS_AVAILABLE=Available: -BUTTON_ADD_PRODUCT=Add product +BUTTON_ADMIN_ADD_PRODUCT=Add product ADMIN_ADD_PRODUCT_NOTICE_TITLE=Notices for adding new product: ADMIN_ADD_PRODUCT_NOTICE_LINE1=Please don't use currency symbol, such as \u20ac. ADMIN_ADD_PRODUCT_NOTICE_LINE2=Separte with dot, not with comma (usual in Germany). @@ -78,7 +77,7 @@ GUEST_ENTER_LOGIN_DATA_LEGEND=Please enter your login data: CUSTOMER_NUMBER=Customer number: PASSWORD=Password: BUTTON_CUSTOMER_LOGIN=Login to customer area -LINK_HOME_TITLE=Eingangsseite +LINK_HOME_TITLE=Home page LINK_HOME=Home LINK_BASKET=Basket LINK_CLOSE_SESSION_TITLE=Close session @@ -91,3 +90,15 @@ LINK_CUSTOMER_REGISTER_TITLE=Registration for new customer LINK_CUSTOMER_REGISTER=Registration LINK_CUSTOMER_PASSWORD_TITLE=Create new password LINK_CUSTOMER_PASSWORD=Lost password? +LINK_TO_BASKET=To basket +LINK_CONTINUE_SHOPPING=Continue shopping +LINK_CONTINUE_SHOPPING_TITLE=Click to continue shopping. +PAGE_TITLE_INDEX_SHOW_BASKET=Show basket +SUB_TITLE_INDEX_SHOW_BASKET=Following items are in basket: +GUEST_ITEM_TITLE=Item: +BUTTON_CHANGE_ITEM_AMOUNT=Change +PAGE_TITLE_INDEX_IMPRINT=Imprint +SUB_TITLE_INDEX_IMPRINT=Imprint: +PAGE_TITLE_INDEX_ITEM_ADDED=Item has been added to basket +SUB_TITLE_INDEX_ITEM_ADDED=Item has been added to basket: +GUEST_ITEM_ADDED_TO_BASKET=The item {0} has been added to the basket. diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java index 51befd64..09f4e10c 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.basket; +import java.text.MessageFormat; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; @@ -87,26 +88,26 @@ public class BasketWebBean extends BaseFrameworkBean implements BasketWebControl public String addItem (final Product product) { // Generate item instance AddableBasketItem item = new BasketItem(product, this.getAmount()); - + // Is amount set? if (this.getAmount() == null) { // No amount specified?! return null; } - + try { // item should not be null if (null == item) { // Abort here throw new NullPointerException("item is null"); //NOI18N } - + // Deligate to model this.basket.addItem(item); - + // Remove amount this.setAmount(null); - + // Added return "item_added"; //NOI18N } catch (final BasketItemAlreadyAddedException ex) { @@ -290,6 +291,34 @@ public class BasketWebBean extends BaseFrameworkBean implements BasketWebControl return isAdded; } + @Override + public String outputLastAddedItem () { + // Default message + String lastItem = ""; //NOI18N + + // Get instance + AddableBasketItem item = this.getLast(); + + // Is it set? + if (item instanceof AddableBasketItem) { + // Get type + switch (item.getItemType()) { + case "product": // Sellable product //NOI18N + assert(item.getProduct() instanceof Product) : MessageFormat.format("item {0} has no product instance set.", item); //NOI18N + + // Get title + lastItem = item.getProduct().getTitle(); + break; + + default: // Not supported + throw new FacesException(MessageFormat.format("item type {0} is not supported.", item.getItemType())); //NOI18N + } + } + + // Return it + return lastItem; + } + /** * Getter for basket bean instance * diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java index 677c3c96..46d5b40c 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java @@ -150,4 +150,11 @@ public interface BasketWebController extends Serializable { * @return Page redirection */ public String changeItem (final AddableBasketItem item); + + /** + * Outputs last added item in the basket. + * + * @return Last added item + */ + public String outputLastAddedItem(); } diff --git a/web/WEB-INF/templates.dist/admin_page.xhtml b/web/WEB-INF/templates.dist/admin_page.xhtml index c83abe25..23940e06 100644 --- a/web/WEB-INF/templates.dist/admin_page.xhtml +++ b/web/WEB-INF/templates.dist/admin_page.xhtml @@ -1,4 +1,5 @@ + + + + +
+ +
+ @@ -83,7 +84,7 @@ diff --git a/web/admin/index.xhtml b/web/admin/index.xhtml index 5a7b1e44..d1f2e75f 100644 --- a/web/admin/index.xhtml +++ b/web/admin/index.xhtml @@ -1,4 +1,5 @@ + + - + @@ -120,7 +121,7 @@ diff --git a/web/basket.xhtml b/web/basket.xhtml index d8860243..a878d563 100644 --- a/web/basket.xhtml +++ b/web/basket.xhtml @@ -1,4 +1,5 @@ + - Warenkorb anzeigen + #{msg.PAGE_TITLE_INDEX_SHOW_BASKET} - Alle im Warenkorb befindlichen Artikel: + #{msg.SUB_TITLE_INDEX_SHOW_BASKET} - Artikel: + #{msg.GUEST_ITEM_TITLE} #{item.product.title} @@ -42,7 +43,7 @@ #{msg.CHANGE_ITEM_AMOUNT} - +