Author: jleroux
Date: Thu Oct 3 15:11:52 2013
New Revision: 1528906
URL: http://svn.apache.org/r1528906
Log:
An attempt to localise the Google and Paypal checkout buttons.
Google always default to English it seems, at least then the sequel is in the
locale
(https://developers.google.com/checkout/developer/Google_Checkout_Basic_HTML_Google_Checkout_Buttons)
For Paypal when the buttons does no exits (work for fr_FR or nl_NL for instance
but not fr or nl_BE, etc.), fallbacks to en_US
Modified:
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/microcart.ftl
ofbiz/trunk/specialpurpose/ecommerce/widget/CartScreens.xml
Modified:
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/microcart.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/microcart.ftl?rev=1528906&r1=1528905&r2=1528906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/microcart.ftl
(original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/microcart.ftl
Thu Oct 3 15:11:52 2013
@@ -36,14 +36,17 @@ under the License.
<ul>
<li><a
href="<@ofbizUrl>view/showcart</@ofbizUrl>">[${uiLabelMap.OrderViewCart}]</a></li>
<#if (shoppingCartSize > 0)>
+ <#if !initialLocaleComplete?exists || initialLocaleComplete?length
== 2 >
+ <#assign initialLocaleComplete = "en_US">
+ </#if>
<li id="quickCheckoutEnabled"><a
href="<@ofbizUrl>quickcheckout</@ofbizUrl>">[${uiLabelMap.OrderCheckoutQuick}]</a></li>
<li id="quickCheckoutDisabled" style="display:none"
class="disabled">[${uiLabelMap.OrderCheckoutQuick}]</li>
<li id="onePageCheckoutEnabled"><a
href="<@ofbizUrl>onePageCheckout</@ofbizUrl>">[${uiLabelMap.EcommerceOnePageCheckout}]</a></li>
<li id="onePageCheckoutDisabled" style="display:none"
class="disabled">[${uiLabelMap.EcommerceOnePageCheckout}]</li>
- <li id="googleCheckoutEnabled"><a
href="<@ofbizUrl>googleCheckout</@ofbizUrl>"><img
src="https://checkout.google.com/buttons/checkout.gif?merchant_id=634321449957567&w=160&h=43&style=white&variant=text&loc=en_US"
alt="[${uiLabelMap.EcommerceCartToGoogleCheckout}]" /></a></li>
- <li id="googleCheckoutDisabled" style="display:none"
class="disabled"><img
src="https://checkout.google.com/buttons/checkout.gif?merchant_id=634321449957567&w=160&h=43&style=white&variant=text&loc=en_US"
alt="[${uiLabelMap.EcommerceCartToGoogleCheckout}]" /></li>
+ <li id="googleCheckoutEnabled"><a
href="<@ofbizUrl>googleCheckout</@ofbizUrl>"><img
src="https://checkout.google.com/buttons/checkout.gif?merchant_id=634321449957567&w=160&h=43&style=white&variant=text&loc=${initialLocaleComplete}"
alt="[${uiLabelMap.EcommerceCartToGoogleCheckout}]" /></a></li>
+ <li id="googleCheckoutDisabled" style="display:none"
class="disabled"><img
src="https://checkout.google.com/buttons/checkout.gif?merchant_id=634321449957567&w=160&h=43&style=white&variant=text&loc=${initialLocaleComplete}"
alt="[${uiLabelMap.EcommerceCartToGoogleCheckout}]" /></li>
<#if shoppingCart?has_content && (shoppingCart.getGrandTotal() > 0)>
- <li id="microCartPayPalCheckout"><a
href="<@ofbizUrl>setPayPalCheckout</@ofbizUrl>"><img
src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="[PayPal
Express Checkout]" /></a></li>
+ <li id="microCartPayPalCheckout"><a
href="<@ofbizUrl>setPayPalCheckout</@ofbizUrl>"><img
src="https://www.paypal.com/${initialLocaleComplete}/i/btn/btn_xpressCheckout.gif"
alt="[PayPal Express Checkout]"
onError="this.onerror=null;this.src='https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'"/></a></li>
</#if>
<#else>
<li class="disabled">[${uiLabelMap.OrderCheckoutQuick}]</li>
Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CartScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CartScreens.xml?rev=1528906&r1=1528905&r2=1528906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/CartScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/CartScreens.xml Thu Oct 3
15:11:52 2013
@@ -24,6 +24,9 @@ under the License.
<!-- Column Included Screens -->
<screen name="microcart">
<section>
+ <actions>
+ <set field="initialLocaleComplete" type="String"
value="${groovy:parameters?.userLogin?.lastLocale}"
default-value="${groovy:locale.toString()}"/>
+ </actions>
<widgets>
<platform-specific><html><html-template
location="component://ecommerce/webapp/ecommerce/cart/microcart.ftl"/></html></platform-specific>
</widgets>