@@ -466,6 +466,68 @@ Feature: Update existing PO files from a POT file
466466 "X-Domain: foo-plugin\n"
467467 """
468468
469+ Scenario : Updates PO-Revision-Date when updating a PO file
470+ Given an empty foo-plugin directory
471+ And a foo-plugin/foo-plugin.pot file:
472+ """
473+ # Copyright (C) 2018 Foo Plugin
474+ # This file is distributed under the same license as the Foo Plugin package.
475+ msgid ""
476+ msgstr ""
477+ "Project-Id-Version: Foo Plugin\n"
478+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/foo-plugin\n"
479+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
480+ "Language-Team: LANGUAGE <[email protected] >\n" 481+ "MIME-Version: 1.0\n"
482+ "Content-Type: text/plain; charset=UTF-8\n"
483+ "Content-Transfer-Encoding: 8bit\n"
484+ "POT-Creation-Date: 2023-05-02T22:06:24+00:00\n"
485+ "PO-Revision-Date: 2023-05-02T22:06:24+00:00\n"
486+ "X-Domain: foo-plugin\n"
487+
488+ #: foo-plugin.php:1
489+ msgid "Some string"
490+ msgstr ""
491+ """
492+ And a foo-plugin/foo-plugin-de_DE.po file:
493+ """
494+ # Copyright (C) 2018 Foo Plugin
495+ # This file is distributed under the same license as the Foo Plugin package.
496+ msgid ""
497+ msgstr ""
498+ "Project-Id-Version: Foo Plugin\n"
499+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/foo-plugin\n"
500+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
501+ "Language-Team: LANGUAGE <[email protected] >\n" 502+ "Language: de_DE\n"
503+ "MIME-Version: 1.0\n"
504+ "Content-Type: text/plain; charset=UTF-8\n"
505+ "Content-Transfer-Encoding: 8bit\n"
506+ "POT-Creation-Date: 2018-05-02T22:06:24+00:00\n"
507+ "PO-Revision-Date: 2018-05-02T22:06:24+00:00\n"
508+ "X-Domain: foo-plugin\n"
509+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
510+
511+ #: foo-plugin.php:1
512+ msgid "Some string"
513+ msgstr "Some translated string"
514+ """
515+
516+ When I run `wp i18n update-po foo-plugin/foo-plugin.pot`
517+ Then STDOUT should be:
518+ """
519+ Success: Updated 1 file.
520+ """
521+ And STDERR should be empty
522+ And the foo-plugin/foo-plugin-de_DE.po file should contain:
523+ """
524+ "PO-Revision-Date:
525+ """
526+ And the foo-plugin/foo-plugin-de_DE.po file should not contain:
527+ """
528+ "PO-Revision-Date: 2018-05-02T22:06:24+00:00\n"
529+ """
530+
469531 Scenario : Keeps POT file order of translations
470532 Given an empty foo-plugin directory
471533 And a foo-plugin/foo-plugin.pot file:
@@ -516,4 +578,4 @@ Feature: Update existing PO files from a POT file
516578 Success: Updated 1 file.
517579 """
518580 And STDERR should be empty
519- And the contents of the foo-plugin/foo-plugin-de_DE.po file should match /First string.*Second string.*Third string/s
581+ And the contents of the foo-plugin/foo-plugin-de_DE.po file should match /First string.*Second string.*Third string/s
0 commit comments