6 replies [Last post]
kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Was this information Helpful?

Hi everyone.

Do anyone have any idea where I should start to make the form labels translatable? I'm talking about "First name", "Last name" etc. in delivery and billing panes during checkout.

I can change the actual values here: admin/store/settings/checkout/edit/fields
But that won't really let me translate them into other languages Smiling
(correct me if i'm wrong).

Where in the code can I add some nice t()'s to make a quick fix for this?

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
You'd have to add the t()'s

You'd have to add the t()'s into uc_cart_checkout_pane.inc in the function theme_address_pane(). Your best bet you just be to copy that function and override it in your theme so we don't break it again once you update. Eye-wink

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Thanks for the reply But

Thanks for the reply Smiling But this is something that's going to be added in ubercart core right? I'm trying to gather up all the issues we're having with using ubercart on a multi-language site. Once I have the list ready i'll post it here so you guys can look at the necessary changes we have to make Smiling

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Thanks for the reply But

Well, I'm just not sure if it should go into core or not. Technically, t() is only supposed to be used for string literals in the code, not the translation of variables. As such, I haven't been using it in places like this... I just don't know how comfortable I am shirking Drupal best practices and encouraging others to do the same. Eye-wink

I might try contacting Gabor to see if he has a solution.

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Re: Re: Thanks for the reply But

Yeah that would be nice. We have a lot of multi-language sites being set up in the near future so we definitely need a solution to this. Of course we could just hack it like we're doing now, but I don't think that's a very good solution in the long run Smiling

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
I might try contacting Gabor

I might try contacting Gabor to see if he has a solution.

Did you get a chance to contact Gabor? I'd really like to see a solution to all this t()/db variable stuff going on.

Pulling my hear out over this i18n stuff Eye-wink

Yours sincerely,
Thomas Kulvik
Ny Media AS
www.nymedia.no

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: I might try contacting Gabor

Hmm... actually, I never got to it. Shocked

We can await a response here: http://drupal.org/node/191810

EDIT: He's replied, recommending a module or two that can translate stored variables.