Translation for countries in checkout (select-box)

Project:Ubercart Contributions
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:patch (needs review)
Description
Project: 
Ubercart

Please change in

uc_store.module
line 2313 (RC4)
- $options[$country['country_id']] = $country[$order_by];
+ $options[$country['country_id']] = t($country[$order_by]);

so that the country name can be translated.

--
thanks for all your good work! I'm so happy with ubercart.
i'm going to release two big german shops the next month. One with a highly customized ubercart, one with the actual RC4 (1.0?) version. and i'm so happy that I'm not forced to work with typo3 anymore Smiling

Version: 
rc
qrios's picture
Offline
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 554
Re: Translation for countries in checkout (select-box)

+1 for this patch!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
The problem here is that t()
Assigned to:qrios» Ryan

The problem here is that t() is only supposed to be used for string literals in modules. In other words, I can use it on 'Country name' but not on $country_name. There are workarounds for this involving modules like i18n, but I believe they have to be variables in the actual variables table. Puzzled

qrios's picture
Offline
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 554
Re: The problem here is that t()
Assigned to:Ryan» qrios

I re-walked into this wall Smiling.
I agree that t() should not be used for dynamic values, which potentially could polute de locale tables.
But, in this case there is perfect control of what is in the $country_name variable, and I strongly suggest to parse country names by t().
The only way to make the countries language specific now without hacking core is to hack the database, which is bad practice in my opinion.

What makes it a bit obscure is that countries are all EN in the .cif files, and that a for a lot of countries the zones are provided only in the language for that country.

I think this could/should be straighten up a bit, providing all country/zone data in EN if possible, making them translatable to other languages.

Thanks,

Kees

Summit_drupal's picture
Offline
Joined: 12/11/2010
Juice: 137
#4
Assigned to:qrios» Guest

Hi,
What is the status of this patch please?
I added the patch to have a solution to translate the countries to my own language (dutch).
Thanks for it, it worked!

greetings,
Martijn