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.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/i18n-convert.html 22 Mar 2004 11:50:28 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.html 22 Mar 2004 12:46:36 -0000 1.6 @@ -36,69 +36,26 @@ be automatically assigned to a case when the simulation begins. -</else>
  • Replace the temporary message tags in ADP files.�From the same Convert ADP ... page in /acs-admin/apm as in the last step, repeat the process but deselect Find human language text ... and select Replace <# ... #> tags ... and click OK. This step replaces all of the temporary tags with "short" message lookups, inserts the message keys into the database message catalog, and then writes that catalog out to an xml file.

  • Replace human-readable text in TCL files with temporary tags.�Examine all of the tcl files in the packages for human-readable text and replace it with temporary tags. The temporary tags in TCL are slightly different from those in ADP. If the first character in the temporary tag is an underscore (_), then the message keys will be auto-generated from the original message text. Here is an unmodified tcl file:

    ad_page_contract {
    -    List of messages for a case
    -} {
    -    case_id:integer
    -    role_id:integer
    -}
    -
    -set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
    -set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
    -workflow::role::get -role_id $role_id -array role_array
    -simulation::case::get -case_id $case_id -array case_array
    -
    -set title "Messages for $role_array(pretty_name) in $case_array(label)"
    -set context [list [list . "SimPlay"] [list [export_vars -base case-admin { case_id }] 
    -             "Administer $case_array(label)"] "Messages for $role_array(pretty_name)"]
    -
    -set user_id [ad_conn user_id]

    ... and here is the same file after temporary message tags have been manually added:

    ad_page_contract {
    -    List of messages for a case
    -} {
    -    case_id:integer
    -    role_id:integer
    -}
    -
    -set workflow_id [simulation::case::get_element -case_id $case_id -element
    -workflow_id]
    -set simulation_name [simulation::template::get_element -workflow_id
    -$workflow_id -element pretty_name]
    -workflow::role::get -role_id $role_id -array role_array
    -simulation::case::get -case_id $case_id -array case_array
    -
    -# Variables used by I18N messages (array variables not currently
    -supported)
    -set role_pretty_name $role_array(pretty_name)
    -set case_pretty_name $case_array(label)
    -set title <#case_admin_page_title Messages for %role_pretty_name% in
    -%case_pretty_name%#>
    -set context [list [list . <#_ SimPlay#>] [list [export_vars -base
    -case-admin { case_id }] <#_ Administer %case_pretty_name%#>] <#_ Messages
    -for %role_pretty_name%#>]

    Note that the message key case_admin_page_title was manually selected, because an autogenerated key for this text, with its substitute variables, would have been very confusing -

  • Replace the temporary message tags in TCL files.�Repeat step 2 for tcl files. Here is the example TCL file after conversion:

    ad_page_contract {
    -    List of messages for a case
    -} {
    -    case_id:integer
    -    role_id:integer
    -}
    -
    -set workflow_id [simulation::case::get_element -case_id $case_id -element
    -workflow_id]
    -set simulation_name [simulation::template::get_element -workflow_id
    -$workflow_id -element pretty_name]
    -workflow::role::get -role_id $role_id -array role_array
    -simulation::case::get -case_id $case_id -array case_array
    -
    -# Variables used by I18N messages (array variables not currently
    -supported)
    -set role_pretty_name $role_array(pretty_name)
    -set case_pretty_name $case_array(label)
    -set title [_ simulation.case_admin_page_title]
    -set context [list [list . [_ simulation.SimPlay]] [list [export_vars
    --base case-admin { case_id }] [_ simulation.lt_Administer_case_prett]] [_
    -simulation.lt_Messages_for_role_pre]]
    -
    -set user_id [ad_conn user_id]
  • Internationalize SQL Code.�If there is any user-visible TCL code in the .sql or .xql files, internationalize that the same way as for the TCL files.

  • Internationalize Package Parameters.� +</else>

  • Replace the temporary message tags in ADP files.�From the same Convert ADP ... page in /acs-admin/apm as in the last step, repeat the process but deselect Find human language text ... and select Replace <# ... #> tags ... and click OK. This step replaces all of the temporary tags with "short" message lookups, inserts the message keys into the database message catalog, and then writes that catalog out to an xml file.

  • Replace human-readable text in TCL files with temporary tags.�Examine all of the tcl files in the packages for human-readable text and replace it with temporary tags. The temporary tags in TCL are slightly different from those in ADP. If the first character in the temporary tag is an underscore (_), then the message keys will be auto-generated from the original message text. Here is an unmodified tcl file:

    +set title "Messages for $a(name) in $b(label)"
    +set context [list [list . "SimPlay"] \
    +                  [list [export_vars -base case-admin { case_id }] \ 
    +                    "Administer $a(name)"] \
    +                  "Messages for $a(name)"]
    +

    ... and here is the same file after temporary message tags have been manually added:

    +set title <#admin_title Messages for %a.name% in %b.label%#>
    +set context [list [list . <#_ SimPlay#>] \
    +                  [list [export_vars -base case-admin { case_id }] \
    +                    <#_ Administer %a.name%#>] \
    +                  <#_ Messages for %a.name%#>]
    +

    Note that the message key case_admin_page_title was manually selected, because an autogenerated key for this text, with its substitute variables, would have been very confusing +

  • Replace the temporary message tags in TCL files.�Repeat step 2 for tcl files. Here is the example TCL file after conversion:

    +set title [_ simulation.admin_title]
    +set context [list [list . [_ simulation.SimPlay]] \
    +                  [list [export_vars -base case-admin { case_id }] \
    +                    [_ simulation.lt_Administer_name_gt]] \
    +                  [_ simulation.lt_Messages_for_role_pre]]
    +
  • Internationalize SQL Code.�If there is any user-visible TCL code in the .sql or .xql files, internationalize that the same way as for the TCL files.

  • Internationalize Package Parameters.� 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" *
       grep -r "to_date.*H" *