--- /home/siggi/incomming/downloads/drupal/drupal-6.2/my-patches/potx/orig/potx.inc 2008-03-25 18:54:57.000000000 +0100 +++ /home/siggi/incomming/downloads/drupal/drupal-6.2/my-patches/potx/changed/potx.inc 2008-06-14 18:18:54.000000000 +0200 @@ -352,7 +352,7 @@ function _potx_translation_export($trans // Column and table name changed between versions. $language_column = $api_version == POTX_API_6 ? 'language' : 'locale'; - $language_table = $api_version == POTX_API_6 ? 'languages' : 'locales_meta'; + $language_table = $api_version == POTX_API_6 ? 'languages' : 'languages'; if (!isset($plural)) { // Single string to look translation up for. @@ -421,7 +421,7 @@ function _potx_get_header($file, $templa // We only have language to use if we should export with that langcode. $language = NULL; if (isset($template_export_langcode)) { - $language = db_fetch_object(db_query($api_version == POTX_API_6 ? "SELECT language, name, plurals, formula FROM {languages} WHERE language = '%s'" : "SELECT locale, name, plurals, formula FROM {locales_meta} WHERE locale = '%s'", $template_export_langcode)); + $language = db_fetch_object(db_query($api_version == POTX_API_6 ? "SELECT language, name, plurals, formula FROM {languages} WHERE language = '%s'" : "SELECT language, name, plurals, formula FROM {languages} WHERE language = '%s'", $template_export_langcode)); } $output = '# $'.'Id'.'$'."\n"; @@ -1089,10 +1089,14 @@ function _potx_parse_js_string($string) */ function _potx_explore_dir($path = '', $basename = '*', $api_version = POTX_API_6) { $files = glob("$path$basename.{php,inc,module,engine,theme,install,info,profile". ($api_version == POTX_API_6 ? ',js}' :'}'), GLOB_BRACE); + $files = empty($files) ? array() : $files; $dirs = glob("$path*", GLOB_ONLYDIR); + $dirs = empty($dirs) ? array() : $dirs; + foreach ($dirs as $dir) { if (!preg_match("!(^|.+/)(CVS|.svn|.git)$!", $dir)) { $files = array_merge($files, _potx_explore_dir("$dir/", $basename)); + } } // Skip our own files, because we don't want to get strings from them