diff --git a/tools/i18n/extract.php b/tools/i18n/extract.php index f819f0a4fc..59f873a3fd 100644 --- a/tools/i18n/extract.php +++ b/tools/i18n/extract.php @@ -28,10 +28,12 @@ class StringExtractor { foreach ( $file_names as $file_name ) { if ( '.' == $file_name || '..' == $file_name ) continue; if ( preg_match( '/\.php$/', $file_name ) && $this->does_file_name_match( $prefix . $file_name, $excludes, $includes ) ) { - $translations->merge_originals_with( $this->extract_from_file( $file_name, $prefix ) ); + $extracted = $this->extract_from_file( $file_name, $prefix ); + $translations->merge_originals_with( $extracted ); } if ( is_dir( $file_name ) ) { - $translations->merge_originals_with( $this->extract_from_directory( $file_name, $excludes, $includes, $prefix . $file_name . '/' ) ); + $extracted = $this->extract_from_directory( $file_name, $excludes, $includes, $prefix . $file_name . '/' ); + $translations->merge_originals_with( $extracted ); } } chdir( $old_cwd ); diff --git a/tools/i18n/pot-ext-meta.php b/tools/i18n/pot-ext-meta.php index c437fe3184..d90e2def6e 100644 --- a/tools/i18n/pot-ext-meta.php +++ b/tools/i18n/pot-ext-meta.php @@ -32,17 +32,19 @@ class PotExtMeta { } function load_from_file($ext_filename) { - $source = MakePOT::get_first_lines($ext_filename); + $makepot = new MakePOT; + $source = $makepot->get_first_lines($ext_filename); $pot = ''; + $po = new PO; foreach($this->headers as $header) { - $string = MakePOT::get_addon_header($header, $source); + $string = $makepot->get_addon_header($header, $source); if (!$string) continue; $args = array( 'singular' => $string, 'extracted_comments' => $header.' of the plugin/theme', ); $entry = new Translation_Entry($args); - $pot .= "\n".PO::export_entry($entry)."\n"; + $pot .= "\n".$po->export_entry($entry)."\n"; } return $pot; }