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.20 -r1.64.2.21 --- openacs-4/packages/acs-lang/acs-lang.info 13 Jul 2023 13:09:52 -0000 1.64.2.20 +++ openacs-4/packages/acs-lang/acs-lang.info 16 Feb 2024 10:31:38 -0000 1.64.2.21 @@ -9,7 +9,7 @@ f t - + Peter Marklund OpenACS Internationalization Support. 2023-05-09 @@ -20,7 +20,7 @@ GPL 3 - + Index: openacs-4/packages/acs-lang/tcl/locale-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/locale-procs.tcl,v diff -u -r1.51.2.17 -r1.51.2.18 --- openacs-4/packages/acs-lang/tcl/locale-procs.tcl 10 Feb 2023 15:48:15 -0000 1.51.2.17 +++ openacs-4/packages/acs-lang/tcl/locale-procs.tcl 16 Feb 2024 10:31:38 -0000 1.51.2.18 @@ -174,19 +174,28 @@ return [db_string system_utc_offset {}] } -ad_proc -public lang::system::get_locales {} { +ad_proc -public lang::system::get_locales { + {-all:boolean} +} { - Return all enabled locales in the system. This value is cached per - thread and needs currently a server restart, when the system - locales are changed. + Return all locales defined in the system. Per default only the + enabled locales are returned. When the optional flag "-all" is + specified, all defined locales are returend. + + This value is cached per thread and needs currently a server + restart, when the system locales are changed. @author Peter Marklund } { - return [acs::per_thread_cache eval -key acs-lang.system_get_locales { - db_list select_system_locales { - select locale - from ad_locales - where enabled_p = 't' + return [acs::per_thread_cache eval -key acs-lang.system_get_locales-$all_p { + if {$all_p} { + db_list select_defined_system_locales { select locale from ad_locales } + } else { + db_list select_enabled_system_locales { + select locale + from ad_locales + where enabled_p = 't' + } } }] } Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.180.2.118 -r1.180.2.119 --- openacs-4/packages/xowiki/xowiki.info 26 Jan 2024 16:37:28 -0000 1.180.2.118 +++ openacs-4/packages/xowiki/xowiki.info 16 Feb 2024 10:31:38 -0000 1.180.2.119 @@ -10,7 +10,7 @@ t xowiki - + Gustaf Neumann A xotcl-based enterprise wiki system with multiple object types 2023-07-11 @@ -55,14 +55,14 @@ BSD-Style 2 - + - + Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.147.2.35 -r1.147.2.36 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 14 Feb 2024 12:54:31 -0000 1.147.2.35 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 16 Feb 2024 10:31:38 -0000 1.147.2.36 @@ -293,8 +293,23 @@ set nls_language [$data form_parameter \ nls_language:token \ [$data form_parameter _nls_language:token]] - if {$nls_language eq "" || [string length $nls_language] > 5} { + if {$nls_language eq ""} { set nls_language en_US + } elseif {$nls_language ni [lang::system::get_locales]} { + # + # The locale does not belong to the enabled locales. This can + # be still wanted by the application, but we should provide a + # hint in the log file about this unusual situation. + # + if {$nls_language ni [lang::system::get_locales -all]} { + set message "'$nls_language' not defined in the system, call back to 'en_US'" + set severity warning + set nls_language en_US + } else { + set severity notice + set message "'$nls_language' not enabled in the system" + } + ns_log $severity "suspect content of form variable nls_language: $message" } set name [$data build_name -nls_language $nls_language] }