You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/10/09 23:20:43 UTC
svn commit: r823694 - in /ofbiz/trunk/applications/order:
config/OrderErrorUiLabels.xml
src/org/ofbiz/order/shoppingcart/ShoppingCart.java
src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
Author: jleroux
Date: Fri Oct 9 21:20:42 2009
New Revision: 823694
URL: http://svn.apache.org/viewvc?rev=823694&view=rev
Log:
I18n of some promotion code errors and French labels
Modified:
ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=823694&r1=823693&r2=823694&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Fri Oct 9 21:20:42 2009
@@ -3705,6 +3705,35 @@
<value xml:lang="zh">é误ï¼è®¢å没ææç»</value>
<value xml:lang="zh_CN">é误: 没æé¡¹ç®å°è®¢å</value>
</property>
+ <property key="productpromoworker.promotion_code_already_been_entered">
+ <value xml:lang="en">The promotion code [${productPromoCodeId}] has already been entered.</value>
+ <value xml:lang="fr">Le code de promotion [${productPromoCodeId}] a déjà été utilisé.</value>
+ </property>
+ <property key="productpromoworker.promotion_code_is_expired_at">
+ <value xml:lang="en">The promotion code [${productPromoCodeId}] has expired at: ${thruDate}</value>
+ <value xml:lang="fr">Le code de promotion [${productPromoCodeId}] s'est achevé le ${thruDate}</value>
+ </property>
+ <property key="productpromoworker.promotion_code_error_lookup">
+ <value xml:lang="en">Error looking up promotion code [${productPromoCodeId}]: {errorMsg}</value>
+ <value xml:lang="fr">Erreur lors de la recherche du code de promotion [${productPromoCodeId}]: {errorMsg}</value>
+ </property>
+ <property key="productpromoworker.promotion_code_maximum_limit">
+ <value xml:lang="en">This promotion code (${productPromoCodeId}) has reached it's maximum use limit for you and can no longer be used.</value>
+ <value xml:lang="fr">Ce code de promotion (${productPromoCodeId}) a atteint sa limite d'usage pour vous et ne plus être utilisé.</value>
+ </property>
+ <property key="productpromoworker.promotion_code_no_account_or_email">
+ <value xml:lang="en">The promotion code [${productPromoCodeId}] requires you to be associated with it by account or email address and you are not associated with it.</value>
+ <value xml:lang="fr">Le code de promotion [${productPromoCodeId}] nécessite que vous y soyez associé par un compte ou une adresse courriel ce qui n'est pas le cas</value>
+ </property>
+ <property key="productpromoworker.promotion_code_not_valid">
+ <value xml:lang="en">The promotion code [${productPromoCodeId}] is not valid.</value>
+ <value xml:lang="fr">Le code de promotion [${productPromoCodeId}] n'existe pas.</value>
+ </property>
+
+ <property key="productpromoworker.promotion_code_will_be_activated_at">
+ <value xml:lang="en">The promotion code [${productPromoCodeId}] will be activated at: {fromDate}</value>
+ <value xml:lang="fr">Le code de promotion [${productPromoCodeId}] sera activé le ${fromDate}</value>
+ </property>
<property key="product.no_longer_for_sale">
<value xml:lang="de">Sie haben versucht, das Produkt {0} (Produkt ID: {1}) zu bestellen. Dieses Produkt wird nicht mehr verkauft. Bitte entfernen Sie es aus dem Warenkorb.</value>
<value xml:lang="en">Tried to order the Product {0} (productId: {1}). This product is no longer available for sale. Please remove from your order.</value>
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=823694&r1=823693&r2=823694&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Fri Oct 9 21:20:42 2009
@@ -1005,7 +1005,7 @@
Iterator promoCodeIter = this.productPromoCodes.iterator();
while (promoCodeIter.hasNext()) {
String promoCode = (String) promoCodeIter.next();
- String checkResult = ProductPromoWorker.checkCanUsePromoCode(promoCode, partyId, this.getDelegator());
+ String checkResult = ProductPromoWorker.checkCanUsePromoCode(promoCode, partyId, this.getDelegator(), locale);
if (checkResult != null) {
promoCodeIter.remove();
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderOnUserChangePromoCodeWasRemovedBecause", UtilMisc.toMap("checkResult",checkResult), locale), module);
@@ -3156,10 +3156,10 @@
*/
public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher) {
if (this.productPromoCodes.contains(productPromoCodeId)) {
- return "The promotion code [" + productPromoCodeId + "] has already been entered.";
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale);
}
// if the promo code requires it make sure the code is valid
- String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator());
+ String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), locale);
if (checkResult == null) {
this.productPromoCodes.add(productPromoCodeId);
// new promo code, re-evaluate promos
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=823694&r1=823693&r2=823694&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Fri Oct 9 21:20:42 2009
@@ -533,21 +533,23 @@
return codeUseLimit;
}
- public static String checkCanUsePromoCode(String productPromoCodeId, String partyId, Delegator delegator) {
+ public static String checkCanUsePromoCode(String productPromoCodeId, String partyId, Delegator delegator, Locale locale) {
try {
GenericValue productPromoCode = delegator.findByPrimaryKey("ProductPromoCode", UtilMisc.toMap("productPromoCodeId", productPromoCodeId));
if (productPromoCode == null) {
- return "The promotion code [" + productPromoCodeId + "] is not valid.";
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_not_valid", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale);
}
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
- if (productPromoCode.getTimestamp("thruDate") != null) {
- if (nowTimestamp.after(productPromoCode.getTimestamp("thruDate"))) {
- return "The promotion code [" + productPromoCodeId + "] is expired in: " + productPromoCode.getTimestamp("thruDate");
+ Timestamp thruDate = productPromoCode.getTimestamp("thruDate");
+ if (thruDate != null) {
+ if (nowTimestamp.after(thruDate)) {
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_is_expired_at", UtilMisc.toMap("productPromoCodeId", productPromoCodeId, "thruDate", thruDate), locale);
}
}
- if (productPromoCode.getTimestamp("fromDate") != null) {
- if (nowTimestamp.before(productPromoCode.getTimestamp("fromDate"))) {
- return "The promotion code [" + productPromoCodeId + "] will be activated in: " + productPromoCode.getTimestamp("fromDate");
+ Timestamp fromDate = productPromoCode.getTimestamp("fromDate");
+ if (fromDate != null) {
+ if (nowTimestamp.before(fromDate)) {
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_will_be_activated_at", UtilMisc.toMap("productPromoCodeId", productPromoCodeId, "fromDate", fromDate), locale);
}
}
@@ -577,20 +579,20 @@
}
if (!hasEmailOrParty) {
- return "This promotion code [" + productPromoCodeId + "] requires you to be associated with it by account or email address and you are not associated with it.";
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_no_account_or_email", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale);
}
}
// check per customer and per promotion code use limits
Long useLimit = getProductPromoCodeUseLimit(productPromoCode, partyId, delegator);
if (useLimit != null && useLimit.longValue() <= 0) {
- return "This promotion code [" + productPromoCodeId + "] has reached it's maximum use limit for you and can no longer be used.";
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_maximum_limit", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale);
}
return null;
} catch (GenericEntityException e) {
Debug.logError(e, "Error looking up ProductPromoCode", module);
- return "Error looking up code [" + productPromoCodeId + "]:" + e.toString();
+ return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_error_lookup", UtilMisc.toMap("productPromoCodeId", productPromoCodeId, "errorMsg", e.toString()), locale);
}
}