aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gettext-extract29
-rwxr-xr-xbin/make_emptyhomes_po1
-rwxr-xr-xbin/send-reports4
3 files changed, 31 insertions, 3 deletions
diff --git a/bin/gettext-extract b/bin/gettext-extract
index 70ed66a4f..eb2682701 100755
--- a/bin/gettext-extract
+++ b/bin/gettext-extract
@@ -7,7 +7,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: gettext-extract,v 1.1 2008-05-06 10:01:23 matthew Exp $
+# $Id: gettext-extract,v 1.2 2008-05-15 09:26:56 matthew Exp $
if [ -e ../../locale ]
then
@@ -25,6 +25,15 @@ fi
fi
fi
+# Take chunk of text and escape each line in it for putting in catalogue
+function plain_gettext_escape() {
+ IFS=""
+ while read LINE
+ do
+ LINE=${LINE//\"/\\\"}
+ echo \"$LINE\\n\"
+ done
+}
# File to write to, clear it to start with
PO=locale/FixMyStreet.po
@@ -51,3 +60,21 @@ mv $TEMP $PO
# XXX: Email templates - should be in >1 language...
# And the XSL page too.
+# Extract email templates
+echo >> $PO
+echo '#. Please leave the first word "Subject:" untranslated' >> $PO
+for X in bci/templates/emails/*
+do
+ # TODO: Should check for "*~" type filenames too, and do the *-livesimply case
+ # with wildcards rather than checking per template
+ if [ "$X" != "bci/templates/emails/CVS" -a "$X" != "bci/templates/emails/empty property-confirm" ]
+ then
+ echo >> $PO
+ echo "#: $X" >> $PO
+ echo msgid \"\" >> $PO
+ cat $X | plain_gettext_escape >> $PO
+ echo msgstr \"\" >> $PO
+ fi
+done
+
+
diff --git a/bin/make_emptyhomes_po b/bin/make_emptyhomes_po
index 56f61cb84..bd8f5c97a 100755
--- a/bin/make_emptyhomes_po
+++ b/bin/make_emptyhomes_po
@@ -68,6 +68,7 @@ while(<MAINPO>) {
$buffer =~ s/Recently put back into use empty properties/Recent empty properties put back into use/;
$buffer =~ s/\(like graffiti.*\)/ /;
+ $buffer =~ s/(Please enter your full name).*? -/$1 -/;
print NEWPO $buffer;
$buffer = "";
diff --git a/bin/send-reports b/bin/send-reports
index 9664832a3..23755bb3a 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.48 2007-10-22 18:00:04 matthew Exp $
+# $Id: send-reports,v 1.49 2008-05-15 09:26:56 matthew Exp $
use strict;
require 5.8.0;
@@ -127,7 +127,7 @@ If you know of an appropriate contact address, please do get in touch. ]\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) if ($address);
my $email = mySociety::Email::construct_email({
- _template_ => $template,
+ _template_ => _($template),
_parameters_ => \%h,
To => \@to,
From => [ $row->{email}, $row->{name} ],