apm_parse_catalog_path (public)
apm_parse_catalog_path file_path
Defined in packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl
Given the path of a file attempt to extract package_key, prefix, charset and locale information from the path assuming the path is on valid format for a message catalog file. If the parsing fails then the file is not considered a catalog file and the empty list is returned.
- Parameters:
- file_path (required)
- Path of file, relative to the OpenACS /packages dir, one of its parent directories, or absolute path.
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- apm_parse_catalog_path
Source code: array set filename_info {} # Catalog filepaths are on the form # package_key/catalog/optional_prefix_package_key.language.country.charset.xml set regexp_pattern "(?i)(\[^/\]+)/catalog/(.*)\\1\\.(\[a-z\]{2,3}_\[a-z\]{2})\\.(\[^.\]+)\\.xml\$" if { ![regexp $regexp_pattern $file_path match package_key prefix locale charset] } { return [list] } set filename_info(package_key) $package_key set filename_info(prefix) $prefix set filename_info(locale) $locale set filename_info(charset) $charset return [array get filename_info]XQL Not present: Generic, PostgreSQL, Oracle