Given file foo.po
# "Bar" Something about "Foo"
msgid "Foo"
msgstr "Fop"
Running quotes.php over it (which doesn't change anything of the file itself):
<?php
require_once 'vendor/autoload.php';
$parser = new PoParser\Parser();
$parser->read("foo.po");
$parser->write("foo.po");
Results in:
# Bar" Something about "Foo
msgid "Foo"
msgstr "Fop"
And seemingly the trailing newline too...
diff --git a/locale/foo.po b/locale/foo.po
index 26d2324..1a38546 100644
--- a/locale/foo.po
+++ b/locale/foo.po
@@ -1,3 +1,3 @@
-# "Bar" Something about "Foo"
+# Bar" Something about "Foo
msgid "Foo"
-msgstr "Fop"
+msgstr "Fop"
\ No newline at end of file
All together:
$ cat foo.po
# "Bar" Something about "Foo"
msgid "Foo"
msgstr "Fop"
$ cat quotes.php
<?php
require_once 'vendor/autoload.php';
$parser = new PoParser\Parser();
$parser->read("foo.po");
$parser->write("foo.po");
$ php quotes.php
$ cat foo.po
# Bar" Something about "Foo
msgid "Foo"
msgstr "Fop"$
Given file
foo.poRunning
quotes.phpover it (which doesn't change anything of the file itself):Results in:
And seemingly the trailing newline too...
All together: