Index: openacs-4/packages/acs-admin/www/apm/version-extract-message-keys.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/Attic/version-extract-message-keys.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-admin/www/apm/version-extract-message-keys.adp 7 Oct 2002 15:17:23 -0000 1.1 @@ -0,0 +1,33 @@ + +@page_title@ +@context_bar@ + +

+Please choose adp templates to extract message keys from. +

+ +

+ +

+ +

+Note: Submitting this form will alter any adp files you selected that contain message key tags. However those adp files will first be backed up to files with the the ending .orig if such files do not already exist. You may want to remove those files once you have reassured yourself that the message key extraction worked properly. The keys to be extracted should be embedded in the templates with the following syntax: +

+ +

+

+<#package_key.message_key Text in en_US locale#>. +
+

+ +

+Entries for the extracted messages will be added to the en_US catalog file only if they do not already exist in that file. +If the messages don't contain the package key prefix this prefix will be added before insertion into the message catalog. +

+ +

+The message tags are processed from the adp:s in the order that they appear. If the key of a message tag is already in the catalog +file then the message texts will be compared. If the message texts in the tag and in the catalog file are identical then no +insertion is done to the catalog file. If they differ it is assumed that the new message should be inserted into the +catalog file but with a different key. In this case a warning is issued in the log file and an integer is appended to the message key to make it unique before insertion into the catalog file is done. +

\ No newline at end of file Index: openacs-4/packages/acs-admin/www/apm/version-extract-message-keys.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/Attic/version-extract-message-keys.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-admin/www/apm/version-extract-message-keys.tcl 7 Oct 2002 15:17:23 -0000 1.1 @@ -0,0 +1,57 @@ +ad_page_contract { + Do message key extraction for a certain APM package version. + First let the user choose which adps to extract message keys from + and then do the actual extraction. Redirects back to viewing the + package version. + + @author Peter Marklund (peter@collaboraid.biz) + @creation-date 1 October 2002 + @cvs-id $Id: version-extract-message-keys.tcl,v 1.1 2002/10/07 15:17:23 lars Exp $ +} { + version_id:integer,notnull + +} + +set page_title "Select adp Files to Extract Message Keys From" +set context_bar [ad_context_bar $page_title] + +# Create a list of adp files +set adp_file_option_list [list] +set adp_preselect_list [list] +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 relative_path [ad_make_relative_path $file] + + if { [regexp {\.adp$} $file match] } { + # Checkbox label in first element and value in second + lappend adp_file_option_list [list $relative_path $relative_path] + lappend adp_preselect_list $relative_path + } +} + +form create adp_list_form + +element create adp_list_form version_id \ + -datatype integer \ + -widget hidden \ + -value $version_id + +element create adp_list_form adp_files \ + -datatype text \ + -widget checkbox \ + -label "ADP Templates" \ + -options $adp_file_option_list \ + -values $adp_preselect_list + +if { [form is_valid adp_list_form] } { + # The form was submitted, process the adps + + set adp_files [element get_values adp_list_form adp_files] + + lang::util::extract_keys_from_adps $adp_files + + ad_returnredirect "version-view?version_id=$version_id" + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/acs-admin/www/apm/version-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-view.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-admin/www/apm/version-view.tcl 10 Sep 2002 22:21:59 -0000 1.4 +++ openacs-4/packages/acs-admin/www/apm/version-view.tcl 7 Oct 2002 15:17:23 -0000 1.5 @@ -218,7 +218,7 @@
  • Manage file information
  • Manage parameter information
  • Display an XML package specification file for this version - +
  • Extract message catalog Keys (used for multilinguality) from adp pages and generate message catalog files. Lets you choose which adp files to extract from. " if { ![info exists installed_version_id] || $installed_version_id == $version_id && \