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?

Comments

ray007’s picture

Status: Active » Needs review

status set

toologic’s picture

Sorry, but on code

'cc' => t('Some Country Name'),

i have error

Parse error: parse error, unexpected '(', expecting ')' in c:\www\test2\sites\all\modules\location\location.inc on line 1494

drupal 5.1.x ( php 5.x, mysql 5.x)

ray007’s picture

Hmm, 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 ;-)

snufkin’s picture

subscribing

smitty’s picture

StatusFileSize
new54.9 KB

I 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?

brmassa’s picture

Status: Needs review » Fixed

Guys,

its fixed on HEAD. Soon on Location 3.0.

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.