diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/make_emptyhomes_po | 32 | ||||
-rwxr-xr-x | bin/send-reports | 10 |
2 files changed, 26 insertions, 16 deletions
diff --git a/bin/make_emptyhomes_po b/bin/make_emptyhomes_po index 5df24928e..2c43301fe 100755 --- a/bin/make_emptyhomes_po +++ b/bin/make_emptyhomes_po @@ -12,11 +12,15 @@ mkdir("en_GB.UTF-8"); mkdir("en_GB.UTF-8/LC_MESSAGES"); open(MAINPO, "FixMyStreet.po") or die ""; +open(EHAPO, ">FixMyStreet-EmptyHomes.po") or die ""; open(NEWPO, ">en_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.po") or die ""; print NEWPO "# AUTOMATICALLY GENERATED by make_emptyhomes_po, do not edit\n"; print NEWPO "\n"; +print EHAPO "# AUTOMATICALLY GENERATED by make_emptyhomes_po, do not edit\n"; +print EHAPO "\n"; + my $buffer = ""; my $start = 0; while(<MAINPO>) { @@ -31,7 +35,7 @@ while(<MAINPO>) { $_ = '"PO-Revision-Date: '.$time.'\\n"'."\n"; } if (m/"Language-Team: LANGUAGE/) { - $_ = '"Language-Team: Live Simply Promise\\n"'."\n"; + $_ = '"Language-Team: mySociety\\n"'."\n"; } if (m/"Plural-Forms: nplurals=/) { $_ = '"Plural-Forms: nplurals=2; plural=n != 1;\\n"'."\n"; @@ -40,23 +44,16 @@ while(<MAINPO>) { if (m/^#/) { # comment or blank line print NEWPO $_; + print EHAPO $_; } elsif (m/^\s+$/) { # blank line $start = 1; $buffer = ""; print NEWPO $_; + print EHAPO $_; } elsif ($start && (m/^msgstr ""/ || m/^msgstr\[0\] ""/)) { - # start of translated text - translate English into Live Simple Promise - # langauage - if (m/^msgstr\[0\] ""/) { - $buffer =~ s/^msgid "/msgstr[0] "/m; - $buffer =~ s/^msgid_plural "/msgstr[1] "/m; - <MAINPO>; # skip untranslated plural - } else { - $buffer =~ s/^msgid "/msgstr "/; - } + # start of translated text - translate English into Empty Homes language - # Basics $buffer =~ s/FixMyStreet/Empty Homes Agency/g; $buffer =~ s/\bproblem\b/empty property/g; $buffer =~ s/\bProblem\b/Empty property/g; @@ -76,6 +73,19 @@ while(<MAINPO>) { $buffer =~ s/We send it to the council on your behalf/The details will be sent directly to the right person in the local council for them to take action/; $buffer =~ s/To find out what local alerts we have for you/To find out what local alerts we have in your area, council or ward/; + print EHAPO $buffer; + + if (m/^msgstr\[0\] ""/) { + $buffer =~ s/^msgid "/msgstr[0] "/m; + $buffer =~ s/^msgid_plural "/msgstr[1] "/m; + print EHAPO $_; + $_ = <MAINPO>; # skip untranslated plural + print EHAPO $_; + } else { + $buffer =~ s/^msgid "/msgstr "/; + print EHAPO $_; + } + print NEWPO $buffer; $buffer = ""; } else { diff --git a/bin/send-reports b/bin/send-reports index 15bf4080e..91e7a262f 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: send-reports,v 1.65 2009-05-21 14:32:29 matthew Exp $ +# $Id: send-reports,v 1.66 2009-05-27 13:53:52 matthew Exp $ use strict; require 5.8.0; @@ -74,18 +74,18 @@ foreach my $row (@$unsent) { $h{url} = $base_url . '/report/' . $row->{id}; $h{phone_line} = $h{phone} ? "Phone: $h{phone}\n\n" : ''; if ($row->{has_photo}) { - $h{has_photo} = "This web page also contains a photo of the problem, provided by the user.\n\n"; + $h{has_photo} = _("This web page also contains a photo of the problem, provided by the user.") . "\n\n"; $h{image_url} = $base_url . '/photo?id=' . $row->{id}; } else { $h{has_photo} = ''; $h{image_url} = ''; } - $h{fuzzy} = $row->{used_map} ? 'To view a map of the precise location of this issue' - : 'The user could not locate the problem on a map, but to see the area around the location they entered'; + $h{fuzzy} = $row->{used_map} ? _('To view a map of the precise location of this issue') + : _('The user could not locate the problem on a map, but to see the area around the location they entered'); $h{closest_address} = ''; my ($address, $distance) = mySociety::Dress::find_nearest($row->{easting}, $row->{northing}); if ($address) { - $h{closest_address} = sprintf("The closest address, as the crow flies, to the location of this problem, %.0fm away, is: %s - please note that this is automatically generated, so ensure that you check it against the details provided by the user and, if possible, the map.\n\n", + $h{closest_address} = sprintf(_("The closest address, as the crow flies, to the location of this problem, %.0fm away, is: %s - please note that this is automatically generated, so ensure that you check it against the details provided by the user and, if possible, the map.") . "\n\n", $distance, $address); ($h{closest_address_machine} = $h{closest_address}) =~ s/is: /is:\n\n/; $h{closest_address_machine} =~ s/ - please note/\n\n - please note/; |