When having an input mask on a german site, I'd like to present a select-box with german country names instead of the english ones.
I can see 2 ways to achieve this:
1: declare all entries in _location_get_iso3166_list() with
'cc' => t('Country Name'),
so the locale-interface can be used to translate the country names.
2: provide the possibility to overwrite the predefined titles in the country list.
Not sure what's the preferred way to go here, to get a fast solution and because I could start with a smaller patch, I've created a little patch for the latter option - see attached file.
Comments?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | translatecountries.patch | 54.9 KB | smitty |
| location-translate-countrynames-1.patch | 1.1 KB | ray007 |
Comments
Comment #1
ray007 commentedstatus set
Comment #2
toologic commentedSorry, but on code
i have error
drupal 5.1.x ( php 5.x, mysql 5.x)
Comment #3
ray007 commentedHmm, that's probably because this function is called the first time before the locales are initialized.
Before I invest work in this topic I'd like to have a discussion which way is the right one to go and then tackle the problems on the way ... but good to know I'm not the only one interested in this feature ;-)
Comment #4
snufkin commentedsubscribing
Comment #5
smitty commentedI would prefer to this via the locale-interface, because this can be done with one change and you do not need a separate function for each language. Here is a patch which adds the function t() to the country-list and returns a sorted list.
What do you think about this?
Comment #6
brmassa commentedGuys,
its fixed on HEAD. Soon on Location 3.0.
regards,
massa
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.