locale-procs.tcl

Localization procedures for OpenACS

This is free software distributed under the terms of the GNU Public License. Full text of the license is available from the GNU Project: http://www.fsf.org/copyleft/gpl.html

Location:
packages/acs-lang/tcl/locale-procs.tcl
Created:
28 September 2000
Authors:
Henry Minsky <hqm@mit.edu>
Lars Pind <lars@pinds.com>
CVS Identification:
$Id: locale-procs.tcl,v 1.53 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

lang::conn::browser_locale (private)

 lang::conn::browser_locale

Get the users preferred locale from the accept-language HTTP header.

Returns:
A locale or an empty string if no locale can be found that is supported by the system
Authors:
Lars Pind
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 test_locale__test_lang_conn_browser_locale locale__test_lang_conn_browser_locale (test acs-lang) lang::conn::browser_locale lang::conn::browser_locale test_locale__test_lang_conn_browser_locale->lang::conn::browser_locale lang::conn::get_accept_language_header lang::conn::get_accept_language_header (private) lang::conn::browser_locale->lang::conn::get_accept_language_header lang::system::get_locales lang::system::get_locales (public) lang::conn::browser_locale->lang::system::get_locales lang::util::default_locale_from_lang lang::util::default_locale_from_lang (public) lang::conn::browser_locale->lang::util::default_locale_from_lang lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::conn::browser_locale lang::test::assert_browser_locale lang::test::assert_browser_locale (private) lang::test::assert_browser_locale->lang::conn::browser_locale

Testcases:
locale__test_lang_conn_browser_locale

lang::conn::charset (public)

 lang::conn::charset

Returns the MIME charset name corresponding to the current connection's locale.

Returns:
IANA MIME character set name
Author:
Lars Pind <lars@pinds.com>

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::conn::charset lang::conn::charset test_test_get_locales->lang::conn::charset lang::conn::locale lang::conn::locale (public) lang::conn::charset->lang::conn::locale lang::util::charset_for_locale lang::util::charset_for_locale (public) lang::conn::charset->lang::util::charset_for_locale

Testcases:
test_get_locales

lang::conn::get_accept_language_header (private)

 lang::conn::get_accept_language_header

Obtain a list of locals from the request headers.

Returns:
a list of locales in the syntax used by OpenACS (ISO codes)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::conn::browser_locale lang::conn::browser_locale (private) lang::conn::get_accept_language_header lang::conn::get_accept_language_header lang::conn::browser_locale->lang::conn::get_accept_language_header lang::conn::valid_locale_p lang::conn::valid_locale_p (private) lang::conn::get_accept_language_header->lang::conn::valid_locale_p lang::system::locale lang::system::locale (public) lang::conn::get_accept_language_header->lang::system::locale

Testcases:
No testcase defined.

lang::conn::language (public)

 lang::conn::language [ -package_id package_id ] [ -user_id user_id ] \
    [ -site_wide ] [ -iso6392 ] [ -locale locale ]

Get the language for this request, perhaps for a given package instance.

Switches:
-package_id (optional)
The package for which you want to get the language (used only when, no locale is provided).
-user_id (optional)
The user_id for whom you want to get the language (used only when, no locale is provided).
-site_wide (optional, boolean)
Set this if you want to get the site-wide language (used only when, no locale is provided).
-iso6392 (optional, boolean)
Set this if you want to force the iso-639-2 code
-locale (optional)
obtain language from provided locale
Returns:
3 chars language code if iso6392 is set, left part of locale otherwise

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::conn::language lang::conn::language test_test_get_locales->lang::conn::language lang::conn::locale lang::conn::locale (public) lang::conn::language->lang::conn::locale lang::util::iso6392_from_language lang::util::iso6392_from_language (public) lang::conn::language->lang::util::iso6392_from_language richtext::ckeditor4::initialize_widget richtext::ckeditor4::initialize_widget (public) richtext::ckeditor4::initialize_widget->lang::conn::language richtext::ckeditor5::initialize_widget richtext::ckeditor5::initialize_widget (public) richtext::ckeditor5::initialize_widget->lang::conn::language richtext::xinha::initialize_widget richtext::xinha::initialize_widget (public) richtext::xinha::initialize_widget->lang::conn::language rp_filter rp_filter (private) rp_filter->lang::conn::language

Testcases:
test_get_locales

lang::conn::locale (public)

 lang::conn::locale [ -package_id package_id ] [ -site_wide ] \
    [ -user_id user_id ]

Get the locale for this request, perhaps for a given package instance.

Switches:
-package_id (optional)
The package for which you want to get the locale.
-site_wide (optional, boolean)
Set this if you want to get the site-wide locale.
-user_id (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::conn::locale lang::conn::locale test_test_get_locales->lang::conn::locale lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale->lang::conn::locale_not_cached lang::conn::charset lang::conn::charset (public) lang::conn::charset->lang::conn::locale lang::conn::language lang::conn::language (public) lang::conn::language->lang::conn::locale rp_filter rp_filter (private) rp_filter->lang::conn::locale xo::ConnectionContext proc require xo::ConnectionContext proc require xo::ConnectionContext proc require->lang::conn::locale xowiki::locales xowiki::locales (private) xowiki::locales->lang::conn::locale

Testcases:
test_get_locales

lang::conn::locale_not_cached (private)

 lang::conn::locale_not_cached [ -package_id package_id ] \
    [ -site_wide ] [ -user_id user_id ]

Get the locale for this request, perhaps for a given package instance. This is the not-cached version.

Switches:
-package_id (optional)
The package for which you want to get the locale.
-site_wide (optional, boolean)
Set this if you want to get the site-wide locale.
-user_id (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::conn::locale lang::conn::locale (public) lang::conn::locale_not_cached lang::conn::locale_not_cached lang::conn::locale->lang::conn::locale_not_cached ad_conn ad_conn (public) lang::conn::locale_not_cached->ad_conn lang::conn::browser_locale lang::conn::browser_locale (private) lang::conn::locale_not_cached->lang::conn::browser_locale lang::system::get_locales lang::system::get_locales (public) lang::conn::locale_not_cached->lang::system::get_locales lang::system::package_level_locale lang::system::package_level_locale (public) lang::conn::locale_not_cached->lang::system::package_level_locale lang::system::site_wide_locale lang::system::site_wide_locale (public) lang::conn::locale_not_cached->lang::system::site_wide_locale

Testcases:
No testcase defined.

lang::conn::timezone (public)

 lang::conn::timezone

Get this connection's timezone. This is the user timezone, if set, otherwise the system timezone.

Returns:
a timezone name from acs-reference package (e.g., Asia/Tokyo, America/New_York)

Partial Call Graph (max 5 caller/called nodes):
%3 test_a_foreign_calendar_user a_foreign_calendar_user (test calendar) lang::conn::timezone lang::conn::timezone test_a_foreign_calendar_user->lang::conn::timezone test_lang_test__lc_procs lang_test__lc_procs (test acs-lang) test_lang_test__lc_procs->lang::conn::timezone test_lc_time_fmt_Z_timezone lc_time_fmt_Z_timezone (test acs-lang) test_lc_time_fmt_Z_timezone->lang::conn::timezone test_set_get_timezone set_get_timezone (test acs-lang) test_set_get_timezone->lang::conn::timezone test_set_timezone_not_logged_in set_timezone_not_logged_in (test acs-lang) test_set_timezone_not_logged_in->lang::conn::timezone ad_conn ad_conn (public) lang::conn::timezone->ad_conn lang::system::timezone lang::system::timezone (public) lang::conn::timezone->lang::system::timezone lang::user::timezone lang::user::timezone (public) lang::conn::timezone->lang::user::timezone lc_time_conn_to_system lc_time_conn_to_system (public) lc_time_conn_to_system->lang::conn::timezone lc_time_local_to_utc lc_time_local_to_utc (public) lc_time_local_to_utc->lang::conn::timezone lc_time_system_to_conn lc_time_system_to_conn (public) lc_time_system_to_conn->lang::conn::timezone lc_time_utc_to_local lc_time_utc_to_local (public) lc_time_utc_to_local->lang::conn::timezone packages/acs-lang/tcl/localization-data-init.tcl packages/acs-lang/ tcl/localization-data-init.tcl packages/acs-lang/tcl/localization-data-init.tcl->lang::conn::timezone

Testcases:
lang_test__lc_procs, set_get_timezone, set_timezone_not_logged_in, lc_time_fmt_Z_timezone, a_foreign_calendar_user

lang::conn::valid_locale_p (private)

 lang::conn::valid_locale_p locale

Check, of the provided locale is syntactically correct

Parameters:
locale (required)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::conn::get_accept_language_header lang::conn::get_accept_language_header (private) lang::conn::valid_locale_p lang::conn::valid_locale_p lang::conn::get_accept_language_header->lang::conn::valid_locale_p

Testcases:
No testcase defined.

lang::system::get_locale_options (public)

 lang::system::get_locale_options

Return all enabled locales in the system in a format suitable for the options argument of a form.

Author:
Lars Pind

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::system::get_locale_options lang::system::get_locale_options test_test_get_locales->lang::system::get_locale_options lang::system::get_locale_options_not_cached lang::system::get_locale_options_not_cached (private) lang::system::get_locale_options->lang::system::get_locale_options_not_cached util_memoize util_memoize (public) lang::system::get_locale_options->util_memoize packages/acs-lang/www/admin/message-list.tcl packages/acs-lang/ www/admin/message-list.tcl packages/acs-lang/www/admin/message-list.tcl->lang::system::get_locale_options packages/categories/lib/tree-form.tcl packages/categories/ lib/tree-form.tcl packages/categories/lib/tree-form.tcl->lang::system::get_locale_options packages/categories/www/cadmin/category-form.tcl packages/categories/ www/cadmin/category-form.tcl packages/categories/www/cadmin/category-form.tcl->lang::system::get_locale_options packages/categories/www/cadmin/master.tcl packages/categories/ www/cadmin/master.tcl packages/categories/www/cadmin/master.tcl->lang::system::get_locale_options packages/categories/www/cadmin/synonym-form.tcl packages/categories/ www/cadmin/synonym-form.tcl packages/categories/www/cadmin/synonym-form.tcl->lang::system::get_locale_options

Testcases:
test_get_locales

lang::system::get_locale_options_not_cached (private)

 lang::system::get_locale_options_not_cached

Return all enabled locales in the system in a format suitable for the options argument of a form.

Author:
Lars Pind

Partial Call Graph (max 5 caller/called nodes):
%3 lang::system::get_locale_options lang::system::get_locale_options (public) lang::system::get_locale_options_not_cached lang::system::get_locale_options_not_cached lang::system::get_locale_options->lang::system::get_locale_options_not_cached db_list_of_lists db_list_of_lists (public) lang::system::get_locale_options_not_cached->db_list_of_lists

Testcases:
No testcase defined.

lang::system::get_locales (public)

 lang::system::get_locales [ -all ]

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 returned. This value is cached per thread and needs currently a server restart, when the system locales are changed.

Switches:
-all (optional, boolean)
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::system::get_locales lang::system::get_locales test_test_get_locales->lang::system::get_locales test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->lang::system::get_locales db_list db_list (public) lang::system::get_locales->db_list lang::conn::browser_locale lang::conn::browser_locale (private) lang::conn::browser_locale->lang::system::get_locales lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::system::get_locales lang::system::site_wide_locale lang::system::site_wide_locale (public) lang::system::site_wide_locale->lang::system::get_locales lang::user::site_wide_locale_not_cached lang::user::site_wide_locale_not_cached (private) lang::user::site_wide_locale_not_cached->lang::system::get_locales packages/acs-admin/www/posture-overview.tcl packages/acs-admin/ www/posture-overview.tcl packages/acs-admin/www/posture-overview.tcl->lang::system::get_locales

Testcases:
test_get_locales, xowiki_test_cases

lang::system::language (public)

 lang::system::language [ -package_id package_id ] [ -site_wide ] \
    [ -iso6392 ]

Get system language setting for a given package instance.

Switches:
-package_id (optional)
The package for which you want to get the language setting.
-site_wide (optional, boolean)
Set this if you want to get the site-wide language setting.
-iso6392 (optional, boolean)
Set this if you want to force iso-639-2 code (3 digits)
Returns:
3 chars language code if iso6392 is set, left part of locale otherwise

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::system::language lang::system::language test_test_get_locales->lang::system::language lang::system::locale lang::system::locale (public) lang::system::language->lang::system::locale lang::util::iso6392_from_language lang::util::iso6392_from_language (public) lang::system::language->lang::util::iso6392_from_language

Testcases:
test_get_locales

lang::system::locale (public)

 lang::system::locale [ -package_id package_id ] [ -site_wide ]

Get system locale setting for a given package instance.

Switches:
-package_id (optional)
The package for which you want to get the locale setting.
-site_wide (optional, boolean)
Set this if you want to get the site-wide locale setting.

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_composite_test_item create_composite_test_item (test xowf) lang::system::locale lang::system::locale test_create_composite_test_item->lang::system::locale test_create_folder_with_page create_folder_with_page (test xowf) test_create_folder_with_page->lang::system::locale test_create_form_with_form_instance create_form_with_form_instance (test xowiki) test_create_form_with_form_instance->lang::system::locale test_create_form_with_numeric create_form_with_numeric (test xowiki) test_create_form_with_numeric->lang::system::locale test_create_test_items create_test_items (test xowf) test_create_test_items->lang::system::locale ad_conn ad_conn (public) lang::system::locale->ad_conn lang::system::package_level_locale lang::system::package_level_locale (public) lang::system::locale->lang::system::package_level_locale lang::system::site_wide_locale lang::system::site_wide_locale (public) lang::system::locale->lang::system::site_wide_locale acs_user::promote_person_to_user acs_user::promote_person_to_user (public) acs_user::promote_person_to_user->lang::system::locale category::get_name category::get_name (public) category::get_name->lang::system::locale lang::conn::get_accept_language_header lang::conn::get_accept_language_header (private) lang::conn::get_accept_language_header->lang::system::locale lang::message::lookup lang::message::lookup (public) lang::message::lookup->lang::system::locale lang::system::language lang::system::language (public) lang::system::language->lang::system::locale

Testcases:
dt_localized_procs, locale__test_system_package_setting, test_get_locales, create_test_items, create_composite_test_item, create_folder_with_page, create_workflow_with_instance, link_tests, path_resolve, create_form_with_form_instance, create_form_with_numeric, form_validate

lang::system::locale_set_enabled (public)

 lang::system::locale_set_enabled -locale locale -enabled_p enabled_p

Enables or disables a locale.

Switches:
-locale (required)
-enabled_p (required)
Should be t or f
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 test_lang_test__lc_procs lang_test__lc_procs (test acs-lang) lang::system::locale_set_enabled lang::system::locale_set_enabled test_lang_test__lc_procs->lang::system::locale_set_enabled test_locale__test_lang_conn_browser_locale locale__test_lang_conn_browser_locale (test acs-lang) test_locale__test_lang_conn_browser_locale->lang::system::locale_set_enabled test_locale_language_fallback locale_language_fallback (test acs-lang) test_locale_language_fallback->lang::system::locale_set_enabled test_upgrade upgrade (test acs-lang) test_upgrade->lang::system::locale_set_enabled db_dml db_dml (public) lang::system::locale_set_enabled->db_dml util_memoize_flush_regexp util_memoize_flush_regexp (public) lang::system::locale_set_enabled->util_memoize_flush_regexp install::xml::action::disable-locale install::xml::action::disable-locale (private) install::xml::action::disable-locale->lang::system::locale_set_enabled install::xml::action::enable-locale install::xml::action::enable-locale (private) install::xml::action::enable-locale->lang::system::locale_set_enabled packages/acs-lang/www/admin/locale-set-enabled-p.tcl packages/acs-lang/ www/admin/locale-set-enabled-p.tcl packages/acs-lang/www/admin/locale-set-enabled-p.tcl->lang::system::locale_set_enabled

Testcases:
lang_test__lc_procs, locale__test_lang_conn_browser_locale, locale_language_fallback, upgrade

lang::system::package_level_locale (public)

 lang::system::package_level_locale package_id
Parameters:
package_id (required)
Returns:
empty string if not use_package_level_locales_p, or the package locale from apm_packages table.

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::system::package_level_locale lang::system::package_level_locale test_test_get_locales->lang::system::package_level_locale lang::system::package_level_locale_not_cached lang::system::package_level_locale_not_cached (private) lang::system::package_level_locale->lang::system::package_level_locale_not_cached lang::system::use_package_level_locales_p lang::system::use_package_level_locales_p (public) lang::system::package_level_locale->lang::system::use_package_level_locales_p util_memoize util_memoize (public) lang::system::package_level_locale->util_memoize lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::system::package_level_locale lang::system::locale lang::system::locale (public) lang::system::locale->lang::system::package_level_locale

Testcases:
test_get_locales

lang::system::package_level_locale_not_cached (private)

 lang::system::package_level_locale_not_cached package_id
Parameters:
package_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::system::package_level_locale lang::system::package_level_locale (public) lang::system::package_level_locale_not_cached lang::system::package_level_locale_not_cached lang::system::package_level_locale->lang::system::package_level_locale_not_cached db_string db_string (public) lang::system::package_level_locale_not_cached->db_string

Testcases:
No testcase defined.

lang::system::set_locale (public)

 lang::system::set_locale [ -package_id package_id ] locale

Set system locale setting for a given package instance, or the site-wide system locale.

Switches:
-package_id (optional)
The package for which you want to set the locale setting, if you want to set system setting for one package only. Leave blank for site-wide setting.
Parameters:
locale (required)
The new locale that you want to use as your system locale.

Partial Call Graph (max 5 caller/called nodes):
%3 test_dt_localized_procs dt_localized_procs (test acs-datetime) lang::system::set_locale lang::system::set_locale test_dt_localized_procs->lang::system::set_locale test_link_tests link_tests (test xowiki) test_link_tests->lang::system::set_locale test_locale__test_system_package_setting locale__test_system_package_setting (test acs-lang) test_locale__test_system_package_setting->lang::system::set_locale test_path_resolve path_resolve (test xowiki) test_path_resolve->lang::system::set_locale test_slot_interactions slot_interactions (test xowiki) test_slot_interactions->lang::system::set_locale apm_package_id_from_key apm_package_id_from_key (public) lang::system::set_locale->apm_package_id_from_key db_dml db_dml (public) lang::system::set_locale->db_dml parameter::set_value parameter::set_value (public) lang::system::set_locale->parameter::set_value util_memoize_flush util_memoize_flush (public) lang::system::set_locale->util_memoize_flush install::xml::action::set-system-locale install::xml::action::set-system-locale (private) install::xml::action::set-system-locale->lang::system::set_locale

Testcases:
dt_localized_procs, locale__test_system_package_setting, test_get_locales, link_tests, slot_interactions, path_resolve

lang::system::set_timezone (public)

 lang::system::set_timezone timezone

Tell OpenACS what timezone we think it's running in.

Parameters:
timezone (required)
name from acs-reference package (e.g., Asia/Tokyo, America/New_York)

Partial Call Graph (max 5 caller/called nodes):
%3 test_lang_test__lc_procs lang_test__lc_procs (test acs-lang) lang::system::set_timezone lang::system::set_timezone test_lang_test__lc_procs->lang::system::set_timezone test_set_get_timezone set_get_timezone (test acs-lang) test_set_get_timezone->lang::system::set_timezone apm_package_id_from_key apm_package_id_from_key (public) lang::system::set_timezone->apm_package_id_from_key parameter::set_value parameter::set_value (public) lang::system::set_timezone->parameter::set_value packages/acs-lang/www/admin/set-system-timezone.tcl packages/acs-lang/ www/admin/set-system-timezone.tcl packages/acs-lang/www/admin/set-system-timezone.tcl->lang::system::set_timezone

Testcases:
lang_test__lc_procs, set_get_timezone

lang::system::site_wide_locale (public)

 lang::system::site_wide_locale

Get the site-wide system locale setting.

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_context_bar_multirow ad_context_bar_multirow (test acs-tcl) lang::system::site_wide_locale lang::system::site_wide_locale test_ad_context_bar_multirow->lang::system::site_wide_locale test_locale__test_system_package_setting locale__test_system_package_setting (test acs-lang) test_locale__test_system_package_setting->lang::system::site_wide_locale apm_package_id_from_key apm_package_id_from_key (public) lang::system::site_wide_locale->apm_package_id_from_key lang::system::get_locales lang::system::get_locales (public) lang::system::site_wide_locale->lang::system::get_locales parameter::get parameter::get (public) lang::system::site_wide_locale->parameter::get auth::local::registration::Register auth::local::registration::Register (private) auth::local::registration::Register->lang::system::site_wide_locale callback::search::datasource::impl::forums_message callback::search::datasource::impl::forums_message (private) callback::search::datasource::impl::forums_message->lang::system::site_wide_locale forum::format::reply_subject forum::format::reply_subject (public) forum::format::reply_subject->lang::system::site_wide_locale forum::message::datasource forum::message::datasource (private, deprecated) forum::message::datasource->lang::system::site_wide_locale lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::system::site_wide_locale

Testcases:
locale__test_system_package_setting, ad_context_bar_multirow

lang::system::timezone (public)

 lang::system::timezone

Ask OpenACS what it thinks our timezone is.

Returns:
a timezone name from acs-reference package (e.g., Asia/Tokyo, America/New_York)

Partial Call Graph (max 5 caller/called nodes):
%3 test_a_foreign_calendar_user a_foreign_calendar_user (test calendar) lang::system::timezone lang::system::timezone test_a_foreign_calendar_user->lang::system::timezone test_set_get_timezone set_get_timezone (test acs-lang) test_set_get_timezone->lang::system::timezone test_set_timezone_not_logged_in set_timezone_not_logged_in (test acs-lang) test_set_timezone_not_logged_in->lang::system::timezone test_test_timezone_offset test_timezone_offset (test acs-lang) test_test_timezone_offset->lang::system::timezone apm_package_id_from_key apm_package_id_from_key (public) lang::system::timezone->apm_package_id_from_key parameter::get parameter::get (public) lang::system::timezone->parameter::get fs::rss::datasource fs::rss::datasource (private) fs::rss::datasource->lang::system::timezone lang::conn::timezone lang::conn::timezone (public) lang::conn::timezone->lang::system::timezone lang::system::timezone_utc_offset lang::system::timezone_utc_offset (public) lang::system::timezone_utc_offset->lang::system::timezone lc_time_conn_to_system lc_time_conn_to_system (public) lc_time_conn_to_system->lang::system::timezone lc_time_system_to_conn lc_time_system_to_conn (public) lc_time_system_to_conn->lang::system::timezone

Testcases:
set_get_timezone, set_timezone_not_logged_in, test_timezone_offset, a_foreign_calendar_user

lang::system::timezone_utc_offset (public)

 lang::system::timezone_utc_offset
Returns:
number of hours to subtract from local (database) time to get UTC

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_timezone_offset test_timezone_offset (test acs-lang) lang::system::timezone_utc_offset lang::system::timezone_utc_offset test_test_timezone_offset->lang::system::timezone_utc_offset db_string db_string (public) lang::system::timezone_utc_offset->db_string lang::system::timezone lang::system::timezone (public) lang::system::timezone_utc_offset->lang::system::timezone packages/acs-lang/www/admin/set-system-timezone.tcl packages/acs-lang/ www/admin/set-system-timezone.tcl packages/acs-lang/www/admin/set-system-timezone.tcl->lang::system::timezone_utc_offset

Testcases:
test_timezone_offset

lang::system::use_package_level_locales_p (public)

 lang::system::use_package_level_locales_p

Returns whether we're using package level locales.

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::system::use_package_level_locales_p lang::system::use_package_level_locales_p test_test_get_locales->lang::system::use_package_level_locales_p apm_package_id_from_key apm_package_id_from_key (public) lang::system::use_package_level_locales_p->apm_package_id_from_key parameter::get parameter::get (public) lang::system::use_package_level_locales_p->parameter::get lang::system::package_level_locale lang::system::package_level_locale (public) lang::system::package_level_locale->lang::system::use_package_level_locales_p lang::user::package_level_locale lang::user::package_level_locale (public) lang::user::package_level_locale->lang::system::use_package_level_locales_p packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::system::use_package_level_locales_p

Testcases:
test_get_locales

lang::user::language (public)

 lang::user::language [ -package_id package_id ] [ -user_id user_id ] \
    [ -site_wide ] [ -iso6392 ]

Get user language preference for a given package instance. This preliminary implementation only has one site-wide setting, though.

Switches:
-package_id (optional)
The package for which you want to get the language setting.
-user_id (optional)
The user we wish to get the language for, defaults to connection user.
-site_wide (optional, boolean)
Set this if you want to get the site-wide language setting.
-iso6392 (optional, boolean)
Set this if you want to force iso-639-2 code (3 digits)
Returns:
3 chars language code if iso6392 is set, left part of locale otherwise

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::user::language lang::user::language test_test_get_locales->lang::user::language lang::user::locale lang::user::locale (public) lang::user::language->lang::user::locale lang::util::iso6392_from_language lang::util::iso6392_from_language (public) lang::user::language->lang::util::iso6392_from_language packages/acs-lang/www/index.tcl packages/acs-lang/ www/index.tcl packages/acs-lang/www/index.tcl->lang::user::language

Testcases:
test_get_locales

lang::user::locale (public)

 lang::user::locale [ -package_id package_id ] [ -site_wide ] \
    [ -user_id user_id ]

Get user locale preference for a given package instance.

Switches:
-package_id (optional)
The package for which you want to get the locale preference.
-site_wide (optional, boolean)
Set this if you want to get the site-wide locale preference.
-user_id (optional)
Set this to the user you want to get the locale of, defaults to current user.

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_numeric create_form_with_numeric (test xowiki) lang::user::locale lang::user::locale test_create_form_with_numeric->lang::user::locale test_test_get_locales test_get_locales (test acs-lang) test_test_get_locales->lang::user::locale ad_conn ad_conn (public) lang::user::locale->ad_conn lang::user::package_level_locale lang::user::package_level_locale (public) lang::user::locale->lang::user::package_level_locale lang::user::site_wide_locale lang::user::site_wide_locale (public) lang::user::locale->lang::user::site_wide_locale auth::local::registration::Register auth::local::registration::Register (private) auth::local::registration::Register->lang::user::locale lang::user::language lang::user::language (public) lang::user::language->lang::user::locale packages/acs-lang/www/index.tcl packages/acs-lang/ www/index.tcl packages/acs-lang/www/index.tcl->lang::user::locale packages/acs-subsite/www/members/member-state-change.tcl packages/acs-subsite/ www/members/member-state-change.tcl packages/acs-subsite/www/members/member-state-change.tcl->lang::user::locale

Testcases:
test_get_locales, create_form_with_numeric

lang::user::package_level_locale (public)

 lang::user::package_level_locale [ -user_id user_id ] package_id

Get the user's preferred package level locale for a package given by its package id.

Switches:
-user_id (optional)
Parameters:
package_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_get_locales test_get_locales (test acs-lang) lang::user::package_level_locale lang::user::package_level_locale test_test_get_locales->lang::user::package_level_locale ad_conn ad_conn (public) lang::user::package_level_locale->ad_conn lang::system::use_package_level_locales_p lang::system::use_package_level_locales_p (public) lang::user::package_level_locale->lang::system::use_package_level_locales_p lang::user::package_level_locale_not_cached lang::user::package_level_locale_not_cached (private) lang::user::package_level_locale->lang::user::package_level_locale_not_cached sec_session_timeout sec_session_timeout lang::user::package_level_locale->sec_session_timeout util_memoize util_memoize (public) lang::user::package_level_locale->util_memoize lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::user::package_level_locale lang::user::locale lang::user::locale (public) lang::user::locale->lang::user::package_level_locale packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::user::package_level_locale

Testcases:
test_get_locales

lang::user::package_level_locale_not_cached (private)

 lang::user::package_level_locale_not_cached user_id package_id

Get the user's preferred package level locale for a package given by its package id. Will return the empty string if the user has not preference for the package.

Parameters:
user_id (required)
package_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::user::package_level_locale lang::user::package_level_locale (public) lang::user::package_level_locale_not_cached lang::user::package_level_locale_not_cached lang::user::package_level_locale->lang::user::package_level_locale_not_cached db_string db_string (public) lang::user::package_level_locale_not_cached->db_string

Testcases:
No testcase defined.

lang::user::set_locale (public)

 lang::user::set_locale [ -package_id package_id ] [ -user_id user_id ] \
    locale

Set user locale setting for a given package instance.

Switches:
-package_id (optional)
The package for which you want to set the locale setting, if you want to set it for a specific package, as opposed to a site-wide setting.
-user_id (optional)
Parameters:
locale (required)
The new locale that you want to use as your system locale.

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_numeric create_form_with_numeric (test xowiki) lang::user::set_locale lang::user::set_locale test_create_form_with_numeric->lang::user::set_locale test_lang_test__lang_user_site_wide_locale lang_test__lang_user_site_wide_locale (test acs-lang) test_lang_test__lang_user_site_wide_locale->lang::user::set_locale test_test_get_locales test_get_locales (test acs-lang) test_test_get_locales->lang::user::set_locale ad_conn ad_conn (public) lang::user::set_locale->ad_conn ad_set_cookie ad_set_cookie (public) lang::user::set_locale->ad_set_cookie db_dml db_dml (public) lang::user::set_locale->db_dml db_string db_string (public) lang::user::set_locale->db_string security::cookie_name security::cookie_name (public) lang::user::set_locale->security::cookie_name acs::test::user::create acs::test::user::create (public) acs::test::user::create->lang::user::set_locale packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::user::set_locale packages/acs-lang/www/change-locale.tcl packages/acs-lang/ www/change-locale.tcl packages/acs-lang/www/change-locale.tcl->lang::user::set_locale packages/acs-subsite/lib/user-info.tcl packages/acs-subsite/ lib/user-info.tcl packages/acs-subsite/lib/user-info.tcl->lang::user::set_locale packages/acs-subsite/lib/user-new.tcl packages/acs-subsite/ lib/user-new.tcl packages/acs-subsite/lib/user-new.tcl->lang::user::set_locale

Testcases:
lang_test__lang_user_site_wide_locale, test_get_locales, create_form_with_numeric

lang::user::set_timezone (public)

 lang::user::set_timezone timezone

Set the user's timezone setting.

Parameters:
timezone (required)
name from acs-reference package (e.g., Asia/Tokyo, America/New_York)

Partial Call Graph (max 5 caller/called nodes):
%3 test_set_get_timezone set_get_timezone (test acs-lang) lang::user::set_timezone lang::user::set_timezone test_set_get_timezone->lang::user::set_timezone test_set_timezone_not_logged_in set_timezone_not_logged_in (test acs-lang) test_set_timezone_not_logged_in->lang::user::set_timezone ad_conn ad_conn (public) lang::user::set_timezone->ad_conn db_dml db_dml (public) lang::user::set_timezone->db_dml util_memoize_flush util_memoize_flush (public) lang::user::set_timezone->util_memoize_flush packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::user::set_timezone packages/acs-subsite/lib/user-info.tcl packages/acs-subsite/ lib/user-info.tcl packages/acs-subsite/lib/user-info.tcl->lang::user::set_timezone

Testcases:
set_get_timezone, set_timezone_not_logged_in

lang::user::site_wide_locale (public)

 lang::user::site_wide_locale [ -user_id user_id ]

Get the user's preferred site-wide locale.

Switches:
-user_id (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_lang_test__lang_user_site_wide_locale lang_test__lang_user_site_wide_locale (test acs-lang) lang::user::site_wide_locale lang::user::site_wide_locale test_lang_test__lang_user_site_wide_locale->lang::user::site_wide_locale ad_conn ad_conn (public) lang::user::site_wide_locale->ad_conn lang::user::site_wide_locale_not_cached lang::user::site_wide_locale_not_cached (private) lang::user::site_wide_locale->lang::user::site_wide_locale_not_cached sec_session_timeout sec_session_timeout lang::user::site_wide_locale->sec_session_timeout util_memoize util_memoize (public) lang::user::site_wide_locale->util_memoize lang::conn::locale_not_cached lang::conn::locale_not_cached (private) lang::conn::locale_not_cached->lang::user::site_wide_locale lang::user::locale lang::user::locale (public) lang::user::locale->lang::user::site_wide_locale notification::email::send notification::email::send (public) notification::email::send->lang::user::site_wide_locale packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::user::site_wide_locale

Testcases:
lang_test__lang_user_site_wide_locale

lang::user::site_wide_locale_not_cached (private)

 lang::user::site_wide_locale_not_cached user_id

Get the user's preferred site-wide locale.

Parameters:
user_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::user::site_wide_locale lang::user::site_wide_locale (public) lang::user::site_wide_locale_not_cached lang::user::site_wide_locale_not_cached lang::user::site_wide_locale->lang::user::site_wide_locale_not_cached ad_get_cookie ad_get_cookie (public) lang::user::site_wide_locale_not_cached->ad_get_cookie ad_unset_cookie ad_unset_cookie (public) lang::user::site_wide_locale_not_cached->ad_unset_cookie db_string db_string (public) lang::user::site_wide_locale_not_cached->db_string lang::system::get_locales lang::system::get_locales (public) lang::user::site_wide_locale_not_cached->lang::system::get_locales lang::system::site_wide_locale lang::system::site_wide_locale (public) lang::user::site_wide_locale_not_cached->lang::system::site_wide_locale

Testcases:
No testcase defined.

lang::user::timezone (public)

 lang::user::timezone

Get the user's timezone. Returns the empty string if the user has no timezone set.

Returns:
a timezone name from acs-reference package (e.g., Asia/Tokyo, America/New_York)

Partial Call Graph (max 5 caller/called nodes):
%3 test_set_get_timezone set_get_timezone (test acs-lang) lang::user::timezone lang::user::timezone test_set_get_timezone->lang::user::timezone ad_conn ad_conn (public) lang::user::timezone->ad_conn lang::user::timezone_no_cache lang::user::timezone_no_cache (private) lang::user::timezone->lang::user::timezone_no_cache util_memoize util_memoize (public) lang::user::timezone->util_memoize lang::conn::timezone lang::conn::timezone (public) lang::conn::timezone->lang::user::timezone packages/acs-lang/www/change-locale-include.tcl packages/acs-lang/ www/change-locale-include.tcl packages/acs-lang/www/change-locale-include.tcl->lang::user::timezone packages/acs-subsite/lib/user-info.tcl packages/acs-subsite/ lib/user-info.tcl packages/acs-subsite/lib/user-info.tcl->lang::user::timezone

Testcases:
set_get_timezone

lang::user::timezone_no_cache (private)

 lang::user::timezone_no_cache user_id
Parameters:
user_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 lang::user::timezone lang::user::timezone (public) lang::user::timezone_no_cache lang::user::timezone_no_cache lang::user::timezone->lang::user::timezone_no_cache db_string db_string (public) lang::user::timezone_no_cache->db_string

Testcases:
No testcase defined.
[ show source ]