Index: openacs-4/packages/ams/www/attribute-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/www/attribute-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ams/www/attribute-add.tcl 18 May 2005 17:11:48 -0000 1.2 +++ openacs-4/packages/ams/www/attribute-add.tcl 25 May 2005 10:47:53 -0000 1.3 @@ -104,7 +104,28 @@ } + # Internationalising of Attributes. This is done by storing the attribute with it's acs-lang key + set message_key "${object_type}_${attribute_name}" + + # Register the language keys + lang::message::register en_US ams $message_key $pretty_name + lang::message::register en_US ams "${message_key}_plural" $pretty_plural + # Register the language key in the current user locale as well + # Usually you would only register the key in the locale that the user is using + # But we can't do this as the system depends on english language keys first. + # If Timo manages to get the service contract with babblefish or dict.leo.org working + # We might have an automatic translation first :). + set user_locale [lang::user::locale] + if {$user_locale != "en_US"} { + lang::message::register $user_locale ams $message_key $pretty_name + lang::message::register $user_locale ams "${message_key}_plural" $pretty_plural + } + + # Replace the pretty_name and pretty_plural with the message key, so it is inserted correctly in the database + set pretty_name "#ams.${message_key}#" + set pretty_plural "#ams.${message_key}_plural#" + if { [exists_and_not_null widget] } { ::template::element::set_properties attribute_form widget -widget select -mode display }