aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-10-05 11:00:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-10-05 11:00:35 +0100
commit00df8752bd16f7250062cf6ef95a7418f449b931 (patch)
treea50a17690d8e1d8b5f8e87bbe6b73e2c56d982fb
parent2bb8169b193edd206059ee793aa542a2aa967c07 (diff)
Fix Welsh po script.
-rwxr-xr-xbin/make_emptyhomes_welsh_po14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/make_emptyhomes_welsh_po b/bin/make_emptyhomes_welsh_po
index b3dd441a0..f4f6850d6 100755
--- a/bin/make_emptyhomes_welsh_po
+++ b/bin/make_emptyhomes_welsh_po
@@ -87,15 +87,21 @@ while(<MAINPO>) {
$new_buffer =~ s/"\n"//g;
if ($lookup{$new_buffer} && $lookup{$new_buffer}[1]) {
- print OUTPO "#, fuzzy\n";
- }
+ print OUTPO "#, fuzzy\n";
+ }
print OUTPO $buffer;
if ($lookup{$new_buffer}) {
print OUTPO $lookup{$new_buffer}[0];
} else {
- print __LINE__ . "\n";
- die "Failed to find match with buffer: $new_buffer";
+ if (m/^msgstr\[0\] ""/) {
+ $new_buffer =~ s/^msgid "/msgstr[0] "/m;
+ $new_buffer =~ s/^msgid_plural "/msgstr[1] "/m;
+ $_ = <MAINPO>; # skip untranslated plural
+ } else {
+ $new_buffer =~ s/^msgid "/msgstr "/;
+ }
+ print OUTPO $new_buffer;
}
$buffer = "";