Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I found an ugly line of code in uc_shipping.admin.inc:
<?php
foreach (array_keys($shipping_types_products) as $type) {
$options[$type] = ucwords(str_replace('_', ' ', $type)); // Here is the ugly line.
}
$form['shipping_type'] = array('#type' => 'select',
'#title' => t('Shipping type'),
'#options' => $options,
'#default_value' => $package->shipping_type,
);
?>
Building the shipping type title out of its ID is really a bad practice.
Seeing that, it is not surprising that I could not translate shipping types!
Comment | File | Size | Author |
---|---|---|---|
#1 | uc_shipping.admin_.inc_.patch | 2.5 KB | anrikun |
Comments
Comment #1
anrikun CreditAttribution: anrikun commentedHere's a patch fixing this issue.
Comment #2
TR CreditAttribution: TR commentedThanks. This should have been done long ago! Committed fix to 6.x-2.x and 7.x-3.x.