Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v diff -u -r1.68.2.10 -r1.68.2.11 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 25 Aug 2020 13:38:12 -0000 1.68.2.10 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 27 Aug 2020 12:53:11 -0000 1.68.2.11 @@ -166,6 +166,10 @@ set key_exists_p [db_string message_key_exists_p {}] if { ! $key_exists_p } { + # The system will not function correctly if there are keys + # registered in other locales than en_US. If this is a new + # message key for a locale different than en_US, register the + # en_US version first. if {$locale eq "en_US"} { db_dml insert_message_key { insert into lang_message_keys @@ -174,13 +178,16 @@ (:message_key, :package_key, :object_id) } } else { - # Non-default locale - # The system will not function correctly if there are keys registered in other locales - # than en_US that are not present for en_US. This introduces the inconvenience of having to - # register the en_US messages first, but that is manageable - set error_message "lang::message::register - refusing to register message for non-en_US locale ${locale}. The message key ${package_key}.${message_key} must be registered in en_US first" - ns_log Error $error_message - error $error_message + lang::message::register \ + -update_sync=$update_sync_p \ + -upgrade_status $upgrade_status \ + -conflict=$conflict_p \ + -comment $comment \ + -object_id $object_id \ + -locale en_US \ + $package_key \ + $message_key \ + $message } } Index: openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl,v diff -u -r1.54.2.9 -r1.54.2.10 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 25 Aug 2020 13:38:12 -0000 1.54.2.9 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 27 Aug 2020 12:53:11 -0000 1.54.2.10 @@ -776,7 +776,7 @@ } ad_proc -public lang::util::convert_to_i18n { - {-locale ""} + {-locale "en_US"} {-package_key "acs-translations"} {-message_key ""} {-prefix ""} @@ -807,12 +807,7 @@ } # Register the language keys - lang::message::register \ - -object_id $object_id \ - en_US $package_key $message_key $text - if {$locale ne ""} { - lang::message::register $locale $package_key $message_key $text - } + lang::message::register $locale $package_key $message_key $text return "#${package_key}.${message_key}#" } else {