/etc/dotlrn/install/tcl/acs-lang-procs.tcl is in dotlrn 2.5.0+dfsg-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # Procs to support testing OpenACS with Tclwebtest.
#
# Procs for testing the acs-lang (I18N) package
#
# @author Peter Marklund
namespace eval ::twt::acs_lang {}
ad_proc ::twt::acs_lang::load_i18n_messages {
{-locales ""}
} {
Enables all locales, or a given list of locales, and
loads all message catalogs for those locales.
} {
if { $locales eq "" } {
set locales [::twt::oacs::eval {db_list all_locales {select locale from ad_locales}}]
}
# First enable all locales
::twt::oacs::eval "
foreach locale {$locales} {
lang::system::locale_set_enabled -locale \$locale -enabled_p t
}
"
# Load all catalog files for enabled locales
::twt::oacs::eval lang::catalog::import
}
ad_proc ::twt::acs_lang::set_locale { locale } {
Change locale of logged in user to locale.
} {
::twt::log "Changing to locale $locale"
::twt::do_request /acs-lang
form find locale
::twt::multiple_select_value site_wide_locale $locale
form submit
}
ad_proc ::twt::acs_lang::check_no_keys { } {
Check in the current request body for occurences of #package_key.message_key#
which might be message keys that a developer forgot to let go through a lang::util::localize
call to be converted into text.
} {
if { [regexp {#[a-zA-Z0-9_.-]+\.[a-zA-Z0-9_.-]+#} [response body] message_key] } {
::twt::log_alert "Found \"$message_key\" on page [response url] and might be a message key that needs a lang::util::localize call"
}
}
|