The country names in the cck dropdown are always english and cannot be translated through the 'translate inteface' functionality.

Steps to reproduce: install this module with a different language then english.

Comments

Scyther’s picture

This is a problem that I havn't solved and I do not have any good idea how to solve it.

The problem is that the Country names are in a cvs file and it is not a good idea to pass a variable in t(), as below.

  t($country_name);

But if you have and good tips or solutions I am happy to get them!

dagomar’s picture

Well, I'm not even sure who's at fault here, countries api or cck country. But to display the cck dropdown correctly I changed the function cck_country_allowed_values in cck_country.module to:

function cck_country_allowed_values() {
  $allowed_values = countries_api_get_array();
    foreach($allowed_values as $key => $value){
      $allowed_values[$key] = t($value); 
    }
  return $allowed_values;
}

this passes all allowed values through t, but it WILL screw things up if countries_api decides to take things through t as well.

Scyther’s picture

Status: Active » Closed (duplicate)

This should be a issue for Country codes API when I think about it. There is already issues there.

#1190224: Country names are not localized

dagomar’s picture

You are right Scyther, thank you!