Skip to content

Commit

Permalink
Update makephp.feature to fix file extension, add missing newline at …
Browse files Browse the repository at this point in the history
…the end of file and improve test with more entries to test plural one
  • Loading branch information
sovetski committed Apr 10, 2024
1 parent d966001 commit 1edfaa0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions features/makephp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,16 @@ Feature: Generate PHP files from PO files
#: foo-plugin.js:15
msgid "Foo Plugin"
msgstr "Foo Plugin"
#: foo-plugin.js:16
msgid "Hello"
msgstr "Hallo"
#: foo-plugin.js:17
msgid "You have %d new message"
msgid_plural "You have %d new messages"
msgstr[0] "Du hast %d neue Nachricht"
msgstr[1] "Du hast %d neue Nachrichten"
"""

When I run `wp i18n make-php foo-plugin`
Expand All @@ -292,7 +302,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:
"""
<?php
return [
Expand All @@ -301,6 +311,9 @@ Feature: Generate PHP files from PO files
'messages' =>
[
'Foo Plugin' => 'Foo Plugin',
'Hello' => 'Hallo',
'You have %d new message' => 'Du hast %d neue Nachricht',
'You have %d new messages' => 'Du hast %d neue Nachrichten',
],
];
"""
"""

0 comments on commit 1edfaa0

Please sign in to comment.