aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/make_emptyhomes_po32
-rwxr-xr-xbin/send-reports10
-rw-r--r--perllib/Page.pm74
-rwxr-xr-xtemplates/website/faq-eha.html108
-rwxr-xr-xtemplates/website/faq.html108
-rwxr-xr-xweb/about.cgi6
-rwxr-xr-xweb/ajax.cgi6
-rwxr-xr-xweb/alert.cgi4
-rwxr-xr-xweb/confirm.cgi43
-rwxr-xr-xweb/contact.cgi6
-rwxr-xr-xweb/faq.cgi232
-rwxr-xr-xweb/index.cgi98
-rwxr-xr-xweb/questionnaire.cgi56
-rwxr-xr-xweb/reports.cgi29
14 files changed, 427 insertions, 385 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/;
diff --git a/perllib/Page.pm b/perllib/Page.pm
index dfd937232..843edcb64 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.143 2009-04-16 13:54:03 matthew Exp $
+# $Id: Page.pm,v 1.144 2009-05-27 13:53:52 matthew Exp $
#
package Page;
@@ -103,7 +103,7 @@ sub microsite {
$q->{site} = 'guardian' if $host =~ /guardian/;
if ($q->{site} eq 'emptyhomes') {
- mySociety::Locale::negotiate_language('en-gb,English,en_GB', 'en-gb');
+ mySociety::Locale::negotiate_language('en-gb,English,en_GB|cy,Cymraeg,cy_GB');
mySociety::Locale::gettext_domain('FixMyStreet-EmptyHomes');
mySociety::Locale::change();
} else {
@@ -153,9 +153,10 @@ sub header ($%) {
$html =~ s#<!-- TITLE -->#$title#;
} else {
my $fixmystreet = _('FixMyStreet');
+ my $lang = $mySociety::Locale::lang;
$html = <<EOF;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en-gb">
+<html lang="$lang">
<head>
<script type="text/javascript" src="/yui/utilities.js"></script>
<script type="text/javascript" src="/js.js"></script>
@@ -266,7 +267,7 @@ EOF
=cut
sub error_page ($$) {
my ($q, $message);
- my $html = header($q, title=>"Error")
+ my $html = header($q, title=>_("Error"))
. $q->p($message)
. footer($q);
print $q->header(-content_length => length($html)), $html;
@@ -342,10 +343,10 @@ $params{pre}
EOF
$out .= '<div id="watermark"></div>';
$out .= compass($q, $x, $y);
+ my $copyright = _('Crown copyright. All rights reserved. Ministry of Justice');
$out .= <<EOF;
</div>
- <p id="copyright">&copy; Crown copyright. All rights reserved.
- Ministry of Justice 100037819&nbsp;2008</p>
+ <p id="copyright">&copy; $copyright 100037819&nbsp;2008</p>
$params{post}
EOF
$out .= '</div>';
@@ -545,7 +546,7 @@ sub prettify_epoch {
my $tt = strftime('%H:%M', @s);
my @t = localtime();
if (strftime('%Y%m%d', @s) eq strftime('%Y%m%d', @t)) {
- $tt = "$tt " . 'today';
+ $tt = "$tt " . _('today');
} elsif (strftime('%Y %U', @s) eq strftime('%Y %U', @t)) {
$tt = "$tt, " . strftime('%A', @s);
} elsif (strftime('%Y', @s) eq strftime('%Y', @t)) {
@@ -567,13 +568,13 @@ sub prettify_duration {
$s = int(($s+60*30)/60/60)*60*60;
} elsif ($nearest eq 'minute') {
$s = int(($s+30)/60)*60;
- return 'less than a minute' if $s == 0;
+ return _('less than a minute') if $s == 0;
}
my @out = ();
- _part(\$s, 60*60*24*7, 'week', \@out);
- _part(\$s, 60*60*24, 'day', \@out);
- _part(\$s, 60*60, 'hour', \@out);
- _part(\$s, 60, 'minute', \@out);
+ _part(\$s, 60*60*24*7, _('week'), \@out);
+ _part(\$s, 60*60*24, _('day'), \@out);
+ _part(\$s, 60*60, _('hour'), \@out);
+ _part(\$s, 60, _('minute'), \@out);
return join(', ', @out);
}
sub _part {
@@ -592,24 +593,38 @@ sub display_problem_text {
# Display information about problem
$out .= '<p><em>';
if ($q->{site} eq 'emptyhomes') {
- $out .= ent($problem->{category}) . ', reported ';
+ if ($problem->{anonymous}) {
+ $out .= sprintf(_('%s, reported anonymously at %s'), ent($problem->{category}), prettify_epoch($problem->{time}));
+ } else {
+ $out .= sprintf(_('%s, reported by %s at %s'), ent($problem->{category}), ent($problem->{name}), prettify_epoch($problem->{time}));
+ }
} else {
- $out .= 'Reported ';
- $out .= 'by ' . ent($problem->{service}) . ' ' if $problem->{service};
- $out .= 'in the ' . ent($problem->{category}) . ' category '
- if $problem->{category} && $problem->{category} ne 'Other';
+ if ($problem->{service} && $problem->{category} && $problem->{category} ne 'Other' && $problem->{anonymous}) {
+ $out .= sprintf(_('Reported by %s in the %s category anonymously at %s'), ent($problem->{service}), ent($problem->{category}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{service} && $problem->{category} && $problem->{category} ne 'Other') {
+ $out .= sprintf(_('Reported by %s in the %s category by %s at %s'), ent($problem->{service}), ent($problem->{category}), ent($problem->{name}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{service} && $problem->{anonymous}) {
+ $out .= sprintf(_('Reported by %s anonymously at %s'), ent($problem->{service}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{service}) {
+ $out .= sprintf(_('Reported by %s by %s at %s'), ent($problem->{service}), ent($problem->{name}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{category} && $problem->{category} ne 'Other' && $problem->{anonymous}) {
+ $out .= sprintf(_('Reported in the %s category anonymously at %s'), ent($problem->{category}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{category} && $problem->{category} ne 'Other') {
+ $out .= sprintf(_('Reported in the %s category by %s at %s'), ent($problem->{category}), ent($problem->{name}), prettify_epoch($problem->{time}));
+ } elsif ($problem->{anonymous}) {
+ $out .= sprintf(_('Reported anonymously at %s'), prettify_epoch($problem->{time}));
+ } else {
+ $out .= sprintf(_('Reported by %s at %s'), ent($problem->{name}), prettify_epoch($problem->{time}));
+ }
}
- $out .= ($problem->{anonymous}) ? 'anonymously' : "by " . ent($problem->{name});
- $out .= ' at ' . prettify_epoch($problem->{time});
- $out .= '; the map was not used so pin location may be inaccurate' unless ($problem->{used_map});
+ $out .= '; ' . _('the map was not used so pin location may be inaccurate') unless ($problem->{used_map});
if ($problem->{council}) {
if ($problem->{whensent}) {
$problem->{council} =~ s/\|.*//g;
my @councils = split /,/, $problem->{council};
my $areas_info = mySociety::MaPit::get_voting_areas_info(\@councils);
my $council = join(' and ', map { $areas_info->{$_}->{name} } @councils);
- $out .= $q->br() . $q->small('Sent to ' . $council . ' ' .
- prettify_duration($problem->{whensent}, 'minute') . ' later');
+ $out .= $q->br() . $q->small(sprintf(_('Sent to %s %s later'), $council, prettify_duration($problem->{whensent}, 'minute')));
}
} else {
$out .= $q->br() . $q->small(_('Not reported to council'));
@@ -640,15 +655,14 @@ sub display_problem_updates {
my $out = '';
if (@$updates) {
$out .= '<div id="updates">';
- $out .= '<h2>Updates</h2>';
+ $out .= '<h2>' . _('Updates') . '</h2>';
foreach my $row (@$updates) {
$out .= "<div><p><a name=\"update_$row->{id}\"></a><em>";
if ($row->{name}) {
- $out .= sprintf(_('Posted by %s'), ent($row->{name}));
+ $out .= sprintf(_('Posted by %s at %s'), ent($row->{name}), prettify_epoch($row->{created}));
} else {
- $out .= _("Posted anonymously");
+ $out .= sprintf(_('Posted anonymously at %s'), prettify_epoch($row->{created}));
}
- $out .= " at " . prettify_epoch($row->{created});
$out .= ', ' . _('marked as fixed') if ($row->{mark_fixed});
$out .= ', ' . _('reopened') if ($row->{mark_open});
$out .= '</em></p>';
@@ -679,7 +693,7 @@ sub geocode {
try {
my $location = mySociety::MaPit::get_location($s);
my $island = $location->{coordsyst};
- throw RABX::Error("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.") if $island eq 'I';
+ throw RABX::Error(_("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.")) if $island eq 'I';
$easting = $location->{easting};
$northing = $location->{northing};
my $xx = Page::os_to_tile($easting);
@@ -692,7 +706,7 @@ sub geocode {
my $e = shift;
if ($e->value() && ($e->value() == mySociety::MaPit::BAD_POSTCODE
|| $e->value() == mySociety::MaPit::POSTCODE_NOT_FOUND)) {
- $error = 'That postcode was not recognised, sorry.';
+ $error = _('That postcode was not recognised, sorry.');
} else {
$error = $e;
}
@@ -728,7 +742,7 @@ sub geocode_string {
}
if (!$js) {
- $error = _('Sorry, we had a problem parsing that location. Please try again.');
+ $error = _('Sorry, we could not parse that location. Please try again.');
} elsif ($js !~ /"code": *200/) {
$error = _('Sorry, we could not find that location.');
} elsif ($js =~ /}, *{/) { # Multiple
@@ -741,7 +755,7 @@ sub geocode_string {
$error = _('Sorry, we could not find that location.') unless $error;
} elsif ($js =~ /BT\d/) {
# Northern Ireland, hopefully
- $error = "We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.";
+ $error = _("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.");
} else {
my ($accuracy) = $js =~ /"Accuracy": *(\d)/;
if ($accuracy < 4) {
diff --git a/templates/website/faq-eha.html b/templates/website/faq-eha.html
new file mode 100755
index 000000000..1a55478ec
--- /dev/null
+++ b/templates/website/faq-eha.html
@@ -0,0 +1,108 @@
+<h1>Frequently Asked Questions</h1>
+ <dl>
+ <dt>What is this site for?</dt>
+ <dd>This site is to help make it as easy as possible for you to get
+empty homes in your area put back into use. It allows you, to view empty homes
+that have been reported and see what has been done about them. It makes
+councils accountable for responding and dealing with the empty homes you
+report.</dd>
+ <dt>How do I use the site?</dt>
+ <dd>Enter a postcode or address in the box on the homepage and you
+are presented with a map of that area. Click where the empty property is, fill
+in the details, upload a photo if you have one and press submit. That&rsquo;s
+it. You can also view other empty properties that have been reported and see
+what has been done about them.</dd>
+ <dt>Is it free?</dt>
+ <dd>Yes. The costs of developing and running this site have been
+paid for by The Empty Homes Agency and through the generosity of its funders.
+The Empty Homes Agency is a charity, so if you believe in our aims and would
+like to make a contribution, <a href="http://www.emptyhomes.com/donate.html">please do</a>.</dd>
+ <dt>Do you remove silly or illegal content?</dt>
+ <dd>We reserve the right to remove any reports or updates
+which we consider to be inappropriate.</dd>
+ <dt>How do councils bring empty properties back into use?</dt>
+ <dd><p>All councils in England and Wales have powers to bring empty
+homes back into use. Many are very good at it, some are not. Most councils seek
+to persuade and help the owner to bring their property back into use; they only
+use legal powers such as Empty Dwelling Management Orders when help and
+persuasion have failed.</p> <p>
+Most empty homes are brought back into use eventually by their owner. But in
+many cases this takes years. Empty homes often decline fast &ndash; they become
+overrun with weeds and attacked by the weather. They are often used by
+squatters, fly tippers, vandals and are sometimes subject to arson. The whole
+neighbourhood suffers waiting for the owner to deal with their property.</p> <p>
+Councils help and persuade owners to bring their properties into use faster.
+Even so the process can be slow, especially if the property is in very poor
+repair or the owner is unwilling to do anything. In most cases it takes six
+months before you can expect to see anything change, occasionally longer. This
+doesn&rsquo;t mean the council isn&rsquo;t doing anything, which is why we encourage
+councils to update the website so you can see what is happening.</p> <p>
+We will contact you twice (a month and six months after you report the empty
+home) so you can tell us what has happened. If the council doesn&rsquo;t do anything,
+or you think their response is inadequate we will advise you what you can do
+next.</p> <p>
+If the empty home is owned by the government or one its agencies, councils are
+often powerless to help. However you might be able to take action directly
+yourself using a PROD:
+<a href="http://www.emptyhomes.com/usefulinformation/policy_docs/prods.html">http://www.emptyhomes.com/usefulinformation/policy_docs/prods.html</a>
+</dd>,
+ <dt>Will reporting an empty home make any difference?</dt>
+ <dd><p>Yes. Councils can make a real difference, but they have lots of
+things to do. Many councils only deal with empty homes that are reported to
+them. If people do not report empty homes, councils may well conclude that
+other areas of work are more important.</p> <p>
+There are over 840,000 empty homes in the UK. The Empty Homes Agency estimates
+that over half of these are unnecessarily empty. The effect of this is to
+significantly reduce the available housing stock fuelling the UK&rsquo;s housing
+crisis. A by-product of this waste is that far greater pressure is put on
+building land as more homes are built to meet the shortfall. The Empty Homes
+Agency estimate that bringing just a quarter of the UK&rsquo;s empty homes into use
+would provide homes for 700,000 people, save 160 square kilometres of land and
+save 10 million tonnes of CO<sub>2</sub> over building the same number of new homes.
+</dt>
+ </dl>
+ <h2>Privacy Questions</h2>
+ <dl>
+ <dt>Who gets to see my email address?</dt>
+ <dd>If you submit an empty property, your details are obviously provided to us.
+Your name is displayed upon the site if you let us, but not your email address;
+similarly with updates. We will never give or sell your email address to
+anyone else, unless we are obliged to by law.</dd>
+ <dt>Will you send nasty, brutish spam to my email address?</dt>
+ <dd>Never. We will email you if someone leaves an update on a
+report you&rsquo;ve made, and send you questionnaire emails four weeks and six months
+after you submit a problem, asking for a status update; we&rsquo;ll only ever
+send you emails in relation to your problem.</dd>
+ </dl>
+ <h2>Organisation Questions</h2>
+ <dl>
+ <dt>Who built this site?</dt>
+ <dd>This site was built by <a href="http://www.mysociety.org/">mySociety</a>.
+mySociety is the project of a registered charity which has grown out of the community of
+volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou</a>.
+mySociety&rsquo;s primary mission is to build Internet projects which give people simple, tangible
+benefits in the civic and community aspects of their lives. Our first project
+was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your
+elected representatives, for free.
+<a href="https://secure.mysociety.org/donate/">Donate to mySociety</a></dd>
+ <dt>Where&rsquo;s the "source code" to this site?</dt>
+ <dd>The software behind this site is open source, and available
+to you mainly under the GNU Affero GPL software license. You can <a
+href="https://secure.mysociety.org/cvstrac/dir?d=mysociety">download the
+source code</a> (look under &lsquo;bci&rsquo;) and help us develop it.
+You&rsquo;re welcome to use it in your own projects, although you must also
+make available the source code to any such projects.</dd>
+ <dt>People build things, not organisations. Who <em>actually</em> built it?</dt>
+ <dd>This adaptation of <a href="http://www.fixmystreet.com/">Fix&shy;MyStreet</a>
+was written by Matthew Somerville. Thanks go to
+<a href="http://www.ordnancesurvey.co.uk">Ordnance Survey</a> (for the maps,
+UK postcodes, and UK addresses &ndash; data &copy; Crown copyright, all
+rights reserved, Ministry of Justice 100037819&nbsp;2008),
+Yahoo! for their BSD-licensed JavaScript libraries, the entire free software
+community (this particular project was brought to you by Perl, PostgreSQL,
+and the number 161.290) and <a
+href="http://www.easynet.net/publicsector/">Easynet</a> (who kindly host all
+our servers).
+
+Let us know if we&rsquo;ve missed anyone.</dd>
+ </dl>
diff --git a/templates/website/faq.html b/templates/website/faq.html
new file mode 100755
index 000000000..ff7743d72
--- /dev/null
+++ b/templates/website/faq.html
@@ -0,0 +1,108 @@
+<h1>Frequently Asked Questions</h1>
+ <dl>
+ <dt>What is FixMyStreet for?</dt>
+ <dd>FixMyStreet is a site to help people report, view,
+or discuss local problems they&rsquo;ve found to their local council by
+simply locating them on a map. It launched in early February
+2007.</dd>
+ <dt>Can you give me some examples?</dt>
+ <dd>Sure. Graffiti, unlit lampposts, abandoned beds, broken
+glass on a cycle path; anything like that that could be usefully reported to
+your council to be fixed.</dd>
+ <dt>How do I use the site?</dt>
+ <dd>After entering a postcode or location, you are presented
+with a map of that area. You can view problems already reported in that area,
+or report ones of your own simply by clicking on the map at the location of
+the problem.</dd>
+ <dt>How are the problems solved?</dt>
+ <dd>They are reported to the relevant council by email. The
+council can then resolve the problem the way they normally would.
+Alternatively, you can discuss the problem on the website with others, and
+then together lobby the council to fix it, or fix it directly yourselves.</dd>
+ <dt>Is it free?</dt>
+ <dd>The site is free to use, yes. FixMyStreet is run
+by a registered charity, though, so if you want to make a contribution, <a
+href="https://secure.mysociety.org/donate/">please do</a>.</dd>
+ </dl>
+ <h2>Practical Questions</h2>
+ <dl>
+ <dt>I'm from a council, where do you send the reports?</dt>
+ <dd>You can either leave a test report or <a href="/contact">contact us</a>
+to find out where reports go at the moment. Also <a href="/contact">contact us</a>
+to update the address or addresses we use.</dd>
+ <dt>Do you remove silly or illegal content?</dt>
+ <dd>FixMyStreet is not responsible for the content and accuracy
+of material submitted by its users. All reports are accepted on the basis that
+they contain no illegal content, and we reserve the right to remove any
+problems or updates which we consider to be inappropriate upon being informed
+by a user of the site.</dd>
+ <dt>Why doesn't dragging the map work on reporting-a-problem pages in Safari or Konqueror?</dt>
+ <dd>There's a bug in these two browsers to do with setting images on form
+submit buttons, which the map uses when reporting a problem. It's fixed in the
+latest nightly build of Safari, so will presumably be fixed in the next
+release. Until then, I've sadly had to disable dragging to avoid people
+dragging an empty square.</dd>
+ <dt>Do you have any publicity material?</dt>
+ <dd>Sure, we have a whole <a href="posters/">array of posters, flyers and badges</a>.</dd>
+ </dl>
+ <h2>Privacy Questions</h2>
+ <dl>
+ <dt>Who gets to see my email address?</dt>
+ <dd>If you submit a problem, we pass on your details, and details
+of the problem, to the council contact or contacts responsible for the
+area where you located the problem. Your name is displayed upon the
+site if you let us, but not your email address; similarly with updates. We will
+never give or sell your email address to anyone else, unless we are
+obliged to by law.</dd>
+ <dt>Will you send nasty, brutish spam to my email address?</dt>
+ <dd>Never. We will email you if someone leaves an update on a
+problem you&rsquo;ve reported, and send you a questionnaire email four weeks
+after you submit a problem, asking for a status update; we&rsquo;ll only ever
+send you emails in relation to your problem.</dd>
+ </dl>
+ <h2>Organisation Questions</h2>
+ <dl>
+ <dt>Who built FixMyStreet?</dt>
+ <dd>This site was built by <a href="http://www.mysociety.org/">mySociety</a>, in conjunction with the <a href="http://www.youngfoundation.org.uk/">Young Foundation</a>.
+mySociety is the project of a registered charity which has grown out of the community of
+volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou.com</a>.
+mySociety&rsquo;s primary mission is to build Internet projects which give people simple, tangible
+benefits in the civic and community aspects of their lives. Our first project
+was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your
+elected representatives, for free.</dd>
+ <dt><img src="/i/moj.png" align="right" alt="Ministry of Justice" hspace="10">Who pays for it?</dt>
+ <dd>FixMyStreet was paid for via the Department for
+Constitutional Affairs Innovations Fund.</dd>
+ <dt><a name="nfi"></a>Wasn\'t this site called Neighbourhood Fix-It?</dt>
+ <dd>Yes, we changed the name mid June 2007. We decided
+Neighbourhood Fix-It was a bit of a mouthful, hard to spell, and hard to publicise (does the URL have a dash in it or not?). The domain FixMyStreet became available recently, and everyone liked the name.</dd>
+ <dt>Do you need any help with the project?</dt>
+ <dd>Yes, we can use help in all sorts of ways, technical or
+non-technical. Please see our <a
+href="http://www.mysociety.org/volunteertasks">volunteers page</a>.</dd>
+ <dt>Where&rsquo;s the "source code" to this site?</dt>
+ <dd>The software behind this site is open source, and available
+to you mainly under the GNU Affero GPL software license. You can <a
+href="https://secure.mysociety.org/cvstrac/dir?d=mysociety">download the
+source code</a> (look under &lsquo;bci&rsquo;) and help us develop it.
+You&rsquo;re welcome to use it in your own projects, although you must also
+make available the source code to any such projects.</dd>
+ <dt>People build things, not organisations. Who <em>actually</em> built it?</dt>
+ <dd>Matthew Somerville and Francis Irving wrote the site,
+Chris Lightfoot wrote the tileserver and map cutter, Richard Pope created
+our pins, Deborah Kerr keeps things up-to-date and does user support,
+Ayesha Garrett designed our posters, and Tom Steinberg managed it all.
+
+Thanks also to
+<a href="http://www.ordnancesurvey.co.uk">Ordnance Survey</a> (for the maps,
+UK postcodes, and UK addresses &ndash; data &copy; Crown copyright, all
+rights reserved, Ministry of Justice 100037819&nbsp;2008),
+Yahoo! for their BSD-licensed JavaScript libraries, the entire free software
+community (this particular project was brought to you by Perl, PostgreSQL,
+and the number 161.290) and <a
+href="http://www.easynet.net/publicsector/">Easynet</a> (who kindly host all
+our servers).
+
+Let us know if we&rsquo;ve missed anyone.</dd>
+ </dl>
+
diff --git a/web/about.cgi b/web/about.cgi
index e660bd8d1..49ea2e5bf 100755
--- a/web/about.cgi
+++ b/web/about.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: about.cgi,v 1.8 2008-10-15 22:07:26 matthew Exp $
+# $Id: about.cgi,v 1.9 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard -db;
@@ -16,8 +16,8 @@ my $lastmodified = (stat $0)[9];
# Main code for index.cgi
sub main {
my $q = shift;
- print Page::header($q, title=>'About us');
- print <<ABOUTUS if $q->{site} eq 'emptyhomes';
+ print Page::header($q, title=>_('About us'));
+ print _(<<ABOUTUS) if $q->{site} eq 'emptyhomes';
<h1>The Empty Homes Agency</h1>
<p>The Empty Homes agency is an independent campaigning charity. We are not
part of government, and have no formal links with local councils although we
diff --git a/web/ajax.cgi b/web/ajax.cgi
index c55e4563c..600cf9567 100755
--- a/web/ajax.cgi
+++ b/web/ajax.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: ajax.cgi,v 1.8 2008-12-03 18:21:22 matthew Exp $
+# $Id: ajax.cgi,v 1.9 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -42,7 +42,7 @@ sub main {
$list .= '<li><a href="/report/' . $_->{id} . '">';
$list .= $_->{title};
$list .= '</a>';
- $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed';
+ $list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
my $om_list = $list;
@@ -52,7 +52,7 @@ sub main {
$list .= '<li><a href="/report/' . $_->{id} . '">';
$list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>';
$list .= '</a>';
- $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed';
+ $list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
my $am_list = $list;
diff --git a/web/alert.cgi b/web/alert.cgi
index d11ff92b5..3d6213adf 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: alert.cgi,v 1.37 2009-03-03 10:08:16 matthew Exp $
+# $Id: alert.cgi,v 1.38 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -35,7 +35,7 @@ sub main {
$out = alert_token($q, $data);
} else {
$out = $q->p(_(<<EOF));
-Thank you for trying to confirm your alert. We seem to have a problem ourselves
+Thank you for trying to confirm your alert. We seem to have an error ourselves
though, so <a href="/contact">please let us know what went on</a> and we'll look into it.
EOF
}
diff --git a/web/confirm.cgi b/web/confirm.cgi
index 34deef222..7683f5f9d 100755
--- a/web/confirm.cgi
+++ b/web/confirm.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: confirm.cgi,v 1.53 2009-02-16 17:38:42 matthew Exp $
+# $Id: confirm.cgi,v 1.54 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -37,8 +37,8 @@ sub main {
dbh()->commit();
} else {
$out = $q->p(_(<<EOF));
-Thank you for trying to confirm your update or problem. We seem to have a
-problem ourselves though, so <a href="/contact">please let us know what went on</a>
+Thank you for trying to confirm your update or problem. We seem to have an
+error ourselves though, so <a href="/contact">please let us know what went on</a>
and we'll look into it.
EOF
}
@@ -127,26 +127,25 @@ sub confirm_problem {
));
} elsif ($q->{site} eq 'emptyhomes') {
if ($council) {
- $out = $q->p('Thank you for reporting an empty property on
+ $out = $q->p(_('Thank you for reporting an empty property on
ReportEmptyHomes.com. We have emailed the empty property officer in the council
responsible with the details and asked them to do whatever they can to get the
-empty property back into use as soon as possible.') .
-$q->p('Most councils are quite good at bringing empty properties back into use. Even
+empty property back into use as soon as possible.')) .
+$q->p(_('Most councils are quite good at bringing empty properties back into use. Even
so the process can sometimes be slow, especially if the property is in very poor
repair or the owner is unwilling to act. In most cases it takes six months
before you can expect to see anything change. This doesn&rsquo;t mean the council
isn&rsquo;t doing anything. We encourage councils to update the website so you can
-see what is happening.') .
-$q->p('We will contact you again in a month and again after six months to ask what has
+see what is happening.')) .
+$q->p(_('We will contact you again in a month and again after six months to ask what has
happened. Hopefully the property will be well on the way to being brought back
-into use by then, but if not we can offer advice on what you can do next.') .
-$q->p('Thank you for using ReportEmptyHomes.com. Your action is already helping
-to resolve the UK&rsquo;s empty homes crisis.') .
-$q->p('<a href="/report/' . $id . '">View your report</a>.');
+into use by then, but if not we can offer advice on what you can do next.')) .
+$q->p(_('Thank you for using ReportEmptyHomes.com. Your action is already helping
+to resolve the UK&rsquo;s empty homes crisis.')) .
+$q->p('<a href="/report/' . $id . '">' . _('View your report') . '</a>.');
} else {
- $out = $q->p('Thank you for reporting an empty property on
-ReportEmptyHomes.com.') .
-$q->p('<a href="/report/' . $id . '">View your report</a>.');
+ $out = $q->p(_('Thank you for reporting an empty property on ReportEmptyHomes.com.')) .
+$q->p('<a href="/report/' . $id . '">' . _('View your report') . '</a>.');
}
} else {
$out = $q->p({class => 'confirmed'},
@@ -166,17 +165,21 @@ $q->p('<a href="/report/' . $id . '">View your report</a>.');
sub ask_questionnaire {
my ($token) = @_;
+ my $qn_thanks = _("Thanks, glad to hear it's been fixed! Could we just ask if you have ever reported a problem to a council before?");
+ my $yes = _('Yes');
+ my $no = _('No');
+ my $go = _('Go');
my $out = <<EOF;
<form action="/confirm" method="post" id="questionnaire">
<input type="hidden" name="type" value="questionnaire">
<input type="hidden" name="token" value="$token">
-<p>Thanks, glad to hear it's been fixed! Could we just ask if you have ever reported a problem to a council before?</p>
+<p>$qn_thanks</p>
<p align="center">
<input type="radio" name="reported" id="reported_yes" value="Yes">
-<label for="reported_yes">Yes</label>
+<label for="reported_yes">$yes</label>
<input type="radio" name="reported" id="reported_no" value="No">
-<label for="reported_no">No</label>
-<input type="submit" value="Go">
+<label for="reported_no">$no</label>
+<input type="submit" value="$go">
</p>
</form>
EOF
@@ -202,7 +205,7 @@ sub add_questionnaire {
ever_reported, old_state, new_state) values (?, ms_current_timestamp(),
ms_current_timestamp(), ?, 'confirmed', 'fixed');", {}, $problem_id, $reported)
unless $already;
- my $out = $q->p({class => 'confirmed'}, sprintf('Thank you &mdash; you can <a href="%s">view your updated problem</a> on the site.', "/report/$problem_id"));
+ my $out = $q->p({class => 'confirmed'}, sprintf(_('Thank you &mdash; you can <a href="%s">view your updated problem</a> on the site.'), "/report/$problem_id"));
$out .= CrossSell::display_advert($q, $email, $name);
return $out;
}
diff --git a/web/contact.cgi b/web/contact.cgi
index da3055b28..29e929516 100755
--- a/web/contact.cgi
+++ b/web/contact.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: contact.cgi,v 1.38 2009-02-02 10:59:16 matthew Exp $
+# $Id: contact.cgi,v 1.39 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -111,9 +111,9 @@ sub contact_page {
);
$out .= '<input type="hidden" name="id" value="' . $id . '">';
} elsif ($q->{site} eq 'emptyhomes') {
- $out .= $q->p('We&rsquo;d love to hear what you think about this
+ $out .= $q->p(_('We&rsquo;d love to hear what you think about this
website. Just fill in the form. Please don&rsquo;t contact us about individual empty
-homes; use the box accessed from <a href="/">the front page</a>.');
+homes; use the box accessed from <a href="/">the front page</a>.'));
} else {
my $mailto = mySociety::Config::get('CONTACT_EMAIL');
$mailto =~ s/\@/&#64;/;
diff --git a/web/faq.cgi b/web/faq.cgi
index f363cdef6..f2c1db867 100755
--- a/web/faq.cgi
+++ b/web/faq.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: faq.cgi,v 1.39 2009-03-21 00:40:26 matthew Exp $
+# $Id: faq.cgi,v 1.40 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard -db;
@@ -17,237 +17,11 @@ sub main {
my $q = shift;
print Page::header($q, title=>_('Frequently Asked Questions'));
if ($q->{site} eq 'emptyhomes') {
- print emptyhomes_faq($q);
+ print File::Slurp::read_file("$FindBin::Bin/../templates/website/faq-eha.html");
} else {
- print faq($q);
+ print File::Slurp::read_file("$FindBin::Bin/../templates/website/faq.html");
}
print Page::footer($q);
}
Page::do_fastcgi(\&main, $lastmodified);
-sub faq {
- my $q = shift;
- my $out = $q->h1(_('Frequently Asked Questions'));
- $out .= $q->dl(
- $q->dt(_('What is FixMyStreet for?')),
- $q->dd(_('FixMyStreet is a site to help people report, view,
-or discuss local problems they&rsquo;ve found to their local council by
-simply locating them on a map. It launched in early February
-2007.')),
- $q->dt(_('Can you give me some examples?')),
- $q->dd(_('Sure. Graffiti, unlit lampposts, abandoned beds, broken
-glass on a cycle path; anything like that that could be usefully reported to
-your council to be fixed.')),
- $q->dt(_('How do I use the site?')),
- $q->dd(_('After entering a postcode or location, you are presented
-with a map of that area. You can view problems already reported in that area,
-or report ones of your own simply by clicking on the map at the location of
-the problem.')),
- $q->dt(_('How are the problems solved?')),
- $q->dd(_('They are reported to the relevant council by email. The
-council can then resolve the problem the way they normally would.
-Alternatively, you can discuss the problem on the website with others, and
-then together lobby the council to fix it, or fix it directly yourselves.')),
- $q->dt(_('Is it free?')),
- $q->dd(_('The site is free to use, yes. FixMyStreet is run
-by a registered charity, though, so if you want to make a contribution, <a
-href="https://secure.mysociety.org/donate/">please do</a>.')),
- );
- $out .= $q->h2(_('Practical Questions'));
- $out .= $q->dl(
- $q->dt(_("I'm from a council, where do you send the reports?")),
- $q->dd(_('You can either leave a test report or <a href="/contact">contact us</a>
-to find out where reports go at the moment. Also <a href="/contact">contact us</a>
-to update the address or addresses we use.')),
- $q->dt(_('Do you remove silly or illegal content?')),
- $q->dd(_('FixMyStreet is not responsible for the content and accuracy
-of material submitted by its users. All reports are accepted on the basis that
-they contain no illegal content, and we reserve the right to remove any
-problems or updates which we consider to be inappropriate upon being informed
-by a user of the site.')),
- $q->dt(_("Why doesn't dragging the map work on reporting-a-problem pages in Safari or Konqueror?")),
- $q->dd(_("There's a bug in these two browsers to do with setting images on form
-submit buttons, which the map uses when reporting a problem. It's fixed in the
-latest nightly build of Safari, so will presumably be fixed in the next
-release. Until then, I've sadly had to disable dragging to avoid people
-dragging an empty square.")),
- $q->dt(_('Do you have any publicity material?')),
- $q->dd(_('Sure, we have a whole <a href="posters/">array of posters, flyers and badges</a>.')),
- );
- $out .= $q->h2(_('Privacy Questions'));
- $out .= $q->dl(
- $q->dt(_('Who gets to see my email address?')),
- $q->dd(_('If you submit a problem, we pass on your details, and details
-of the problem, to the council contact or contacts responsible for the
-area where you located the problem. Your name is displayed upon the
-site if you let us, but not your email address; similarly with updates. We will
-never give or sell your email address to anyone else, unless we are
-obliged to by law.')),
- $q->dt(_('Will you send nasty, brutish spam to my email address?')),
- $q->dd(_('Never. We will email you if someone leaves an update on a
-problem you&rsquo;ve reported, and send you a questionnaire email four weeks
-after you submit a problem, asking for a status update; we&rsquo;ll only ever
-send you emails in relation to your problem.'))
- );
- $out .= $q->h2(_('Organisation Questions'));
- $out .= $q->dl(
- $q->dt(_('Who built FixMyStreet?')),
- $q->dd(_('This site was built by <a href="http://www.mysociety.org/">mySociety</a>, in conjunction with the <a href="http://www.youngfoundation.org.uk/">Young Foundation</a>.
-mySociety is the project of a registered charity which has grown out of the community of
-volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou.com</a>.
-mySociety&rsquo;s primary mission is to build Internet projects which give people simple, tangible
-benefits in the civic and community aspects of their lives. Our first project
-was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your
-elected representatives, for free.')),
- $q->dt('<img src="/i/moj.png" align="right" alt="Ministry of Justice" hspace="10">' .
- _('Who pays for it?')),
- $q->dd(_('FixMyStreet was paid for via the Department for
-Constitutional Affairs Innovations Fund.')),
- $q->dt(_('<a name="nfi"></a>Wasn\'t this site called Neighbourhood Fix-It?')),
- $q->dd(_('Yes, we changed the name mid June 2007. We decided
-Neighbourhood Fix-It was a bit of a mouthful, hard to spell, and hard to publicise (does the URL have a dash in it or not?). The domain FixMyStreet became available recently, and everyone liked the name.')),
- $q->dt(_('Do you need any help with the project?')),
- $q->dd(_('Yes, we can use help in all sorts of ways, technical or
-non-technical. Please see our <a
-href="http://www.mysociety.org/volunteertasks">volunteers page</a>.')),
- $q->dt(_('Where&rsquo;s the "source code" to this site?')),
- $q->dd(_('The software behind this site is open source, and available
-to you mainly under the GNU Affero GPL software license. You can <a
-href="https://secure.mysociety.org/cvstrac/dir?d=mysociety">download the
-source code</a> (look under &lsquo;bci&rsquo;) and help us develop it.
-You&rsquo;re welcome to use it in your own projects, although you must also
-make available the source code to any such projects.')),
- $q->dt(_('People build things, not organisations. Who <em>actually</em> built it?')),
- $q->dd(_('Matthew Somerville and Francis Irving wrote the site,
-Chris Lightfoot wrote the tileserver and map cutter, Richard Pope created
-our pins, Deborah Kerr keeps things up-to-date and does user support,
-Ayesha Garrett designed our posters, and Tom Steinberg managed it all.
-
-Thanks also to
-<a href="http://www.ordnancesurvey.co.uk">Ordnance Survey</a> (for the maps,
-UK postcodes, and UK addresses &ndash; data &copy; Crown copyright, all
-rights reserved, Ministry of Justice 100037819&nbsp;2008),
-Yahoo! for their BSD-licensed JavaScript libraries, the entire free software
-community (this particular project was brought to you by Perl, PostgreSQL,
-and the number 161.290) and <a
-href="http://www.easynet.net/publicsector/">Easynet</a> (who kindly host all
-our servers).
-
-Let us know if we&rsquo;ve missed anyone.'))
- );
- return $out;
-}
-
-sub emptyhomes_faq {
- my $q = shift;
- my $out = $q->h1('Frequently Asked Questions');
- $out .= $q->dl(
- $q->dt('What is this site for?'),
- $q->dd('This site is to help make it as easy as possible for you to get
-empty homes in your area put back into use. It allows you, to view empty homes
-that have been reported and see what has been done about them. It makes
-councils accountable for responding and dealing with the empty homes you
-report.'),
- $q->dt('How do I use the site?'),
- $q->dd('Enter a postcode or address in the box on the homepage and you
-are presented with a map of that area. Click where the empty property is, fill
-in the details, upload a photo if you have one and press submit. That&rsquo;s
-it. You can also view other empty properties that have been reported and see
-what has been done about them.'),
- $q->dt('Is it free?'),
- $q->dd('Yes. The costs of developing and running this site have been
-paid for by The Empty Homes Agency and through the generosity of its funders.
-The Empty Homes Agency is a charity, so if you believe in our aims and would
-like to make a contribution, <a href="http://www.emptyhomes.com/donate.html">please do</a>.'),
- $q->dt('Do you remove silly or illegal content?'),
- $q->dd('We reserve the right to remove any reports or updates
-which we consider to be inappropriate.'),
- $q->dt('How do councils bring empty properties back into use?'),
- $q->dd($q->p('All councils in England and Wales have powers to bring empty
-homes back into use. Many are very good at it, some are not. Most councils seek
-to persuade and help the owner to bring their property back into use; they only
-use legal powers such as Empty Dwelling Management Orders when help and
-persuasion have failed.'), $q->p('
-Most empty homes are brought back into use eventually by their owner. But in
-many cases this takes years. Empty homes often decline fast &ndash; they become
-overrun with weeds and attacked by the weather. They are often used by
-squatters, fly tippers, vandals and are sometimes subject to arson. The whole
-neighbourhood suffers waiting for the owner to deal with their property.'), $q->p('
-Councils help and persuade owners to bring their properties into use faster.
-Even so the process can be slow, especially if the property is in very poor
-repair or the owner is unwilling to do anything. In most cases it takes six
-months before you can expect to see anything change, occasionally longer. This
-doesn&rsquo;t mean the council isn&rsquo;t doing anything, which is why we encourage
-councils to update the website so you can see what is happening.'), $q->p('
-We will contact you twice (a month and six months after you report the empty
-home) so you can tell us what has happened. If the council doesn&rsquo;t do anything,
-or you think their response is inadequate we will advise you what you can do
-next.'), $q->p('
-If the empty home is owned by the government or one its agencies, councils are
-often powerless to help. However you might be able to take action directly
-yourself using a PROD:
-<a href="http://www.emptyhomes.com/usefulinformation/policy_docs/prods.html">http://www.emptyhomes.com/usefulinformation/policy_docs/prods.html</a>
-')),
- $q->dt('Will reporting an empty home make any difference?'),
- $q->dd($q->p('Yes. Councils can make a real difference, but they have lots of
-things to do. Many councils only deal with empty homes that are reported to
-them. If people do not report empty homes, councils may well conclude that
-other areas of work are more important.'), $q->p('
-There are over 840,000 empty homes in the UK. The Empty Homes Agency estimates
-that over half of these are unnecessarily empty. The effect of this is to
-significantly reduce the available housing stock fuelling the UK&rsquo;s housing
-crisis. A by-product of this waste is that far greater pressure is put on
-building land as more homes are built to meet the shortfall. The Empty Homes
-Agency estimate that bringing just a quarter of the UK&rsquo;s empty homes into use
-would provide homes for 700,000 people, save 160 square kilometres of land and
-save 10 million tonnes of CO<sub>2</sub> over building the same number of new homes.
-')),
- );
- $out .= $q->h2(_('Privacy Questions'));
- $out .= $q->dl(
- $q->dt('Who gets to see my email address?'),
- $q->dd('If you submit an empty property, your details are obviously provided to us.
-Your name is displayed upon the site if you let us, but not your email address;
-similarly with updates. We will never give or sell your email address to
-anyone else, unless we are obliged to by law.'),
- $q->dt('Will you send nasty, brutish spam to my email address?'),
- $q->dd('Never. We will email you if someone leaves an update on a
-report you&rsquo;ve made, and send you questionnaire emails four weeks and six months
-after you submit a problem, asking for a status update; we&rsquo;ll only ever
-send you emails in relation to your problem.')
- );
- $out .= $q->h2(_('Organisation Questions'));
- $out .= $q->dl(
- $q->dt('Who built this site?'),
- $q->dd('This site was built by <a href="http://www.mysociety.org/">mySociety</a>.
-mySociety is the project of a registered charity which has grown out of the community of
-volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou</a>.
-mySociety&rsquo;s primary mission is to build Internet projects which give people simple, tangible
-benefits in the civic and community aspects of their lives. Our first project
-was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your
-elected representatives, for free.
-<a href="https://secure.mysociety.org/donate/">Donate to mySociety</a>'),
- $q->dt(_('Where&rsquo;s the "source code" to this site?')),
- $q->dd(_('The software behind this site is open source, and available
-to you mainly under the GNU Affero GPL software license. You can <a
-href="https://secure.mysociety.org/cvstrac/dir?d=mysociety">download the
-source code</a> (look under &lsquo;bci&rsquo;) and help us develop it.
-You&rsquo;re welcome to use it in your own projects, although you must also
-make available the source code to any such projects.')),
- $q->dt(_('People build things, not organisations. Who <em>actually</em> built it?')),
- $q->dd(_('This adaptation of <a href="http://www.fixmystreet.com/">Fix&shy;MyStreet</a>
-was written by Matthew Somerville. Thanks go to
-<a href="http://www.ordnancesurvey.co.uk">Ordnance Survey</a> (for the maps,
-UK postcodes, and UK addresses &ndash; data &copy; Crown copyright, all
-rights reserved, Ministry of Justice 100037819&nbsp;2008),
-Yahoo! for their BSD-licensed JavaScript libraries, the entire free software
-community (this particular project was brought to you by Perl, PostgreSQL,
-and the number 161.290) and <a
-href="http://www.easynet.net/publicsector/">Easynet</a> (who kindly host all
-our servers).
-
-Let us know if we&rsquo;ve missed anyone.'))
- );
- return $out;
-}
-
diff --git a/web/index.cgi b/web/index.cgi
index a4d68d4d7..0050983b5 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.253 2009-04-23 11:46:46 matthew Exp $
+# $Id: index.cgi,v 1.254 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -493,7 +493,7 @@ sub display_form {
if ($q->{site} eq 'scambs') {
delete $all_councils->{2218};
- return display_location($q, _('That location is not within the boundary of South Cambridgeshire District Council - you can report problems elsewhere in Great Britain using <a href="http://www.fixmystreet.com/">FixMyStreet</a>.')) unless $all_councils->{2260};
+ return display_location($q, 'That location is not within the boundary of South Cambridgeshire District Council - you can report problems elsewhere in Great Britain using <a href="http://www.fixmystreet.com/">FixMyStreet</a>.') unless $all_councils->{2260};
}
$all_councils = [ keys %$all_councils ];
return display_location($q, _('That spot does not appear to be covered by a council.
@@ -524,7 +524,10 @@ please specify the closest point on land.')) unless @$all_councils;
foreach (@$categories) {
$council_ok{$_->{area_id}} = 1;
}
- @categories = ('-- Pick a property type --', 'Empty house or bungalow', 'Empty flat or maisonette', 'Whole block of empty flats', 'Empty office or other commercial', 'Empty pub or bar', 'Empty public building - school, hospital, etc.');
+ @categories = (_('-- Pick a property type --'), _('Empty house or bungalow'),
+ _('Empty flat or maisonette'), _('Whole block of empty flats'),
+ _('Empty office or other commercial'), _('Empty pub or bar'),
+ _('Empty public building - school, hospital, etc.'));
$category = _('Property type:');
}
$category = $q->div($q->label({'for'=>'form_category'}, $category),
@@ -570,10 +573,9 @@ If this is not the correct location, simply click on the map again. '));
}
if ($details eq 'all') {
- $out .= '<p>All the information you provide here will be sent to <strong>'
- . join('</strong> or <strong>', map { $areas_info->{$_}->{name} } @$all_councils)
- . '</strong>. On the site, we will show the subject and details of the problem,
- plus your name if you give us permission.';
+ $out .= '<p>' . sprintf(_('All the information you provide here will be sent to <strong>%s</strong>.
+On the site, we will show the subject and details of the problem, plus your
+name if you give us permission.'), join('</strong> or <strong>', map { $areas_info->{$_}->{name} } @$all_councils));
$out .= '<input type="hidden" name="council" value="' . join(',',@$all_councils) . '">';
} elsif ($details eq 'some') {
my $e = mySociety::Config::get('CONTACT_EMAIL');
@@ -606,10 +608,10 @@ left on the site, but <strong>not</strong> reported to the council.
You can help us by finding a contact email address for local
problems for $list and emailing it to us at <a href='mailto:$e'>$e</a>.";
} else {
- $out .= "<p>We do not yet have details for the council that covers
+ $out .= _("<p>We do not yet have details for the council that covers
this location. If you submit a report here it will be left on the site, but
not reported to the council &ndash; please still leave your report, so that
-we can show to the council the activity in their area.";
+we can show to the council the activity in their area.");
}
$out .= '<input type="hidden" name="council" value="-1">';
}
@@ -623,7 +625,7 @@ to help unless you leave as much detail as you can, so please describe the exact
the problem (e.g. on a wall), what it is, how long it has been there, a description (and a
photo of the problem if you have one), etc.';
} elsif ($q->{site} eq 'emptyhomes') {
- $out .= $q->p(<<EOF);
+ $out .= $q->p(_(<<EOF));
Please fill in details of the empty property below, saying what type of
property it is e.g. an empty home, block of flats, office etc. Tell us
something about its condition and any other information you feel is relevant.
@@ -648,17 +650,26 @@ photo of the problem if you have one), etc.';
}
my $anon = ($input{anonymous}) ? ' checked' : ($input{title} ? '' : ' checked');
$out .= '<div id="problem_form">';
- $out .= $q->h2('Empty property details form') if $q->{site} eq 'emptyhomes';
+ $out .= $q->h2(_('Empty property details form')) if $q->{site} eq 'emptyhomes';
$out .= <<EOF;
<div id="fieldset">
$category
EOF
+ my $subject_label = _('Subject:');
+ my $detail_label = _('Details:');
+ my $photo_label = _('Photo:');
+ my $name_label = _('Name:');
+ my $email_label = _('Email:');
+ my $phone_label = _('Phone:');
+ my $optional = _('(optional)');
+ my $anonymous = _('Can we show your name on the site?');
+ my $anonymous2 = _('(we never show your email address or phone number)');
$out .= <<EOF;
-<div><label for="form_title">Subject:</label>
+<div><label for="form_title">$subject_label</label>
<input type="text" value="$input_h{title}" name="title" id="form_title" size="30"></div>
EOF
$out .= <<EOF;
-<div><label for="form_detail">Details:</label>
+<div><label for="form_detail">$detail_label</label>
<textarea name="detail" id="form_detail" rows="7" cols="26">$input_h{detail}</textarea></div>
EOF
my $partial_id;
@@ -679,22 +690,22 @@ EOF
<input type="hidden" name="upload_fileid" id="upload_fileid" value="$input_h{upload_fileid}">
</div>
<div id="fileupload_normalUI">
-<label for="form_photo">Photo:</label>
+<label for="form_photo">$photo_label</label>
<input type="file" name="photo" id="form_photo">
</div>
EOF
}
$out .= <<EOF;
-<div><label for="form_name">Name:</label>
+<div><label for="form_name">$name_label</label>
<input type="text" value="$input_h{name}" name="name" id="form_name" size="30"></div>
<div class="checkbox"><input type="checkbox" name="anonymous" id="form_anonymous" value="1"$anon>
-<label for="form_anonymous">Can we show your name on the site?</label>
-<small>(we never show your email address or phone number)</small></div>
-<div><label for="form_email">Email:</label>
+<label for="form_anonymous">$anonymous</label>
+<small>$anonymous2</small></div>
+<div><label for="form_email">$email_label</label>
<input type="text" value="$input_h{email}" name="email" id="form_email" size="30"></div>
-<div><label for="form_phone">Phone:</label>
+<div><label for="form_phone">$phone_label</label>
<input type="text" value="$input_h{phone}" name="phone" id="form_phone" size="15">
-<small>(optional)</small></div>
+<small>$optional</small></div>
EOF
if ($q->{site} eq 'scambs') {
$out .= <<EOF;
@@ -721,8 +732,9 @@ directly using their own website.
</ul>
EOF
}
+ my $submit_button = _('Submit');
$out .= <<EOF;
-<p id="problem_submit"><input type="submit" name="submit_problem" value="Submit"></p>
+<p id="problem_submit"><input type="submit" name="submit_problem" value="$submit_button"></p>
</div>
</div>
EOF
@@ -767,20 +779,20 @@ sub display_location {
my ($hide_link, $hide_text, $all_link, $all_text, $interval);
if ($input{all_pins}) {
$all_link = NewURL($q, -retain=>1, no_pins=>undef, all_pins=>undef);
- $all_text = 'Hide stale reports';
+ $all_text = _('Hide stale reports');
} else {
$all_link = NewURL($q, -retain=>1, no_pins=>undef, all_pins=>1);
- $all_text = 'Include stale reports';
+ $all_text = _('Include stale reports');
$interval = '6 months';
}
my ($pins, $on_map, $around_map, $dist) = Page::map_pins($q, $x, $y, $x, $y, $interval);
if ($input{no_pins}) {
$hide_link = NewURL($q, -retain=>1, no_pins=>undef);
- $hide_text = 'Show pins';
+ $hide_text = _('Show pins');
$pins = '';
} else {
$hide_link = NewURL($q, -retain=>1, no_pins=>1);
- $hide_text = 'Hide pins';
+ $hide_text = _('Hide pins');
}
my $map_links = "<p style='float:right; margin-top:0;'><a id='hide_pins_link' href='$hide_link'>$hide_text</a> | <a id='all_pins_link' href='$all_link'>$all_text</a></p> <input type='hidden' id='all_pins' name='all_pins' value='$input_h{all_pins}'>";
@@ -812,7 +824,7 @@ EOF
$list .= '<li><a href="/report/' . $_->{id} . '">';
$list .= $_->{title};
$list .= '</a>';
- $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed';
+ $list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
$list = $q->li(_('No problems have been reported yet.'))
@@ -824,7 +836,7 @@ EOF
$list .= '<li><a href="/report/' . $_->{id} . '">';
$list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>';
$list .= '</a>';
- $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed';
+ $list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$list .= '</li>';
}
$list = $q->li(_('No problems found.'))
@@ -865,10 +877,10 @@ sub display_problem {
}
# Get all information from database
- return display_location($q, 'Unknown problem ID') if $input{id} =~ /\D/;
+ return display_location($q, _('Unknown problem ID')) if $input{id} =~ /\D/;
my $problem = Problems::fetch_problem($input{id});
- return display_location($q, 'Unknown problem ID') unless $problem;
- return front_page($q, 'That problem has been hidden from public view as it contained inappropriate public details') if $problem->{state} eq 'hidden';
+ return display_location($q, _('Unknown problem ID')) unless $problem;
+ return front_page($q, _('That problem has been hidden from public view as it contained inappropriate public details')) if $problem->{state} eq 'hidden';
my ($x, $y, $x_tile, $y_tile, $px, $py) = Page::os_to_px_with_adjust($q, $problem->{easting}, $problem->{northing}, $input{x}, $input{y});
# Try and have pin near centre of map
@@ -903,14 +915,17 @@ sub display_problem {
. $back . '">' . _('More problems nearby') . '</a></p>';
$out .= '<div id="alert_links">';
$out .= '<a rel="nofollow" id="email_alert" href="/alert?type=updates;id='.$input_h{id}.'">' . _('Email me updates') . '</a>';
+ my $email_label = _('Email:');
+ my $subscribe = _('Subscribe');
+ my $blurb = _('Receive email when updates are left on this problem');
$out .= <<EOF;
<form action="/alert" method="post" id="email_alert_box">
-<p>Receive email when updates are left on this problem</p>
-<label class="n" for="alert_rznvy">Email:</label>
+<p>$blurb</p>
+<label class="n" for="alert_rznvy">$email_label</label>
<input type="text" name="rznvy" id="alert_rznvy" value="$input_h{rznvy}" size="30">
<input type="hidden" name="id" value="$input_h{id}">
<input type="hidden" name="type" value="updates">
-<input type="submit" value="Subscribe">
+<input type="submit" value="$subscribe">
</form>
EOF
$out .= ' &nbsp; <a href="/rss/'.$input_h{id}.'"><img src="/i/feed.png" width="16" height="16" title="' . _('RSS feed') . '" alt="' . _('RSS feed of updates to this problem') . '" border="0" style="vertical-align: middle"></a>';
@@ -931,15 +946,20 @@ EOF
<div class="checkbox"><input type="checkbox" name="fixed" id="form_fixed" value="1"$fixed>
<label for="form_fixed">} . _('This problem has been fixed') . qq{</label></div>
};
+ my $name_label = _('Name:');
+ my $update_label = _('Update:');
+ my $photo_label = _('Photo:');
+ my $alert_label = _('Alert me to future updates');
+ my $post_label = _('Post');
$out .= <<EOF;
<form method="post" action="/" id="fieldset" enctype="multipart/form-data">
<input type="hidden" name="submit_update" value="1">
<input type="hidden" name="id" value="$input_h{id}">
-<div><label for="form_name">Name:</label>
+<div><label for="form_name">$name_label</label>
<input type="text" name="name" id="form_name" value="$input_h{name}" size="20"> (optional)</div>
-<div><label for="form_rznvy">Email:</label>
+<div><label for="form_rznvy">$email_label</label>
<input type="text" name="rznvy" id="form_rznvy" value="$input_h{rznvy}" size="20"></div>
-<div><label for="form_update">Update:</label>
+<div><label for="form_update">$update_label</label>
<textarea name="update" id="form_update" rows="7" cols="30">$input_h{update}</textarea></div>
$fixedline
<div id="fileupload_flashUI" style="display:none">
@@ -949,12 +969,12 @@ $fixedline
<input type="hidden" name="upload_fileid" id="upload_fileid" value="$input_h{upload_fileid}">
</div>
<div id="fileupload_normalUI">
-<label for="form_photo">Photo:</label>
+<label for="form_photo">$photo_label</label>
<input type="file" name="photo" id="form_photo">
</div>
<div class="checkbox"><input type="checkbox" name="add_alert" id="form_add_alert" value="1"$add_alert_checked>
-<label for="form_add_alert">Alert me to future updates</label></div>
-<div class="checkbox"><input type="submit" id="update_post" value="Post"></div>
+<label for="form_add_alert">$alert_label</label></div>
+<div class="checkbox"><input type="submit" id="update_post" value="$post_label"></div>
</form>
</div>
EOF
diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi
index 8c74f5e0f..fae205020 100755
--- a/web/questionnaire.cgi
+++ b/web/questionnaire.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: questionnaire.cgi,v 1.37 2008-12-12 00:00:18 matthew Exp $
+# $Id: questionnaire.cgi,v 1.38 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -35,17 +35,17 @@ sub check_stuff {
my $q = shift;
my $id = mySociety::AuthToken::retrieve('questionnaire', $q->param('token'));
- throw Error::Simple("I'm afraid we couldn't validate that token. If you've copied the URL from an email, please check that you copied it exactly.\n") unless $id;
+ throw Error::Simple(_("I'm afraid we couldn't validate that token. If you've copied the URL from an email, please check that you copied it exactly.\n")) unless $id;
my $questionnaire = dbh()->selectrow_hashref(
'select id, problem_id, whenanswered from questionnaire where id=?', {}, $id);
my $problem_id = $questionnaire->{problem_id};
- throw Error::Simple("You have already answered this questionnaire. If you have a question, please <a href='/contact'>get in touch</a>, or <a href='/report/$problem_id'>view your problem</a>.\n") if $questionnaire->{whenanswered};
+ throw Error::Simple(sprintf(_("You have already answered this questionnaire. If you have a question, please <a href='/contact'>get in touch</a>, or <a href='%s'>view your problem</a>.\n"), "/report/$problem_id")) if $questionnaire->{whenanswered};
my $problem = dbh()->selectrow_hashref(
"select *, extract(epoch from confirmed) as time, extract(epoch from whensent-confirmed) as whensent
from problem where id=? and state in ('confirmed','fixed')", {}, $problem_id);
- throw Error::Simple("I'm afraid we couldn't locate your problem in the database.\n") unless $problem;
+ throw Error::Simple(_("I'm afraid we couldn't locate your problem in the database.\n")) unless $problem;
my $num_questionnaire = dbh()->selectrow_array(
'select count(*) from questionnaire where problem_id=?', {}, $problem_id);
@@ -76,11 +76,11 @@ sub submit_questionnaire {
}
my @errors;
- push @errors, 'Please state whether or not the problem has been fixed' unless $input{been_fixed};
+ push @errors, _('Please state whether or not the problem has been fixed') unless $input{been_fixed};
push @errors, _('Please say whether you\'ve ever reported a problem to your council before') unless $input{reported} || $answered_ever_reported;
- push @errors, 'Please indicate whether you\'d like to receive another questionnaire'
+ push @errors, _('Please indicate whether you\'d like to receive another questionnaire')
if ($input{been_fixed} eq 'No' || $input{been_fixed} eq 'Unknown') && !$input{another};
- push @errors, 'Please provide some explanation as to why you\'re reopening this report'
+ push @errors, _('Please provide some explanation as to why you\'re reopening this report')
if $input{been_fixed} eq 'No' && $problem->{state} eq 'fixed' && !$input{update};
return display_questionnaire($q, @errors) if @errors;
@@ -96,7 +96,7 @@ sub submit_questionnaire {
push(@errors, "That image doesn't appear to have uploaded correctly ($e), please try again.");
};
}
- push @errors, 'Please provide some text as well as a photo'
+ push @errors, _('Please provide some text as well as a photo')
if $image && !$input{update};
return display_questionnaire($q, @errors) if @errors;
@@ -127,7 +127,7 @@ sub submit_questionnaire {
# Record an update if they've given one, or if there's a state change
my $name = $problem->{anonymous} ? undef : $problem->{name};
- my $update = $input{update} ? $input{update} : 'Questionnaire filled in by problem reporter';
+ my $update = $input{update} ? $input{update} : _('Questionnaire filled in by problem reporter');
Utils::workaround_pg_bytea("insert into comment
(problem_id, name, email, website, text, state, mark_fixed, mark_open, photo)
values (?, ?, ?, '', ?, 'confirmed', ?, ?, ?)", 7,
@@ -144,13 +144,13 @@ sub submit_questionnaire {
my $out;
if ($input{been_fixed} eq 'Unknown') {
- $out = <<EOF;
+ $out = _(<<EOF);
<p>Thank you very much for filling in our questionnaire; if you
get some more information about the status of your problem, please come back to the
site and leave an update.</p>
EOF
} elsif ($new_state eq 'confirmed' || (!$new_state && $problem->{state} eq 'confirmed')) {
- return <<EOF;
+ return _(<<EOF);
<p style="font-size:150%">We're sorry to hear that. We have two suggestions: why not try
<a href="http://www.writetothem.com/">writing direct to your councillor(s)</a>
or, if it's a problem that could be fixed by local people working together,
@@ -158,7 +158,7 @@ why not <a href="http://www.pledgebank.com/new">make and publicise a pledge</a>?
</p>
EOF
} else {
- $out = <<EOF;
+ $out = _(<<EOF);
<p style="font-size:150%">Thank you very much for filling in our questionnaire; glad to hear it's been fixed.</p>
EOF
}
@@ -203,14 +203,14 @@ sub display_questionnaire {
yes => $input{another} eq 'Yes' ? ' checked' : '',
no => $input{another} eq 'No' ? ' checked' : '',
);
+ $out .= '<h1>' . _('Questionnaire') . '</h1>';
$out .= <<EOF;
-<h1>Questionnaire</h1>
<form method="post" action="/questionnaire" id="questionnaire" enctype="multipart/form-data">
<input type="hidden" name="token" value="$input_h{token}">
EOF
if ($q->{site} eq 'emptyhomes') {
if ($num_questionnaire==1) {
- $out .= <<EOF;
+ $out .= _(<<EOF);
<p>Getting empty homes back into use can be difficult. You shouldn't expect
the property to be back into use yet. But a good council will have started work
and should have reported what they have done on the website. If you are not
@@ -220,7 +220,7 @@ to help. For advice on how to do this and other useful information please
go to <a href="http://www.emptyhomes.com/getinvolved/campaign.html">http://www.emptyhomes.com/getinvolved/campaign.html</a>.</p>
EOF
} else {
- $out .= <<EOF;
+ $out .= _(<<EOF);
<p>Getting empty homes back into use can be difficult, but by now a good council
will have made a lot of progress and reported what they have done on the
website. Even so properties can remain empty for many months if the owner is
@@ -234,33 +234,38 @@ EOF
}
}
- $out .= '<p>The details of your problem are available on the right hand side of this page.';
- $out .= ' Please take a look at the updates that have been left.' if $updates;
+ $out .= '<p>' . _('The details of your problem are available on the right hand side of this page.');
+ $out .= ' ' . _('Please take a look at the updates that have been left.') if $updates;
$out .= '</p>';
if (@errors) {
$out .= '<ul id="error"><li>' . join('</li><li>', @errors) . '</li></ul>';
}
$out .= '<p>';
- $out .= 'An update marked this problem as fixed. ' if $problem->{state} eq 'fixed';
+ $out .= _('An update marked this problem as fixed.') . ' ' if $problem->{state} eq 'fixed';
$out .= _('Has this problem been fixed?') . '</p>';
+ my $yes = _('Yes');
+ my $no = _('No');
+ my $dontknow = _('Don&rsquo;t know');
$out .= <<EOF;
<p>
<input type="radio" name="been_fixed" id="been_fixed_yes" value="Yes"$been_fixed{yes}>
-<label for="been_fixed_yes">Yes</label>
+<label for="been_fixed_yes">$yes</label>
<input type="radio" name="been_fixed" id="been_fixed_no" value="No"$been_fixed{no}>
-<label for="been_fixed_no">No</label>
+<label for="been_fixed_no">$no</label>
<input type="radio" name="been_fixed" id="been_fixed_unknown" value="Unknown"$been_fixed{unknown}>
-<label for="been_fixed_unknown">Don&rsquo;t know</label>
+<label for="been_fixed_unknown">$dontknow</label>
</p>
EOF
$out .= $q->p(_('Have you ever reported a problem to a council before, or is this your first time?'))
unless $answered_ever_reported;
+ my $before = _('Reported before');
+ my $first = _('First time');
$out .= <<EOF unless $answered_ever_reported;
<p>
<input type="radio" name="reported" id="reported_yes" value="Yes"$reported{yes}>
-<label for="reported_yes">Reported before</label>
+<label for="reported_yes">$before</label>
<input type="radio" name="reported" id="reported_no" value="No"$reported{no}>
-<label for="reported_no">First time</label>
+<label for="reported_no">$first</label>
</p>
EOF
$out .= $q->p(_('If you wish to leave a public update on the problem, please enter it here
@@ -291,10 +296,7 @@ EOF
</p>
</div>
EOF
- $out .= <<EOF;
-<p><input type="submit" name="submit" value="Submit questionnaire"></p>
-</form>
-EOF
+ $out .= '<p><input type="submit" name="submit" value="' . _('Submit questionnaire') . '"></p> </form>';
$out .= Page::display_map_end(0);
return $out;
}
diff --git a/web/reports.cgi b/web/reports.cgi
index 3685a69f2..d6bcde6ad 100755
--- a/web/reports.cgi
+++ b/web/reports.cgi
@@ -7,7 +7,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: reports.cgi,v 1.28 2009-04-01 18:42:02 matthew Exp $
+# $Id: reports.cgi,v 1.29 2009-05-27 13:53:53 matthew Exp $
use strict;
use Standard;
@@ -164,7 +164,7 @@ sub main {
print '<table cellpadding="3" cellspacing="1" border="0">';
print '<tr><th>' . _('Name') . '</th><th>' . _('New problems') . '</th><th>' . _('Older problems') . '</th>';
if ($q->{site} eq 'emptyhomes') {
- print '<th>Recently returned to use</th><th>Older returned to use</th></tr>';
+ print '<th>' . _('Recently returned to use') . '</th><th>' . _('Older returned to use') . '</th></tr>';
} else {
print '<th>' . _('Old problems,<br>state unknown') . '</th><th>'
. _('Recently fixed') . '</th><th>' . _('Old fixed') . '</th></tr>';
@@ -198,7 +198,7 @@ sub main {
} else {
my $name = $areas_info->{$one_council}->{name};
if (!$name) {
- print Page::header($q, title=>"Summary reports");
+ print Page::header($q, title=>_("Summary reports"));
print "Council with identifier " . ent($one_council). " not found. ";
print $q->a({href => '/reports' }, 'Show all councils');
print ".";
@@ -210,19 +210,22 @@ sub main {
$thing = 'ward';
$name = ent($q_ward) . ", $name";
}
- print Page::header($q, title=>"$name - Summary reports", rss => [ "Problems within $name, FixMyStreet", $rss_url ]);
+ print Page::header($q, title=>sprintf(_('%s - Summary reports'), $name), rss => [ sprintf(_('Problems within %s, FixMyStreet'), $name), $rss_url ]);
my $rss_title = _('RSS feed');
my $rss_alt = _('RSS feed of problems in this %s');
+ my $summary_line;
+ if ($all && $q->{site} eq 'scambs') {
+ $summary_line = sprintf(_('You can <a href="%s">see less detail</a>.'), NewURL($q));
+ } elsif ($q->{site} eq 'scambs') {
+ $summary_line = sprintf(_('You can <a href="%s">see more details</a>.'), NewURL($q, all=>1));
+ } elsif ($all) {
+ $summary_line = sprintf(_('You can <a href="%s">see less detail</a> or go back and <a href="/reports">show all councils</a>.'), NewURL($q));
+ } else {
+ $summary_line = sprintf(_('You can <a href="%s">see more details</a> or go back and <a href="/reports">show all councils</a>.'), NewURL($q, all=>1));
+ }
print $q->p(
$q->a({ href => $rss_url }, '<img align="right" src="/i/feed.png" width="16" height="16" title="' . $rss_title . '" alt="' . sprintf($rss_alt, $thing) . '" border="0" hspace="4">'),
- 'This is a summary of all reports for one ' . $thing . '. You can ' .
- ($all ?
- $q->a({href => NewURL($q) }, 'see less detail') :
- $q->a({href => NewURL($q, all=>1) }, 'see more details')) .
- ($q->{site} eq 'scambs' ? '' :
- ' or go back and ' .
- $q->a({href => '/reports' }, 'show all councils') ) .
- '.');
+ sprintf(_('This is a summary of all reports for one %s.'), $thing) . ' ' . $summary_line);
print "<h2>$name</h2>\n";
if ($open{$one_council}) {
print '<div id="col_problems">';
@@ -231,7 +234,7 @@ sub main {
my @old = ();
push @old, @{$open{$one_council}{older}} if $open{$one_council}{older};
push @old, @{$open{$one_council}{unknown}} if $open{$one_council}{unknown};
- list_problems($q, 'Older empty properties', \@old, $all);
+ list_problems($q, _('Older empty properties'), \@old, $all);
} else {
list_problems($q, _('Older problems'), $open{$one_council}{older}, $all);
list_problems($q, _('Old problems, state unknown'), $open{$one_council}{unknown}, $all);