lang::catalog::read_file (private)

 lang::catalog::read_file catalog_filename

Defined in packages/acs-lang/tcl/lang-catalog-procs.tcl

Returns the contents of the given catalog file as a string reading the file with the charset given in the filename.

Parameters:
catalog_filename - The full path of the catalog file to read. The basename of the file should be on the form package_key.locale.charset.ending where ending is either cat or xml (i.e. dotlrn.en_US.iso-8859-1.xml or dotlrn.en_US.iso-8859-1.cat). The cat ending is for the deprecated tcl-based catalog files.
Authors:
Jeff Davis
Peter Marklund <peter@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 test_util__replace_temporary_tags_with_lookups util__replace_temporary_tags_with_lookups (test acs-lang) lang::catalog::read_file lang::catalog::read_file test_util__replace_temporary_tags_with_lookups->lang::catalog::read_file lang::catalog::import_from_file lang::catalog::import_from_file (private) lang::catalog::import_from_file->lang::catalog::read_file lang::util::replace_temporary_tags_with_lookups lang::util::replace_temporary_tags_with_lookups (public) lang::util::replace_temporary_tags_with_lookups->lang::catalog::read_file

Testcases:
util__replace_temporary_tags_with_lookups
Source code:
    if {![regexp {/([^/]*)\.([^/]*)\.(?:xml|cat)$} $catalog_filename match base msg_encoding]} {
        ns_log Warning "Charset info missing in filename assuming $catalog_filename is iso-8859-1"
        set msg_encoding iso-8859-1
    }

    set msg_encoding [default_charset_if_unsupported $msg_encoding]

    ns_log Notice "reading $catalog_filename in $msg_encoding"
    set in [open $catalog_filename]
    fconfigure $in -encoding [ns_encodingforcharset $msg_encoding]
    set catalog_file_contents [read $in]
    close $in

    return $catalog_file_contents
Generic XQL file:
packages/acs-lang/tcl/lang-catalog-procs.xql

PostgreSQL XQL file:
packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql

Oracle XQL file:
packages/acs-lang/tcl/lang-catalog-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: