Index: openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl,v diff -u -N -r1.54 -r1.54.2.1 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 9 May 2018 15:33:28 -0000 1.54 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 13 Mar 2019 13:37:18 -0000 1.54.2.1 @@ -389,7 +389,15 @@ # Note that this query does not use bind variables, because these cause the query to not # match any rows in Oracle when the language key is less than 3 characters, # because the column is a char(3), not a varchar2(3). - return [db_string default_locale_from_lang {} -default ""] + return [db_string default_locale_from_lang { + select locale + from ad_locales l + where language = :language + and enabled_p + and (default_p or not exists (select 1 from ad_locales + where language = :language + and locale <> l.locale)) + } -default ""] } ad_proc -public lang::util::default_locale_from_lang {