[support] trying to use php to create multi-lingual CCK select lists

Neil: esl-lounge.com neil at esl-lounge.com
Fri Jul 27 17:05:24 UTC 2007


I want a drop down "Hobbies" list in my node profile that I'm using CCK to create.

Unfortunately, I discovered that "Manage Strings" in Localization can't help me to translate that select list, so now I'm looking at using PHP in the Allowed Values section.

So far I have this:

global $user;
$HobbiesEnglish = array (1 => One, 2 => Two, 3 => Three, 4 => Four);
$HobbiesItaliano = array (1 => Uno, 2 => Due, 3 => Tre, 4 => Quattro);
if ($Language->language == "it")
{
return $HobbiesItaliano;
}
else
{
return $HobbiesEnglish;
}

Just trying to get the English and Italian numbers showing up before going the whole hog! The language conditional statement is working fine on another part of the site, but I can only get the English numbers appearing for now. 

thanks in advance

Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070727/7e8fcf3c/attachment.htm 


More information about the support mailing list