Patch to get the shipping quote labels (entered by shop-admin) translated with i18n

Taken from:
http://www.ubercart.org/forum/internationalization/15162/multilingual_sh...

Please take this in the next .dev (uc_flaterate)

change line 181
from:

          $method->label,

to:

          t($method->label),

and line 241
from:

    $quotes[] = array('rate' => $altered, 'format' => $formatted, 'option_label' => check_plain($method->label));

to:

    $quotes[] = array('rate' => $altered, 'format' => $formatted, 'option_label' => check_plain(t($method->label)));

Thanks to kyk from ubercart.org

Comments

blecheimer’s picture

Sorry: changes are in uc_flatrate.module

tr’s picture

Category: bug » feature
Priority: Critical » Normal
Status: Patch (to be ported) » Needs work

No, you can't translate arbitrary string variables using t(). The method names used by flatrate are user-defined and stored in the database.

tr’s picture

tr’s picture

Status: Needs work » Closed (duplicate)

Closing this in favor of handling all these issues directly in #1066364: META: Make custom data translatable

pieterdc’s picture

The patch from @blecheimer works for me.
Thanks for sharing.