Hardcoded header in cart overview

EPO - October 23, 2009 - 17:20
Project:e-Commerce
Version:6.x-4.0-rc13
Component:ec_cart
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

node-designart.tpl.php and ec-cart-view-form-extra.tpl.php contain hardcoded header in English. Because the project has multi language support you'd better replace them variable

     <thead>
      <th>Items</th>
      <th>Price</th>
      <th>Qty</th>
      <th>Total</th>
      <th><!-- Operations header --></th>
    </thead>

#1

EPO - October 26, 2009 - 11:37

In ec_customer.checkout.inc please change

           Line100      '#title' => t('Select @type address', array('@type' => $type)),
in

                              '#title' => t('Select @type address', array('@type' => t($type))),

So it is possible to translate 'billing' and 'shipping' in the appropriate terms.

#2

Xen.dk - October 29, 2009 - 20:41

Regarding #1, it might not be so simple in some languages. Depending on where $type is used, it could need different translations. For instance in danish, "Select billing address" might be "Angiv faktureringsadresse".

#3

EPO - October 29, 2009 - 22:39

@ #2: this was exactly the reason for my suggestion or you will get "Angiv Billingsadresse" with the old version of the code. Thats not quite good danish, isnt it? Try! You want 'Billings' changed in 'fakturerings'. This is what the t function accomplishes.

Here is another one in ec_cart/templates/themes.inc line 59:

$variables['item_count'] = t('%items in !your_cart', array('%items' => format_plural(count($variables['items']), '1 item', '@count items'), '!your_cart' => l(t('Your cart'), 'cart/view')));

better

$variables['item_count'] = t('%items in !your_cart', array('%items' => format_plural(count($variables['items']), '1 ' . t(item), '@count ' . t(items)), '!your_cart' => l(t('Your cart'), 'cart/view')));

I'll attach them to this thread, when I find them. Hope for correction in the next releases. Its no big issue.

#4

EPO - October 29, 2009 - 22:52

@ #2 Sorry, now I understand the reason for your objection. You think there is only one variable @type but with several different contents. This is correct. The contents of @type is 'Billing' or 'Shipping' depending of the context. But if you insert t(@type) you get all the different possibilities offered for translation. Funny Drupal.

 
 

Drupal is a registered trademark of Dries Buytaert.