aboutsummaryrefslogtreecommitdiffstats
path: root/bin/gettext-nget-patch
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gettext-nget-patch')
-rwxr-xr-xbin/gettext-nget-patch26
1 files changed, 19 insertions, 7 deletions
diff --git a/bin/gettext-nget-patch b/bin/gettext-nget-patch
index 8f8dbc346..223bcc816 100755
--- a/bin/gettext-nget-patch
+++ b/bin/gettext-nget-patch
@@ -5,6 +5,8 @@
use File::Find qw/find/;
+my %out;
+
find( sub {
next unless -f;
open (FP, $_) or die $!;
@@ -16,15 +18,25 @@ find( sub {
$text .= <FP>;
} until $text =~ /\)/;
$text =~ /nget\(\s*"(.*?)"\s*,\s*"(.*?)"\s*,\s*(.*?)\s*\)/s;
- print <<EOF;
+ $out{$1} = {
+ file => $File::Find::name,
+ line => $line,
+ s => $1,
+ p => $2,
+ };
+ }
+ close FP;
+}, 'templates');
+
+foreach (values %out) {
+ print <<EOF;
-#: $File::Find::name:$line
+#: $_->{file}:$_->{line}
#, perl-format
-msgid "$1"
-msgid_plural "$2"
+msgid "$_->{s}"
+msgid_plural "$_->{p}"
msgstr[0] ""
msgstr[1] ""
EOF
- }
- close FP;
-}, 'templates');
+}
+