Skip to content

Commit

Permalink
Update file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Jan 16, 2024
1 parent f071aba commit 28e85d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions features/makephp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: Generate PHP files from PO files
Success: Created 1 file.
"""
And the return code should be 0
And the foo-plugin/foo-plugin-de_DE.php file should exist
And the foo-plugin/foo-plugin-de_DE.l10n.php file should exist

Scenario: Allows setting custom destination directory
Given an empty foo-plugin directory
Expand Down Expand Up @@ -77,7 +77,7 @@ Feature: Generate PHP files from PO files
Success: Created 1 file.
"""
And the return code should be 0
And the result/foo-plugin-de_DE.php file should exist
And the result/foo-plugin-de_DE.l10n.php file should exist

Scenario: Does include headers
Given an empty foo-plugin directory
Expand Down Expand Up @@ -112,19 +112,19 @@ Feature: Generate PHP files from PO files
"""
And the return code should be 0
And STDERR should be empty
And the foo-plugin/foo-plugin-de_DE.php file should contain:
And the foo-plugin/foo-plugin-de_DE.l10n.php file should contain:
"""
'language'=>'de_DE'
"""
And the foo-plugin/foo-plugin-de_DE.php file should contain:
And the foo-plugin/foo-plugin-de_DE.l10n.php file should contain:
"""
'domain'=>'foo-plugin'
"""
And the foo-plugin/foo-plugin-de_DE.php file should contain:
And the foo-plugin/foo-plugin-de_DE.l10n.php file should contain:
"""
'plural-forms'=>'nplurals=2; plural=(n != 1);'
"""
And the foo-plugin/foo-plugin-de_DE.php file should contain:
And the foo-plugin/foo-plugin-de_DE.l10n.php file should contain:
"""
'messages'=>[''=>['Foo Plugin'=>['Foo Plugin']]]
"""
Expand Down Expand Up @@ -161,7 +161,7 @@ Feature: Generate PHP files from PO files
Success: Created 1 file.
"""
And the return code should be 0
And the foo-plugin/foo-plugin-de_DE.php file should contain:
And the foo-plugin/foo-plugin-de_DE.l10n.php file should contain:
"""
'messages'=>[''=>['Foo Plugin'=>['Bar Plugin']]]
"""
2 changes: 1 addition & 1 deletion src/MakePhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __invoke( $args, $assoc_args ) {
}

$file_basename = basename( $file->getFilename(), '.po' );
$destination_file = "{$destination}/{$file_basename}.php";
$destination_file = "{$destination}/{$file_basename}.l10n.php";

$translations = Translations::fromPoFile( $file->getPathname() );
if ( ! PhpArrayGenerator::toFile( $translations, $destination_file ) ) {
Expand Down

0 comments on commit 28e85d9

Please sign in to comment.