Internationalization of email templates

This commit is contained in:
Franck Allimant
2014-04-21 18:52:26 +02:00
parent 1283e078f0
commit bcf9e53a04
4 changed files with 70 additions and 37 deletions

View File

@@ -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}

View File

@@ -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}

View File

@@ -10,7 +10,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>courriel de confirmation de commande de {config key="url_site"} </title>
<title>{intl l="Courriel de confirmation de commande de %uil" url={config key="url_site"}}</title>
{literal}
<style type="text/css">body {font-family: Arial, Helvetica, sans-serif; font-size:100%; text-align:center;}#liencompte {margin:15px 0 ; text-align:center; font-size:10pt;}#wrapper {width:480pt;margin:0 auto;}#entete {padding-bottom:20px;margin-bottom:10px;border-bottom:1px dotted #000;}#logotexte {float:left;width:180pt;height:75pt;border:1pt solid #000;font-size:18pt;text-align:center;}#logoimg{float:left;}#h2 {margin:0;padding:0;font-size:140%;text-align:center;}#h3 {margin:0;padding:0;font-size:120%;text-align:center;}#tableprix {margin:0 auto;border-collapse:collapse;font-size:80%;}#intitules {font-weight:bold;text-align:center;}#ref {width:65pt;border:1px solid #000;}#designation {width:278pt;border:1px solid #000;}#pu {width:65pt;border:1px solid #000;}#qte {width:60pt;border:1px solid #000;}.ligneproduit{font-weight:normal;}.cellref{text-align:right;padding-right:6pt;border:1px solid #000;}.celldsg{text-align:left;padding-left:6pt;border:1px solid #000;}.cellpu{text-align:right;padding-right:6pt;border:1px solid #000;}.cellqte{text-align:right;padding-right:6pt;border:1px solid #000;}.lignevide{border-bottom:1px solid #000;}.totauxtitre{text-align:right;padding-right:6pt;border-left:1px solid #000;}.totauxcmdtitre{text-align:right;padding-right:6pt;border-left:1px solid #000;border-bottom:1px solid #000;}.totauxprix{text-align:right;padding-right:6pt;border:1px solid #000;}.blocadresses{display:inline;float:left;width:228pt;margin:12pt 4pt 12pt 5pt;font-size:80%;line-height:18pt;text-align:left;border:1px solid #000;}.stylenom{margin:0;padding:0 0 0 10pt;border-bottom:1px solid #000;}.styleliste{margin:0;padding:0 0 0 10pt;}</style>
{/literal}
@@ -18,16 +18,16 @@
<body>
<div id="wrapper">
<div id="entete"><h1 id="logotexte">{config key="company_name"}</h1>
<h2 id="info">Confirmation de commande</h2>
<h2 id="info">{intl l="Confirmation de commande"}</h2>
<h3 id="commande">N&deg; {$REF} du <span style="font-size:80%">{format_date date=$INVOICE_DATE output="date"}</span></h3>
</div>
<table id="tableprix" border="0">
<tbody>
<tr id="intitules">
<th id="ref">R&eacute;f&eacute;rence</th>
<th id="designation">D&eacute;signation</th>
<th id="pu">P.U. &euro;</th>
<th id="qte">Qt&eacute;</th>
<th id="ref">{intl l="Référence"}</th>
<th id="designation">{intl l="Désignation"}</th>
<th id="pu">{intl l="P.U. %currency" currency=$orderCurrency}</th>
<th id="qte">{intl l="Qté"}</th>
</tr>
{loop type="order_product" name="order-products" order=$ID}
{if $WAS_IN_PROMO == 1}
@@ -57,7 +57,7 @@
<td class="lignevide" colspan="4">&nbsp;</td>
</tr>
<tr class="ligneproduit">
<td class="totauxtitre" colspan="3">Montant total avant remise &euro;</td>
<td class="totauxtitre" colspan="3">{intl l="Montant total avant remise %currency" currency=$orderCurrency}</td>
<td class="totauxprix">{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}</td>
</tr>
<tr class="ligneproduit">
@@ -65,42 +65,42 @@
<td class="totauxprix">{$orderCurrency} {$POSTAGE}</td>
</tr>
<tr class="ligneproduit">
<td class="totauxcmdtitre" colspan="3">Montant total de la commande &euro;</td>
<td class="totauxcmdtitre" colspan="3">{intl l="Montant total de la commande%currency" currency=$orderCurrency}</td>
<td class="totauxprix">{$orderCurrency} {$TOTAL_TAXED_AMOUNT}</td>
</tr>
</tbody>
</table>
<div class="blocadresses">
<p class="stylenom">LIVRAISON : {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}</p>
<p class="stylenom">{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{intl l="LIVRAISON : %module" module=$TITLE}{/loop}</p>
{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}
<p class="styleliste">N&deg; de client : {$customer_ref}</p>
<p class="styleliste">Nom :
<p class="styleliste">{intl l="N° de client : %ref" ref=$customer_ref}</p>
<p class="styleliste">{intl l="Nom :"}
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}</p>
<p class="styleliste">N&deg; et rue :
<p class="styleliste">{intl l="N° et rue :"}
{$ADDRESS1}</p>
<p class="styleliste">Compl&eacute;ment : {$ADDRESS2}
<p class="styleliste">{intl l="Complément : "}{$ADDRESS2}
{$ADDRESS3}</p>
<p class="styleliste">Code postal : {$ZIPCODE}</p>
<p class="styleliste">Ville : {$CITY}</p>
<p class="styleliste">Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}</p>
<p class="styleliste">{intl l="Code postal : %zip" zip=$ZIPCODE}</p>
<p class="styleliste">{intl l="Ville : %city" city=$CITY}</p>
<p class="styleliste">{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}</p>
</div>
{/loop}
<div class="blocadresses">
<p class="stylenom">FACTURATION : paiement par {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}</p>
<p class="stylenom">{loop name="payment-module" type="module" id=$PAYMENT_MODULE}{intl l="FACTURATION : paiement par %module" module=$TITLE}{/loop}</p>
{loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS}
<p class="styleliste">N&deg; de client : {$customer_ref}</p>
<p class="styleliste">N° de client : {$customer_ref}</p>
<p class="styleliste">Nom :
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}</p>
<p class="styleliste">N&deg; et rue :
<p class="styleliste">{intl l="N° et rue :"}
{$ADDRESS1}</p>
<p class="styleliste">Compl&eacute;ment : {$ADDRESS2}
<p class="styleliste">{intl l="Complément : "}{$ADDRESS2}
{$ADDRESS3}</p>
<p class="styleliste">Code postal : {$ZIPCODE}</p>
<p class="styleliste">Ville : {$CITY}</p>
<p class="styleliste">Pays : {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}</p>
<p class="styleliste">{intl l="Code postal : %zip" zip=$ZIPCODE}</p>
<p class="styleliste">{intl l="Ville : %city" city=$CITY}</p>
<p class="styleliste">{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}</p>
</div>
{/loop}
<p id="liencompte">Le suivi de votre commande est disponible dans la rubrique mon compte sur <a href="{config key="url_site"}">{config key="url_site"}</a></p>
<p id="liencompte">{intl l="Le suivi de votre commande est disponible dans la rubrique mon compte sur <a href=\"%url\">%url</a>" url={config key="url_site"}}</p>
</div>
</body>
</html>

View File

@@ -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}
{loop name="currency.order" type="currency" id=$CURRENCY}
{assign "orderCurrency" $CODE}
{/loop}
{/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}