Commit cff805629f276879c9a50839f8a939ce26990439

Authored by Maxime Biloé
Committed by GitHub
2 parents 6a8bd033 547f568c
Exists in feat/starter-theme

Merge pull request #20 from AlexEven/domains

Add translation domains for 1.7
bankwire.php
... ... @@ -70,14 +70,14 @@ class BankWire extends PaymentModule
70 70 $this->bootstrap = true;
71 71 parent::__construct();
72 72  
73   - $this->displayName = $this->l('Bank wire');
74   - $this->description = $this->l('Accept payments for your products via bank wire transfer.');
75   - $this->confirmUninstall = $this->l('Are you sure about removing these details?');
  73 + $this->displayName = $this->getTranslator()->trans('Bank wire', array(), 'Modules.BankWire.Admin');
  74 + $this->description = $this->getTranslator()->trans('Accept payments for your products via bank wire transfer.', array(), 'Modules.BankWire.Admin');
  75 + $this->confirmUninstall = $this->getTranslator()->trans('Are you sure about removing these details?', array(), 'Modules.BankWire.Admin');
76 76 if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) {
77   - $this->warning = $this->l('Account owner and account details must be configured before using this module.');
  77 + $this->warning = $this->getTranslator()->trans('Account owner and account details must be configured before using this module.', array(), 'Modules.BankWire.Admin');
78 78 }
79 79 if (!count(Currency::checkPaymentCurrencies($this->id))) {
80   - $this->warning = $this->l('No currency has been set for this module.');
  80 + $this->warning = $this->getTranslator()->trans('No currency has been set for this module.', array(), 'Modules.BankWire.Admin');
81 81 }
82 82  
83 83 $this->extra_mail_vars = array(
... ... @@ -118,9 +118,9 @@ class BankWire extends PaymentModule
118 118 {
119 119 if (Tools::isSubmit('btnSubmit')) {
120 120 if (!Tools::getValue('BANK_WIRE_DETAILS')) {
121   - $this->_postErrors[] = $this->l('Account details are required.');
  121 + $this->_postErrors[] = $this->getTranslator()->trans('Account details are required.', array(), 'Modules.BankWire.Admin');
122 122 } elseif (!Tools::getValue('BANK_WIRE_OWNER')) {
123   - $this->_postErrors[] = $this->l('Account owner is required.');
  123 + $this->_postErrors[] = $this->getTranslator()->trans('Account owner is required.', array(), "Modules.BankWire.Admin");
124 124 }
125 125 }
126 126 }
... ... @@ -142,7 +142,7 @@ class BankWire extends PaymentModule
142 142 Configuration::updateValue('BANK_WIRE_RESERVATION_DAYS', Tools::getValue('BANK_WIRE_RESERVATION_DAYS'));
143 143 Configuration::updateValue('BANK_WIRE_CUSTOM_TEXT', $custom_text);
144 144 }
145   - $this->_html .= $this->displayConfirmation($this->l('Settings updated'));
  145 + $this->_html .= $this->displayConfirmation($this->getTranslator()->trans('Settings updated', array(), 'Admin.Global'));
146 146 }
147 147  
148 148 protected function _displayBankWire()
... ... @@ -186,7 +186,7 @@ class BankWire extends PaymentModule
186 186 );
187 187  
188 188 $newOption = new PaymentOption();
189   - $newOption->setCallToActionText($this->l('Pay by Bank Wire'))
  189 + $newOption->setCallToActionText($this->getTranslator()->trans('Pay by Bank Wire', array(), 'Modules.BankWire.Shop'))
190 190 ->setAction($this->context->link->getModuleLink($this->name, 'validation', array(), true))
191 191 ->setAdditionalInformation($this->context->smarty->fetch('module:bankwire/views/templates/hook/bankwire_intro.tpl'));
192 192 $payment_options = [
... ... @@ -268,32 +268,32 @@ class BankWire extends PaymentModule
268 268 $fields_form = array(
269 269 'form' => array(
270 270 'legend' => array(
271   - 'title' => $this->l('Contact details'),
  271 + 'title' => $this->getTranslator()->trans('Contact details', array(), 'Modules.BankWire.Admin'),
272 272 'icon' => 'icon-envelope'
273 273 ),
274 274 'input' => array(
275 275 array(
276 276 'type' => 'text',
277   - 'label' => $this->l('Account owner'),
  277 + 'label' => $this->getTranslator()->trans('Account owner', array(), 'Modules.BankWire.Admin'),
278 278 'name' => 'BANK_WIRE_OWNER',
279 279 'required' => true
280 280 ),
281 281 array(
282 282 'type' => 'textarea',
283   - 'label' => $this->l('Details'),
  283 + 'label' => $this->getTranslator()->trans('Details', array(), 'Modules.BankWire.Admin'),
284 284 'name' => 'BANK_WIRE_DETAILS',
285   - 'desc' => $this->l('Such as bank branch, IBAN number, BIC, etc.'),
  285 + 'desc' => $this->getTranslator()->trans('Such as bank branch, IBAN number, BIC, etc.', array(), 'Modules.BankWire.Admin'),
286 286 'required' => true
287 287 ),
288 288 array(
289 289 'type' => 'textarea',
290   - 'label' => $this->l('Bank address'),
  290 + 'label' => $this->getTranslator()->trans('Bank address', array(), 'Modules.BankWire.Admin'),
291 291 'name' => 'BANK_WIRE_ADDRESS',
292 292 'required' => true
293 293 ),
294 294 ),
295 295 'submit' => array(
296   - 'title' => $this->l('Save'),
  296 + 'title' => $this->getTranslator()->trans('Save', array(), 'Admin.Actions'),
297 297 )
298 298 ),
299 299 );
... ... @@ -370,7 +370,7 @@ class BankWire extends PaymentModule
370 370 {
371 371 $cart = $this->context->cart;
372 372 $total = sprintf(
373   - $this->l('%1$s (tax incl.)'),
  373 + $this->getTranslator()->trans('%1$s (tax incl.)', array(), 'Modules.BankWire.Shop'),
374 374 Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH))
375 375 );
376 376  
... ...
controllers/front/payment.php
... ... @@ -44,7 +44,7 @@ class BankwirePaymentModuleFrontController extends ModuleFrontController
44 44 Tools::redirect('index.php?controller=order');
45 45  
46 46 $total = sprintf(
47   - $this->l('%1$s (tax incl.)'),
  47 + $this->getTranslator()->trans('%1$s (tax incl.)', array(), 'Modules.BankWire.Shop'),
48 48 Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH))
49 49 );
50 50  
... ...
controllers/front/validation.php
... ... @@ -47,7 +47,7 @@ class BankwireValidationModuleFrontController extends ModuleFrontController
47 47 break;
48 48 }
49 49 if (!$authorized)
50   - die($this->module->l('This payment method is not available.', 'validation'));
  50 + die($this->module->getTranslator()->trans('This payment method is not available.', array(), 'Modules.BankWire.Shop'));
51 51  
52 52 $customer = new Customer($cart->id_customer);
53 53 if (!Validate::isLoadedObject($customer))
... ...
validation.php
... ... @@ -48,7 +48,7 @@ foreach (Module::getPaymentModules() as $module)
48 48 break;
49 49 }
50 50 if (!$authorized)
51   - die($bankwire->l('This payment method is not available.', 'validation'));
  51 + die($bankwire->getTranslator()->trans('This payment method is not available.', array(), 'Modules.BankWire.Shop'));
52 52  
53 53 $customer = new Customer((int)$cart->id_customer);
54 54  
... ...
views/templates/hook/infos.tpl
... ... @@ -25,7 +25,7 @@
25 25  
26 26 <div class="alert alert-info">
27 27 <img src="../modules/bankwire/bankwire.jpg" style="float:left; margin-right:15px;" width="86" height="49">
28   -<p><strong>{l s="This module allows you to accept secure payments by bank wire." mod='bankwire'}</strong></p>
29   -<p>{l s="If the client chooses to pay by bank wire, the order's status will change to 'Waiting for Payment.'" mod='bankwire'}</p>
30   -<p>{l s="That said, you must manually confirm the order upon receiving the bank wire." mod='bankwire'}</p>
  28 +<p><strong>{l s="This module allows you to accept secure payments by bank wire." d='Modules.BankWire.Admin'}</strong></p>
  29 +<p>{l s="If the client chooses to pay by bank wire, the order's status will change to 'Waiting for Payment.'" d='Modules.BankWire.Admin'}</p>
  30 +<p>{l s="That said, you must manually confirm the order upon receiving the bank wire." d='Modules.BankWire.Admin'}</p>
31 31 </div>
... ...
views/templates/hook/payment.tpl
... ... @@ -24,8 +24,8 @@
24 24 *}
25 25  
26 26 <p class="payment_module">
27   - <a href="{$link->getModuleLink('bankwire', 'payment')|escape:'html'}" title="{l s='Pay by bank wire' mod='bankwire'}">
28   - <img src="{$this_path_bw}bankwire.jpg" alt="{l s='Pay by bank wire' mod='bankwire'}" width="86" height="49"/>
29   - {l s='Pay by bank wire' mod='bankwire'}&nbsp;<span>{l s='(order processing will be longer)' mod='bankwire'}</span>
  27 + <a href="{$link->getModuleLink('bankwire', 'payment')|escape:'html'}" title="{l s='Pay by bank wire' d='Modules.BankWire.Shop'}">
  28 + <img src="{$this_path_bw}bankwire.jpg" alt="{l s='Pay by bank wire' d='Modules.BankWire.Shop'}" width="86" height="49"/>
  29 + {l s='Pay by bank wire' d='Modules.BankWire.Shop'}&nbsp;<span>{l s='(order processing will be longer)' d='Modules.BankWire.Shop'}</span>
30 30 </a>
31   -</p>
32 31 \ No newline at end of file
  32 +</p>
... ...