[debian-edu-commits] debian-edu/ 01/01: Add tool to swap msgid/msgstr in po file.
Petter Reinholdtsen
pere at moszumanska.debian.org
Fri Mar 27 07:56:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
pere pushed a commit to branch master
in repository debian-edu-itil-doc-nb.
commit b123d24a4e5133fced17d7203ce70f5ee81ea4b2
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Fri Mar 27 08:56:51 2015 +0100
Add tool to swap msgid/msgstr in po file.
---
documentation/itil/po-swap | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/documentation/itil/po-swap b/documentation/itil/po-swap
new file mode 100755
index 0000000..14c7518
--- /dev/null
+++ b/documentation/itil/po-swap
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+#
+# Read itil.en.po, swap msgid and msgstr and write it as itil.nb.po
+
+use strict;
+use warnings;
+use Locale::Po4a::Po;
+my $enpofile=Locale::Po4a::Po->new();
+my $nbpofile=Locale::Po4a::Po->new();
+$enpofile->read('itil.en.po');
+for my $msgid ( keys %{$enpofile->{po}}) {
+ my $msgstr = $enpofile->gettext($msgid);
+ print("push $msgstr -> $msgid\n");
+ $nbpofile->push('msgid' => $msgstr, 'msgstr' => $msgid);
+}
+
+
+$nbpofile->write('itil.nb.po');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/debian-edu-itil-doc-nb.git
More information about the debian-edu-commits
mailing list