Index: openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 18 Sep 2003 14:58:10 -0000 1.26 +++ openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 19 Sep 2003 15:01:46 -0000 1.27 @@ -277,6 +277,21 @@ } } +ad_proc -private lang::catalog::package_has_files_in_locale_p {package_key locale} { + Return 1 if the given package has any catalog files for the given locale + and 0 otherwise. + + @author Peter Marklund +} { + if { [catch {glob [package_catalog_dir $package_key]/$package_key.${locale}.*}] } { + set has_file_in_locale_p 0 + } else { + set has_file_in_locale_p 1 + } + + return $has_file_in_locale_p +} + ad_proc -private lang::catalog::get_catalog_file_path { {-backup_from_version ""} {-backup_to_version ""} @@ -286,6 +301,9 @@ } { Get the full path of the catalog file for a given package, locale, and charset. + @see apm_parse_catalog_path + @see lang::catalog::package_has_files_in_locale_p + @author Peter Marklund } { set catalog_dir [package_catalog_dir $package_key] @@ -641,10 +659,16 @@ from ad_locales where enabled_p = 't' } { + # If we are only processing certain locales and this is not one of them - continue if { ![empty_string_p $restrict_to_locale] && ![string equal $restrict_to_locale $locale]} { continue } + # If the package has no files in this locale - continue + if { ![package_has_files_in_locale_p $package_key $locale] } { + continue + } + set charset [default_charset_if_unsupported $mime_charset] set file_path [get_catalog_file_path \