Index: openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl,v diff -u -N -r1.46 -r1.47 --- openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 18 Nov 2007 21:27:10 -0000 1.46 +++ openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 18 Apr 2008 06:48:42 -0000 1.47 @@ -534,7 +534,6 @@ } ad_proc -private lang::catalog::import_from_file { - {-keeplocal_p ""} file_path } {

@@ -551,8 +550,6 @@ with what's in the database).

- @param keeplocal Overwrites the package parameter to keep local changes regardless what happened in the - catalog file. @param file_path The absolute path of the XML file to import messages from. The path must be on valid format, see apm_is_catalog_file @@ -598,8 +595,7 @@ array set message_count [lang::catalog::import_messages \ -file_messages_list [array get messages_array] \ -package_key $package_key \ - -locale $locale \ - -keeplocal_p $keeplocal_p] + -locale $locale] # Register descriptions foreach message_key $messages_array_names { @@ -623,7 +619,6 @@ {-file_messages_list:required} {-package_key:required} {-locale:required} - {-keeplocal_p ""} } {

Import a given set of messages from a catalog file to the database @@ -700,22 +695,11 @@ 14. All different. upgrade_action=update, conflict_p=t -

- Introduction of a package parameter 'KeepLocalTranslations'. - If this parameter is set then we change the behaviour of the - following cases to upgrade_action=none: 4, 6, 7, 8, 12, 14. - A conflict is raised in this case. - - The parameter -keeplocal_p overwrites this package paramter if set. -

- @param file_messages_list An array list with message keys as keys and the message of those keys as values, i.e. (key, value, key, value, ...) @param package_key The package_key for the messages. - - @param keeplocal_p Overwrites the package parameter if set @param locale The locale of the messages. @@ -726,18 +710,6 @@ @author Peter Marklund @author Lars Pind } { - - # package parameter or argument -keeplocal_p - if {![string length $keeplocal_p]} { - set keeplocal_p [parameter::get_from_package_key -package_key "acs-lang" -parameter KeepLocalTranslations -default 1] - } - - if { [string is true $keeplocal_p] } { - ns_log Notice "Keep Local Changes while updating catalog for $package_key/$locale (keeplocal_p=$keeplocal_p)" - } else { - ns_log Notice "Overwrite Changes while updating catalog for $package_key/$locale (keeplocal_p=$keeplocal_p)" - } - set message_count(processed) 0 set message_count(added) 0 set message_count(updated) 0 @@ -845,24 +817,14 @@ update { # case 12 set import_case 12 - - if {! $keeplocal_p} { - # update db with file message - set upgrade_status "updated" - } else { - set conflict_p "t" - } + # update db with file message + set upgrade_status "updated" } delete { # case 7 set import_case 7 - - if {! $keeplocal_p} { - # mark message in db deleted - set upgrade_status "deleted" - } else { - set conflict_p "t" - } + # mark message in db deleted + set upgrade_status "deleted" } } } @@ -873,10 +835,8 @@ if { $db_messages($message_key) ne $file_messages($message_key) } { # case 8 set import_case 8 - if {! $keeplocal_p} { - # differing additions in db and file - set upgrade_status "updated" - } + # differing additions in db and file + set upgrade_status "updated" set conflict_p "t" } } @@ -889,22 +849,16 @@ if { $db_messages($message_key) ne $file_messages($message_key) } { # case 14 set import_case 14 - - if {! $keeplocal_p} { - # differing updates in file and db - set upgrade_status "updated" - } + # differing updates in file and db + set upgrade_status "updated" set conflict_p "t" } } delete { # case 6 set import_case 6 - - if {! $keeplocal_p} { - # deletion in file but update in db - set upgrade_status "deleted" - } + # deletion in file but update in db + set upgrade_status "deleted" set conflict_p "t" } } @@ -915,11 +869,8 @@ update { # case 4 set import_case 4 - - if {! $keeplocal_p} { - # deletion in db but update in file - set upgrade_status "added" ;# resurrect - } + # deletion in db but update in file + set upgrade_status "added" ;# resurrect set conflict_p "t" } delete { @@ -1010,7 +961,6 @@ ad_proc -public lang::catalog::import { {-package_key {}} {-locales {}} - {-keeplocal_p ""} {-initialize:boolean} {-cache:boolean} } { @@ -1021,7 +971,6 @@ @param package_key Restrict the import to the package with this key @param locales A list of locales to restrict the import to - @param keeplocal_p Overwrites the package parameter if set @param initialize Only load messages from packages that have never before had any message imported @param cache Provide this switch if you want the proc to cache all the imported messages @@ -1049,13 +998,6 @@ set uninitialized_packages [uninitialized_packages] } - # package parameter or argument -keeplocal_p - if {$keeplocal_p eq ""} { - set keeplocal_p [parameter::get_from_package_key -package_key "acs-lang" -parameter KeepLocalTranslations -default 1] - } - - ns_log Notice "KEEPLOCAL:: $keeplocal_p" - foreach package_key $package_key_list { if {$initialize_p && [lsearch -exact $uninitialized_packages $package_key] == -1} { # The package is already initialized @@ -1080,7 +1022,7 @@ foreach file_path $catalog_files { # Use a catch so that parse failure of one file doesn't cause the import of all files to fail array unset loop_message_count - if { [catch { array set loop_message_count [lang::catalog::import_from_file -keeplocal_p $keeplocal_p $file_path] } errMsg] } { + if { [catch { array set loop_message_count [lang::catalog::import_from_file $file_path] } errMsg] } { global errorInfo ns_log Error "The import of file $file_path failed, error message is:\n\n${errMsg}\n\nstack trace:\n\n$errorInfo\n\n"