Index: openacs-4/packages/acs-core-docs/www/i18n-convert.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-convert.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/i18n-convert.html 27 Feb 2004 11:20:51 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.html 4 Mar 2004 14:09:22 -0000 1.4 @@ -1,12 +1,12 @@ -Internationalizing Existing Packages

Internationalizing Existing Packages

Internationalize Message text in ADP and TCL

Acs-lang includes tools to automate some +Internationalizing Existing Packages

Internationalizing Existing Packages

Internationalize Message text in ADP and TCL

Acs-lang includes tools to automate some internationalization. From /acs-admin/apm/, select a package and then click on Internationalization, then Convert ADP, Tcl, and SQL files to using the - message catalog..

Internationalize Package Parameters with visible messages

+ message catalog..

Internationalize Package Parameters with visible messages

See Multilingual APM Parameters -

Internationalize Date and Time queries

  1. Find datetime in .xql files. Use command line tools to find suspect SQL code:

    grep -r "to_char.*H" *
    +    

Internationalize Date and Time queries

  1. Find datetime in .xql files. Use command line tools to find suspect SQL code:

    grep -r "to_char.*H" *
     grep -r "to_date.*H" *
     
  2. In SQL statements, replace the format string with the ANSI standard format, YYYY-MM-DD HH24:MI:SS and change the field name to *_ansi so that it cannot be confused with previous, improperly formatting fields. For example,

    to_char(timestamp,'MM/DD/YYYY HH:MI:SS') as foo_date_pretty

    becomes

    to_char(timestamp,'YYYY-MM-DD HH24:MI:SS') as foo_date_ansi
  3. In TCL files where the date fields are used, convert the datetime from local server timezone, which is how it's stored in the database, to the user's timezone for display. Do this with the localizing function lc_time_system_to_conn:

     set foo_date_ansi [lc_time_system_to_conn $foo_date_ansi]

    When a datetime will be written to the database, first convert it from the user's local time to the server's timezone with lc_time_conn_to_system.