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.14 -r1.51.2.15 --- openacs-4/packages/acs-lang/tcl/locale-procs.tcl 18 Aug 2022 14:58:58 -0000 1.51.2.14 +++ openacs-4/packages/acs-lang/tcl/locale-procs.tcl 8 Feb 2023 15:09:01 -0000 1.51.2.15 @@ -442,21 +442,22 @@ ad_proc -public lang::user::language { {-package_id ""} + {-user_id ""} {-site_wide:boolean} {-iso6392:boolean} } { Get user language preference for a given package instance. This preliminary implementation only has one site-wide setting, though. @param package_id The package for which you want to get the language setting. + @param user_id The user we wish to get the language for, defaults to connection user. @param site_wide Set this if you want to get the site-wide language setting. @param iso6392 Set this if you want to force iso-639-2 code (3 digits) @return 3 chars language code if iso6392 is set, left part of locale otherwise } { - - set locale [locale -package_id $package_id -site_wide=$site_wide_p] + set locale [locale -package_id $package_id -user_id $user_id -site_wide=$site_wide_p] set user_lang [lindex [split $locale "_"] 0] if { $iso6392_p } { Index: openacs-4/packages/acs-lang/tcl/locale-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/locale-procs.xql,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-lang/tcl/locale-procs.xql 16 Nov 2017 09:37:57 -0000 1.11 +++ openacs-4/packages/acs-lang/tcl/locale-procs.xql 8 Feb 2023 15:09:01 -0000 1.11.2.1 @@ -30,10 +30,16 @@ - select locale - from ad_locale_user_prefs - where user_id = :user_id - and package_id = :package_id + select coalesce( + (select locale + from ad_locale_user_prefs + where user_id = :user_id + and package_id = :package_id), + + (select default_locale + from apm_packages + where package_id = :package_id) + ) from dual