Index: openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl 4 Dec 2002 09:37:03 -0000 1.8 +++ openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl 10 Oct 2003 16:03:36 -0000 1.9 @@ -8,9 +8,29 @@ version_id:integer,notnull {files:multiple,notnull} {file_action:multiple} - {message_keys:multiple ""} + {number_of_keys:integer,notnull} + {replace_p:array ""} + {message_keys:array ""} } +# Create the message key list +# The list is needed since replace_adp_tags_with_message_tags proc below takes a list of +# keys to do replacements with where an empty key means no replacement. +set message_key_list [list] +for { set counter 1 } { $counter <= $number_of_keys } { incr counter } { + if { [info exists replace_p($counter)] } { + if { [exists_and_not_null message_keys($counter)] } { + lappend message_key_list $message_keys($counter) + } else { + ad_return_complaint 1 "
  • Message key number $counter is empty. Cannot replace text with empty key
  • " + ad_script_abort + } + } else { + # Empty string indicates no replacement + lappend message_key_list "" + } +} + set next_file [lindex $files 0] set page_title "Internationalizing file $next_file" @@ -34,7 +54,7 @@ ns_log Notice "Replacing text in file $text_file with message tags" append processing_html_result "

    Text replacements for $text_file

    " - set adp_text_result_list [lang::util::replace_adp_text_with_message_tags "[acs_root_dir]/$text_file" write $message_keys] + set adp_text_result_list [lang::util::replace_adp_text_with_message_tags "[acs_root_dir]/$text_file" write $message_key_list] set text_replacement_list [lindex $adp_text_result_list 0] set text_untouched_list [lindex $adp_text_result_list 1] Index: openacs-4/packages/acs-admin/www/apm/version-i18n-process.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-i18n-process.adp,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-admin/www/apm/version-i18n-process.adp 27 Aug 2003 14:52:55 -0000 1.5 +++ openacs-4/packages/acs-admin/www/apm/version-i18n-process.adp 10 Oct 2003 16:03:36 -0000 1.6 @@ -10,17 +10,20 @@
    @hidden_form_vars;noquote@ + + - + +
    Text to ReplaceDo Replacement Message key to use
    @replacements.text;noquote@ Yes
    @@ -35,9 +38,9 @@

    Instructions

    - Choose which message keys to use for this file. If you leave a - message key blank no replacement will be done and the corresponding - text in the adp will be left untouched. The text that is actually + Choose which message replacements to do in this file. Rather than keeping the default message key, + try to come up with a descriptive one that says something about the semantics or context of the message. + The text that is actually replaced is bold and highlighted with a yellow background in the "Text to Replace" column.