Index: openacs-4/packages/acs-core-docs/www/i18n-introduction.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-introduction.html,v diff -u -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/acs-core-docs/www/i18n-introduction.html 2 Mar 2019 19:30:04 -0000 1.20.2.1 +++ openacs-4/packages/acs-core-docs/www/i18n-introduction.html 3 Sep 2021 09:15:02 -0000 1.20.2.2 @@ -29,11 +29,11 @@ keys and localized ADP files. For ADP pages which are mostly code, replacing the message text with message key placeholders is simpler. This approach also allows new translation in the - database, without affecting the file system. For ADP pages + database, without affecting the filesystem. For ADP pages which are static and mostly text, it may be easier to create a new ADP page for each language. In this case, the pages are distinguished by a file naming convention. -

User Content

OpenACS does not have a general system for supporting multiple, localized versions of user-input content. This document currently refers only to internationalizing the text in the package user interface.

Separate Templates for each Locale

If the request processor finds a file named filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are processed normally.

Message Catalogs

Message Keys in Template Files (ADP Files)

+

User Content

OpenACS does not have a general system for supporting multiple, localized versions of user-input content. This document currently refers only to internationalizing the text in the package user interface.

Separate Templates for each Locale

If the request processor finds a filenamed filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are processed normally.

Message Catalogs

Message Keys in Template Files (ADP Files)

Internationalizing templates is about replacing human readable text in a certain language with internal message keys, which can then be dynamically replaced with real human language in @@ -89,7 +89,7 @@ files all message lookups *must* be on either of the following formats:

  • Typical static key lookup: [_ package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

  • - Static key lookup with non-default locale: [lang::message::lookup $locale package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

  • + Static key lookup with nondefault locale: [lang::message::lookup $locale package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

  • Dynamic key lookup: [lang::util::localize $var_with_embedded_message_keys] - In this case the message keys in the variable var_with_embedded_message_keys must appear as string literals \#package_key.message_key\# somewhere in the code. Here is an example of a dynamic lookup: set message_key_array { dynamic_key_1 \#package_key.message_key1\#