Index: openacs-4/packages/acs-admin/www/apm/version-i18n-index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-i18n-index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-admin/www/apm/version-i18n-index.adp 29 Oct 2002 08:14:24 -0000 1.2 +++ openacs-4/packages/acs-admin/www/apm/version-i18n-index.adp 10 Nov 2002 20:09:53 -0000 1.3 @@ -26,8 +26,8 @@ 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 -r1.5 -r1.6 --- openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl 1 Nov 2002 21:16:04 -0000 1.5 +++ openacs-4/packages/acs-admin/www/apm/version-i18n-process-2.tcl 10 Nov 2002 20:09:53 -0000 1.6 @@ -13,7 +13,7 @@ set next_file [lindex $files 0] -set page_title "Internationalizing ADP File $next_file" +set page_title "Internationalizing file $next_file" set context_bar [ad_context_bar $page_title] # Figure out which actions to take on the selected adp:s @@ -28,7 +28,7 @@ # Do text replacement if { $replace_text_p } { - # Process the next adp file in the list + # Process the next file in the list set text_file $next_file set number_of_processed_files 1 @@ -54,13 +54,14 @@ } # Do tag replacement +set total_number_of_replacements "0" if { $replace_tags_p } { if { $replace_text_p } { # We are also replacing text, so only process one adp file set tags_files $next_file set number_of_processed_files 1 } else { - # We are only doing tag replacement, so process all adp files + # We are only doing tag replacement, so process all files set tags_files $files set number_of_processed_files [llength $files] } @@ -70,6 +71,7 @@ append processing_html_result "

Message tag replacements for $file

" set number_of_replacements [lang::util::replace_temporary_tags_with_lookups $file] + set total_number_of_replacements [expr $total_number_of_replacements + $number_of_replacements] append processing_html_result "Did $number_of_replacements replacements, any further details are in the log file" } @@ -94,10 +96,9 @@ # If we are done with message tag replacement, that means we have added new messages # so reload the cache - if { $replace_tags_p } { + if { $replace_tags_p && $total_number_of_replacements > 0 } { lang::message::cache } } ad_return_template - Index: openacs-4/packages/acs-admin/www/apm/version-i18n.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-i18n.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-admin/www/apm/version-i18n.tcl 29 Oct 2002 08:14:24 -0000 1.4 +++ openacs-4/packages/acs-admin/www/apm/version-i18n.tcl 10 Nov 2002 20:09:53 -0000 1.5 @@ -22,7 +22,7 @@ set package_key [apm_package_key_from_version_id $version_id] foreach file [lsort [ad_find_all_files [acs_package_root_dir $package_key]]] { - set file_regexp [ad_decode $file_type adp {\.adp$} {\.tcl$}] + set file_regexp ".${file_type}\$" if { [regexp $file_regexp $file match] } { set relative_path [ad_make_relative_path $file] @@ -35,19 +35,23 @@ set number_of_message_tags [llength [lang::util::get_temporary_tags_indices $file_contents]] - if { [string equal $file_type adp] } { - # We are dealing with adp files - set number_of_message_keys [llength [lang::util::get_hash_indices $file_contents]] - set adp_text_result_list [lang::util::replace_adp_text_with_message_tags $file report] - set number_of_text_snippets [llength [lindex $adp_text_result_list 0]] + switch -- $file_type { + adp { + set number_of_message_keys [llength [lang::util::get_hash_indices $file_contents]] + set adp_text_result_list [lang::util::replace_adp_text_with_message_tags $file report] + set number_of_text_snippets [llength [lindex $adp_text_result_list 0]] - set status_string "$number_of_text_snippets texts, $number_of_message_tags tags, $number_of_message_keys keys" - } else { - # We are dealing with tcl files - - set status_string "$number_of_message_tags tags" + set status_string "$number_of_text_snippets texts, $number_of_message_tags tags, $number_of_message_keys keys" + } + tcl { + set status_string "$number_of_message_tags tags" + } + sql { + set number_of_message_keys [llength [lang::util::get_hash_indices $file_contents]] + set status_string "$number_of_message_tags tags, $number_of_message_keys keys" + } } - + close $file_id } else { @@ -88,7 +92,7 @@ -values {replace_text} \ -section action_section } else { - # TCL files + # TCL files or SQL files element create file_list_form tcl_action_inform \ -datatype text \ -widget inform \ @@ -114,10 +118,16 @@ set status_filter "Show I18N status of files" } -if { [string equal $file_type adp] } { - set file_type_filter "Show adp files | Show tcl files" -} else { - set file_type_filter "Show adp files | Show tcl files" +switch -- $file_type { + adp { + set file_type_filter "Show adp files | Show tcl files | Show sql files" + } + tcl { + set file_type_filter "Show adp files | Show tcl files | Show sql files" + } + sql { + set file_type_filter "Show adp files | Show tcl files | Show sql files" + } } ad_return_template