Index: openacs-4/packages/acs-lang/www/admin/test/test.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/test/test.adp,v diff -u -N --- openacs-4/packages/acs-lang/www/admin/test/test.adp 7 Oct 2002 14:32:49 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,96 +0,0 @@ -<% - ns_set put [ns_conn outputheaders] "content-type" "text/html; charset=iso-8859-1" -%> -@header@ -

@title@

-Your Workspace : Testing the language and localization API -
-

-Test 1 -

-Verify that the message catalog loader ran -successfully at server startup. -

- - - - - - -
Word to lookupLanguageResults of catalog lookup
EnglishEnglish@english@
FrenchFrench@french@
SpanishSpanish@spanish@
GermanGerman@german@
-

- -Test 2 -

-Verify that the <trn> ADP tag works when the user's preferred -language is set to -English, -French, -Spanish, -or German. -

- - - - - - -
Word to lookupResult when user's preferred language is @language@
English@trn_english@
French@trn_french@
Spanish@trn_spanish@
German@trn_german@
-

- -Test 3 -

-Verify that data required to convert from local times for Europe/Paris into Universal Time -is loaded into the database. -

- - - - - - -
TimezoneStart dateEnd dateUTC offset
@tz_results.timezone@@tz_results.local_start@@tz_results.local_end@@tz_results.utc_offset@
-

- -Test 4 -

-Verify that the conversions between UTC and local time work correctly. -

- - - - - - -
Oracle sysdate (should be UTC)@system_time@
Local time in Europe/Paris@paris_time@
UTC time (converted from Paris time)@local_time@
Local time in Tokyo, Japan@tokyo_time@
UTC time (converted from Tokyo time)@tokyo_utc_time@
-

- -Test 5 -

-Verify the results of localization routines. -

- - - - - - - - - - - - - - - - - -
Routineen_US localeen_FR locale
Displaying a number@us_number@@fr_number@
Parsing a number@us_parse@@fr_parse@
Displaying a monetary amount@us_currency@@fr_currency@
@us_label@@fr_label@
Displaying a date@us_time@@fr_time@
-

- -@footer@ - - - - Index: openacs-4/packages/acs-lang/www/admin/test/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/test/test.tcl,v diff -u -N --- openacs-4/packages/acs-lang/www/admin/test/test.tcl 24 Sep 2013 18:56:33 -0000 1.3.10.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,66 +0,0 @@ -#/packages/lang/www/test.tcl -ad_page_contract { - - Tests procedures in the lang package - - @author John Lowry (lowry@ardigita.com) - @creation-date 29 September 2000 - @cvs-id $Id: test.tcl,v 1.3.10.1 2013/09/24 18:56:33 gustafn Exp $ -} { } - -set title "Test lang package" -set header [ad_header $title] -# set navbar [ad_context_bar "Test"] -set footer [ad_footer] - -# Test 1 verifies that the message catalog has loaded successfully -set english [_ en test.English] -set french [_ fr test.French] -set spanish [_ es test.Spanish] -set german [_ de test.German] - -#set lang [lang::user::language] -set lang [ad_get_client_property lang locale] -if {$lang eq ""} { - set lang "en" -} - -db_1row lang_get_lang_name "SELECT nls_language as language FROM ad_locales WHERE language = :lang" -if {$language eq ""} { - set language English -} - -# Test 2 checks the locale cookie to display in user's preferred language. -# We cannot embed the tags in the template because they will not get run each time. -# So we won't see the results of changing the locale cookie immediately. -set trn_english [ns_adp_parse "English"] -set trn_french [ns_adp_parse "French"] -set trn_spanish [ns_adp_parse "Spanish"] -set trn_german [ns_adp_parse "German"] - -# Test 3 checks that the timezone tables are installed -# Need this data to check that test 4 works -set tz_sql "SELECT tz as timezone - ,local_start - ,local_end - ,ROUND(timezones.gmt_offset * 24) as utc_offset - FROM timezone_rules, timezones - WHERE timezones.tz = 'Europe/Paris' - and timezone_rules.tz_id = timezones.tz_id - AND local_start > sysdate - 365 - AND local_end < sysdate + 365 - ORDER BY local_start" -db_multirow tz_results lang_tz_get_data $tz_sql - -# Test 4 checks that we can convert from local time to UTC -db_1row lang_system_time_select "SELECT to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') AS system_time FROM dual" - -set paris_time [lc_time_utc_to_local $system_time "Europe/Paris"] -set local_time [lc_time_local_to_utc $paris_time "Europe/Paris"] - - -set tokyo_time [lc_time_utc_to_local $system_time "Asia/Tokyo"] -set tokyo_utc_time [lc_time_local_to_utc $paris_time "Asia/Tokyo"] - - -ad_return_template \ No newline at end of file