Fix strict notices in makepot.
props jdgrimes. fixes #29254. git-svn-id: https://develop.svn.wordpress.org/trunk@29563 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2736174b9b
commit
2b3bf48338
@ -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 );
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user