8 replies [Last post]
kyk
kyk's picture
Offline
Joined: 01/23/2010
Juice: 9
Was this information Helpful?

What's the best way to enable multilingual flatrate shipping quote label (displayed under the Checkout - Calculate Shipping Cost pane)? The flatrate quote settings (admin/store/settings/quotes/methods/flatrate) captures the label only in a single language. I have attempted to use the string translation function t() to provide a translation for the label, however i'm not quite sure where to apply the t() function. Would it be line 812 in uc_quote.module as follows? Or is there a better way to handle this? I'm also using the autocalc shipping module to perform the calculation upon page load. Any help is appreciated!

var label = t(quoteButton.parent("label").text().split(":", 2)[0]);

lesliewu's picture
Offline
Joined: 09/05/2009
Juice: 47
Re: Multilingual Shipping Quote Label

I would like to know how to translate the flatrate labels too. Perhaps this could be made into a multilingual variable like a lot of the other fields in ubercart.

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Re: Multilingual Shipping Quote Label

AFAIK it is already translated, you just need to have it in your .po file.

For my site I download the japanese translation files and that's all I needed. For me the translation is in this file:

shipping/shipping.ja.po
#: uc_quote/uc_quote.admin.inc:80 uc_quote/uc_quote.module:763

But you can put it in any file as long as you the upload it manually (admin/build/translate/import/file)

kyk
kyk's picture
Offline
Joined: 01/23/2010
Juice: 9
t($method->label)

Thanks totsubo. What i meant was i wanted to get the labels of my newly configured flatrate shipping quote methods to be translated, not the administration page for flatrate shipping quote.

Haven't had time to look into this one for the past week. Just tried applying the t() function again to get the translation on the shipping quote method label and this time successfully. Quite obviously the t() should be applied to $method->label and this occurs twice in uc_flatrate.module. Things just appear to be more intuitive after dabbling with drupal for 2 weeks.

lesliewu's picture
Offline
Joined: 09/05/2009
Juice: 47
Re: Multilingual Shipping Quote Label

I would like to know how to translate these flat rate labels too. Thanks.

kyk
kyk's picture
Offline
Joined: 01/23/2010
Juice: 9
Here's how

As i've said in my post before, you need to find the file uc_flatrate.module inside the ubercart module, change the two occurences of $method->label to t($method->label), perform the checkout once so drupal will pick up those strings that need translation, and do String translation (search for those terms that need to be translated). See this page for how to do String translation:

http://drupal-translation.com/content/translating-user-interface-strings

xbox360blackfriday (not verified)
xbox360blackfriday's picture
I Want To For You HELP

I would like to know how to translate these flat rate labels too

majnoona@drupal.org's picture
Offline
Joined: 07/02/2009
Juice: 90
Re: Here's how

I know this is an old thread, but the hack works.

Note that if you use other shipping modules (flatratepercentage for example) you have to change those as well.

Seems like an easy patch to submit...

isaac (not verified)
xbox360blackfriday's picture
abc

I know this is an old thread, but the hack works.armani watches