- Publicity: Public Only All
lang-catalog-procs.tcl
Routines for importing/exporting messages from/to XML message catalog files. Every OpenACS package has one message catalog file for each locale (language and region) that its UI supports. Importing of messages means reading the messages from XML catalog files and storing them in the database. Exporting of messages refers to the opposite process. The key procedures in this library are:
- lang::catalog::import - Import all catalog files on the system into the database. Can be restricted to only import from one package and only certain locales.
- lang::catalog::import_from_file - Import from a single catalog file
- lang::catalog::export - Export all messages in the database to catalog files. Can be restricted to only export from one package and only certain locales.
- lang::catalog::export_to_file - Export messages to a single file
- Location:
- packages/acs-lang/tcl/lang-catalog-procs.tcl
- Created:
- 10 September 2000
- Authors:
- Jeff Davis
- Peter Marklund <peter@collaboraid.biz>
- Lars Pind <lars@collaboraid.biz>
- CVS Identification:
$Id: lang-catalog-procs.tcl,v 1.63 2024/10/08 13:35:13 antoniop Exp $
Procedures in this file
- lang::catalog::export (public)
- lang::catalog::import (public)
- lang::catalog::package_catalog_dir (public)
- lang::catalog::package_delete (public)
Detailed information
lang::catalog::export (public)
lang::catalog::export [ -package_key package_key ] \ [ -locales locales ]
Exports I18N messages from the database to XML catalog files. By default exports messages for all enabled packages and all enabled locales on the system. Can be restricted to export only for a certain package and/or a list of locales.
- Switches:
- -package_key (optional)
- A key of a package to restrict the export to
- -locales (optional)
- A list of locales to restrict the export to
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- test_catalog_import_export
lang::catalog::import (public)
lang::catalog::import [ -package_key package_key ] \ [ -locales locales ] [ -initialize ] [ -cache ]
Import messages from catalog files to the database. By default all messages for enabled packages and enabled locales will be imported. Optionally, the import can be restricted to a certain package and/or a list of locales. Invokes the proc lang::catalog::import_messages that deals with multiple imports (upgrades).
- Switches:
- -package_key (optional)
- Restrict the import to the package with this key
- -locales (optional)
- A list of locales to restrict the import to
- -initialize (optional, boolean)
- Only load messages from packages that have never before had any message imported
- -cache (optional, boolean)
- Provide this switch if you want the proc to cache all the imported messages
- Returns:
- An array list containing the number of messages processed, number of messages added, number of messages updated, number of messages deleted by the import, and a list of errors produced. The keys of the array list are processed, added, updated, and deleted, and errors.
- Author:
- Peter Marklund
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- lang_test__lc_procs, locale_language_fallback, upgrade, test_catalog_import_export
lang::catalog::package_catalog_dir (public)
lang::catalog::package_catalog_dir package_key
Return the catalog directory of the given package.
- Parameters:
- package_key (required)
- Author:
- Peter Marklund <peter@collaboraid.biz>
- Created:
- 18 October 2002
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- util__replace_temporary_tags_with_lookups
lang::catalog::package_delete (public)
lang::catalog::package_delete -package_key package_key
Unregister the I18N messages for the package.
- Switches:
- -package_key (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- test_catalog_import_export