From bcf9e53a04c32b23890e67299cd41b335b9ac086 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Mon, 21 Apr 2014 18:52:26 +0200 Subject: [PATCH] Internationalization of email templates --- .../email/default/default-html-layout.tpl | 15 ++++++ .../email/default/default-text-layout.tpl | 15 ++++++ ...on.html => sample_order_confirmation.html} | 48 +++++++++---------- ...tion.txt => sample_order_confirmation.txt} | 29 ++++++----- 4 files changed, 70 insertions(+), 37 deletions(-) rename templates/email/default/{order_confirmation.html => sample_order_confirmation.html} (69%) rename templates/email/default/{order_confirmation.txt => sample_order_confirmation.txt} (53%) diff --git a/templates/email/default/default-html-layout.tpl b/templates/email/default/default-html-layout.tpl index 2e96d2f35..a40c9f013 100644 --- a/templates/email/default/default-html-layout.tpl +++ b/templates/email/default/default-html-layout.tpl @@ -1,3 +1,14 @@ +{*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************} + {* This is the default HTML mail layout. Use {$message_body} as a placeholder for the HTML message defined in the 'HTML Message' field in the back-office, or the @@ -7,4 +18,8 @@ Be sure to use the nofilter modifier, to prevent HTML escaping. DO NOT DELETE THIS FILE, some plugins may use it. *} + +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='email.default'} + {block name='message-body'}{$message_body nofilter}{/block} \ No newline at end of file diff --git a/templates/email/default/default-text-layout.tpl b/templates/email/default/default-text-layout.tpl index aeb07e655..cd3d38a18 100644 --- a/templates/email/default/default-text-layout.tpl +++ b/templates/email/default/default-text-layout.tpl @@ -1,3 +1,14 @@ +{*************************************************************************************/ +/* This file is part of the Thelia package. */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : dev@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* For the full copyright and license information, please view the LICENSE.txt */ +/* file that was distributed with this source code. */ +/*************************************************************************************} + {* This is the default TEXT mail layout. Use {$message_body} as a placeholder for the text message defined in the 'TEXT Message' field in the back-office, or the @@ -7,4 +18,8 @@ Be sure to use the nofilter modifier, to prevent HTML escaping. DO NOT DELETE THIS FILE, some plugins may use it. *} + +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='email.default'} + {block name='message-body'}{$message_body nofilter}{/block} \ No newline at end of file diff --git a/templates/email/default/order_confirmation.html b/templates/email/default/sample_order_confirmation.html similarity index 69% rename from templates/email/default/order_confirmation.html rename to templates/email/default/sample_order_confirmation.html index 4441e52cd..cbc034c42 100644 --- a/templates/email/default/order_confirmation.html +++ b/templates/email/default/sample_order_confirmation.html @@ -10,7 +10,7 @@ - courriel de confirmation de commande de {config key="url_site"} + {intl l="Courriel de confirmation de commande de %uil" url={config key="url_site"}} {literal} {/literal} @@ -18,16 +18,16 @@

{config key="company_name"}

-

Confirmation de commande

+

{intl l="Confirmation de commande"}

N° {$REF} du {format_date date=$INVOICE_DATE output="date"}

- - - - + + + + {loop type="order_product" name="order-products" order=$ID} {if $WAS_IN_PROMO == 1} @@ -57,7 +57,7 @@ - + @@ -65,42 +65,42 @@ - +
RéférenceDésignationP.U. €Qté{intl l="Référence"}{intl l="Désignation"}{intl l="P.U. %currency" currency=$orderCurrency}{intl l="Qté"}
 
Montant total avant remise €{intl l="Montant total avant remise %currency" currency=$orderCurrency} {$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
{$orderCurrency} {$POSTAGE}
Montant total de la commande €{intl l="Montant total de la commande%currency" currency=$orderCurrency} {$orderCurrency} {$TOTAL_TAXED_AMOUNT}
-

LIVRAISON : {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

+

{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{intl l="LIVRAISON : %module" module=$TITLE}{/loop}

{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} -

N° de client : {$customer_ref}

-

Nom : +

{intl l="N° de client : %ref" ref=$customer_ref}

+

{intl l="Nom :"} {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

-

N° et rue : +

{intl l="N° et rue :"} {$ADDRESS1}

-

Complément : {$ADDRESS2} +

{intl l="Complément : "}{$ADDRESS2} {$ADDRESS3}

-

Code postal : {$ZIPCODE}

-

Ville : {$CITY}

-

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

+

{intl l="Code postal : %zip" zip=$ZIPCODE}

+

{intl l="Ville : %city" city=$CITY}

+

{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}

{/loop}
-

FACTURATION : paiement par {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}

+

{loop name="payment-module" type="module" id=$PAYMENT_MODULE}{intl l="FACTURATION : paiement par %module" module=$TITLE}{/loop}

{loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} -

N° de client : {$customer_ref}

+

N° de client : {$customer_ref}

Nom : {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

-

N° et rue : +

{intl l="N° et rue :"} {$ADDRESS1}

-

Complément : {$ADDRESS2} +

{intl l="Complément : "}{$ADDRESS2} {$ADDRESS3}

-

Code postal : {$ZIPCODE}

-

Ville : {$CITY}

-

Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}

+

{intl l="Code postal : %zip" zip=$ZIPCODE}

+

{intl l="Ville : %city" city=$CITY}

+

{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}

{/loop} -

Le suivi de votre commande est disponible dans la rubrique mon compte sur {config key="url_site"}

+

{intl l="Le suivi de votre commande est disponible dans la rubrique mon compte sur %url" url={config key="url_site"}}

diff --git a/templates/email/default/order_confirmation.txt b/templates/email/default/sample_order_confirmation.txt similarity index 53% rename from templates/email/default/order_confirmation.txt rename to templates/email/default/sample_order_confirmation.txt index ce2b40dac..8139a0557 100644 --- a/templates/email/default/order_confirmation.txt +++ b/templates/email/default/sample_order_confirmation.txt @@ -1,16 +1,19 @@ -{assign var="order_id" value=1} {loop name="order.invoice" type="order" id=$order_id customer="*"} - {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrency" $CODE} - {/loop} +{loop name="currency.order" type="currency" id=$CURRENCY} + {assign "orderCurrency" $CODE} +{/loop} +{intl l="Confirmation de la commande %ref du %date" ref={$REF} date={format_date date=$INVOICE_DATE}}\r\n\r\n + +{intl l="Votre adresse de livraison"}\r\n {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}\r\n {$ADDRESS1} {$ADDRESS2} {$ADDRESS3}\r\n {$ZIPCODE} {$CITY}\r\n {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}\r\n {/loop} -Confirmation de commande {$REF} du {format_date date=$INVOICE_DATE}\r\n\r\n -Les articles commandés:\r\n + +{intl l="Articles commandés:"}\r\n + {loop type="order_product" name="order-products" order=$ID} {if $WAS_IN_PROMO == 1} {assign "realPrice" $PROMO_PRICE} @@ -22,19 +25,19 @@ Les articles commandés:\r\n {assign "realTaxedPrice" $TAXED_PRICE} {/if} \r\n - Article : {$TITLE} + {intl l="Article : %item" item=$TITLE} {ifloop rel="combinations"} {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}\r\n {/loop} {/ifloop}\r\n - Quantité : {$QUANTITY}\r\n - Prix unitaire TTC : {$realTaxedPrice} {$orderCurrency}\r\n + {intl l="Quantité : %qy" qty=$QUANTITY}\r\n + {intl l="Prix unitaire TTC : %amout %currency" amount=$realTaxedPrice currency=$orderCurrency}\r\n {/loop} \r\n-----------------------------------------\r\n -Montant total TTC : {$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrency} \r\n -Frais de port TTC : {$POSTAGE} {$orderCurrency} \r\n -Somme totale: {$TOTAL_TAXED_AMOUNT} {$orderCurrency} \r\n +{intl l="Montant total TTC : %amout %currency" amount={$TOTAL_TAXED_AMOUNT - $POSTAGE} currency=$orderCurrency}\r\n +{intl l="Frais de port TTC : %amout %currency" amount={$POSTAGE} currency=$orderCurrency} \r\n +{intl l="Somme totale : %amout %currency" amount={$TOTAL_TAXED_AMOUNT} currency=$orderCurrency} \r\n ==================================\r\n\r\n -Votre facture est disponible dans la rubrique mon compte sur {config key="url_site"} +{intl l="Votre facture est disponible dans la rubrique mon compte sur %url" url={config key="url_site"}} {/loop} \ No newline at end of file