From 2b3bf4833851c2ad1f8ccfa2b17d07652c81c65e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 21 Aug 2014 02:53:16 +0000 Subject: [PATCH] Fix strict notices in makepot. props jdgrimes. fixes #29254. git-svn-id: https://develop.svn.wordpress.org/trunk@29563 602fd350-edb4-49c9-b593-d223f7449a82 --- tools/i18n/extract.php | 6 ++++-- tools/i18n/pot-ext-meta.php | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) 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; }