Index: openacs-4/packages/acs-lang/acs-lang.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/acs-lang.info,v diff -u -r1.64.2.10 -r1.64.2.11 --- openacs-4/packages/acs-lang/acs-lang.info 6 Jun 2020 16:27:35 -0000 1.64.2.10 +++ openacs-4/packages/acs-lang/acs-lang.info 25 Aug 2020 13:38:11 -0000 1.64.2.11 @@ -9,7 +9,7 @@ f t - + Peter Marklund OpenACS Internationalization Support. 2017-08-06 @@ -20,7 +20,7 @@ GPL 3 - + Index: openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql,v diff -u -r1.15 -r1.15.2.1 --- openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql 7 Aug 2017 23:47:56 -0000 1.15 +++ openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql 25 Aug 2020 13:38:12 -0000 1.15.2.1 @@ -26,6 +26,14 @@ on delete cascade constraint lang_message_keys_p_key_nn not null, + + -- This optional column allows to bind the message key to the + -- lifetime of an acs_object: upon object's deletion, the message + -- key will be automatically deleted from the system. + object_id integer constraint lang_message_keys_object_id_fk + references acs_objects(object_id) + on delete cascade, + description clob, constraint lang_message_keys_pk primary key (message_key, package_key) Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-5.10.0d11-5.10.0d12.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql,v diff -u -r1.18 -r1.18.2.1 --- openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql 7 Aug 2017 23:47:56 -0000 1.18 +++ openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql 25 Aug 2020 13:38:12 -0000 1.18.2.1 @@ -27,6 +27,14 @@ on delete cascade constraint lang_message_keys_package_key_nn not null, + + -- This optional column allows to bind the message key to the + -- lifetime of an acs_object: upon object's deletion, the message + -- key will be automatically deleted from the system. + object_id integer constraint lang_message_keys_object_id_fk + references acs_objects(object_id) + on delete cascade, + description text, constraint lang_message_keys_pk primary key (message_key, package_key) Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.10.0d11-5.10.0d12.sql'. Fisheye: No comparison available. Pass `N' to diff? 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.9 -r1.68.2.10 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 21 Jul 2020 14:02:09 -0000 1.68.2.9 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 25 Aug 2020 13:38:12 -0000 1.68.2.10 @@ -97,6 +97,7 @@ {-upgrade_status "no_upgrade"} {-conflict:boolean} {-comment ""} + {-object_id ""} locale package_key message_key @@ -140,6 +141,10 @@ @param conflict Set this switch if the upgrade represents a conflict between changes made in the database and in catalog files. + @param object_id Bind this message key to an acs_object, so that + upon deletion, the message key will be + removed as well. + @see lang::message::lookup @see _ } { @@ -162,7 +167,12 @@ if { ! $key_exists_p } { if {$locale eq "en_US"} { - db_dml insert_message_key {} + db_dml insert_message_key { + insert into lang_message_keys + (message_key, package_key, object_id) + values + (:message_key, :package_key, :object_id) + } } else { # Non-default locale # The system will not function correctly if there are keys registered in other locales Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.xql,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.xql 6 Dec 2018 20:06:00 -0000 1.11 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.xql 25 Aug 2020 13:38:12 -0000 1.11.2.1 @@ -10,15 +10,6 @@ - - - insert into lang_message_keys - (message_key, package_key) - values - (:message_key, :package_key) - - - insert into lang_messages ([join $col_clauses ", "]) 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.8 -r1.54.2.9 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 21 Jul 2020 14:02:09 -0000 1.54.2.8 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 25 Aug 2020 13:38:12 -0000 1.54.2.9 @@ -781,8 +781,13 @@ {-message_key ""} {-prefix ""} {-text:required} + {-object_id ""} } { Internationalising of Attributes. This is done by storing the attribute with its acs-lang key + + @param object_id bind the newly created message key to this + acs_object id. Upon object's deletion, the + message key will be deleted as well. } { # If the package acs-translations is installed do the conversion @@ -802,7 +807,9 @@ } # Register the language keys - lang::message::register en_US $package_key $message_key $text + 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 } Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.131.2.18 -r1.131.2.19 --- openacs-4/packages/acs-subsite/acs-subsite.info 6 Jun 2020 16:28:29 -0000 1.131.2.18 +++ openacs-4/packages/acs-subsite/acs-subsite.info 25 Aug 2020 13:38:12 -0000 1.131.2.19 @@ -9,7 +9,7 @@ t t - + OpenACS Subsite 2017-08-06 @@ -18,12 +18,12 @@ GPL 3 - + - + Index: openacs-4/packages/acs-subsite/tcl/group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs.tcl,v diff -u -r1.60.2.8 -r1.60.2.9 --- openacs-4/packages/acs-subsite/tcl/group-procs.tcl 3 Jul 2020 07:43:20 -0000 1.60.2.8 +++ openacs-4/packages/acs-subsite/tcl/group-procs.tcl 25 Aug 2020 13:38:12 -0000 1.60.2.9 @@ -128,7 +128,10 @@ # key, there is no need to convert this a second time. if {![regexp [lang::util::message_key_regexp] $pretty_name]} { - set pretty_name [lang::util::convert_to_i18n -message_key "group_title_${group_id}" -text "$pretty_name"] + set pretty_name [lang::util::convert_to_i18n \ + -object_id $group_id \ + -message_key "group_title_${group_id}" \ + -text $pretty_name] } # Update the title to the pretty name