aboutsummaryrefslogtreecommitdiffstats
path: root/bin/gettext-nget-patch
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-09 18:49:34 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-09 18:49:34 +0100
commit6a71f6c5918878eaf5dd372ac60fd4b2e57d0ed7 (patch)
treeca1a191b627f7ff506478b85533888a777c8ec15 /bin/gettext-nget-patch
parenta648b8b4d44752ec3286551478b191ac348a94c5 (diff)
nget a phrase to stop it being duplicated in the .po file, and some more missing strings.
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');
+}
+