[NUUG fiksgatami] [patch] More strings to translate in fixmystreet

Petter Reinholdtsen pere at hungry.com
Thu Feb 5 18:23:57 CET 2009


I have found a few more strings to translate in fixmystreet.  I also
made a string simpler (no need to escape ") by replacing " with ', and
replaced a "doesn't" with "does not" to make it possible to use ' as
the string delimiter and make the text easier to translate.  Please
apply to the CVS source.  Please also update the FixMyStreet.po file
with the new strings.

Index: bci/perllib/Page.pm
===================================================================
RCS file: /repos/mysociety/bci/perllib/Page.pm,v
retrieving revision 1.137
diff -u -3 -p -r1.137 Page.pm
--- bci/perllib/Page.pm	2 Feb 2009 10:59:15 -0000	1.137
+++ bci/perllib/Page.pm	5 Feb 2009 17:16:06 -0000
@@ -74,7 +74,7 @@ sub report_error {
     warn "aborting";
     ent($msg);
     my $contact_email = mySociety::Config::get('CONTACT_EMAIL');
-    my $trylater = sprintf(_("Please try again later, or <a href=\"mailto:%s\">email us</a> to let us know."), $contact_email);
+    my $trylater = sprintf(_('Please try again later, or <a href="mailto:%s">email us</a> to let us know.'), $contact_email);
     my $somethingwrong = _("Sorry! Something's gone wrong.");
     my $errortext = _("The text of the error was:");
     print "Status: 500\nContent-Type: text/html; charset=iso-8859-1\n\n",
@@ -608,7 +608,7 @@ sub display_problem_text {
                 prettify_duration($problem->{whensent}, 'minute') . ' later');
         }
     } else {
-        $out .= $q->br() . $q->small('Not reported to council');
+        $out .= $q->br() . $q->small(_('Not reported to council'));
     }
     $out .= '</em></p>';
     my $detail = $problem->{detail};
@@ -754,7 +754,7 @@ sub geocode_string {
                 $y -= 1 if ($yy - $y < 0.5);
             } catch Error::Simple with {
                 $error = shift;
-                $error = "That location doesn't appear to be in Britain; please try again."
+                $error = _('That location does not appear to be in Britain; please try again.')
                     if $error =~ /out of the area covered/;
             }
         }
@@ -766,7 +766,7 @@ sub geocode_string {
 # Prints response if there's more than one possible result
 sub geocode_choice {
     my ($choices, $page) = @_;
-    my $out = '<p>We found more than one match for that location. We show up to ten matches, please try a different search if yours is not here.</p> <ul>';
+    my $out = '<p>' . _('We found more than one match for that location. We show up to ten matches, please try a different search if yours is not here.') . '</p> <ul>';
     foreach my $choice (@$choices) {
         $choice =~ s/, United Kingdom//;
         $choice =~ s/, UK//;
@@ -797,7 +797,7 @@ sub check_photo {
     my $cd = $q->uploadInfo($fh)->{'Content-Disposition'};
     # Must delete photo param, otherwise display functions get confused
     $q->delete('photo');
-    return 'Please upload a JPEG image only' unless
+    return _('Please upload a JPEG image only') unless
         ($ct eq 'image/jpeg' || $ct eq 'image/pjpeg');
     return '';
 }
Index: bci/web/reports.cgi
===================================================================
RCS file: /repos/mysociety/bci/web/reports.cgi,v
retrieving revision 1.24
diff -u -3 -p -r1.24 reports.cgi
--- bci/web/reports.cgi	8 Dec 2008 10:54:16 -0000	1.24
+++ bci/web/reports.cgi	5 Feb 2009 17:16:06 -0000
@@ -159,11 +159,12 @@ sub main {
         print $q->p(_('This is a summary of all reports on this site; select a particular council to see the reports sent there.'));
         my $c = 0;
         print '<table cellpadding="3" cellspacing="1" border="0">';
-        print '<tr><th>Name</th><th>' . _('New problems') . '</th><th>' . _('Older problems') . '</th>';
+        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>';
         } else {
-            print '<th>Old problems,<br>state unknown</th><th>Recently fixed</th><th>Old fixed</th></tr>';
+            print '<th>' . _('Old problems,<br>state unknown') . '</th><th>'
+                . _('Recently fixed') . '</th><th>' . _('Old fixed') . '</th></tr>';
         }
         foreach (sort { $areas_info->{$a}->{name} cmp $areas_info->{$b}->{name} } keys %councils) {
             print '<tr align="center"';

While reading the source, I found a typo in a comment.  This patch
solve it:

Index: services/MaPit/MaPit.pm
===================================================================
RCS file: /repos/mysociety/services/MaPit/MaPit.pm,v
retrieving revision 1.73
diff -u -3 -p -r1.73 MaPit.pm
--- services/MaPit/MaPit.pm	28 Jan 2008 17:37:38 -0000	1.73
+++ services/MaPit/MaPit.pm	5 Feb 2009 17:16:09 -0000
@@ -392,7 +392,7 @@ If POLYGON_TYPE is present, then the has
 This is an array of parts. Each part is a hash of the following values:
 
 sense - a positive value to include the part, negative to exclude (a hole)
-points - an array of pairs of (eastings, northings) if POLYGON_TYPE is 'ng",
+points - an array of pairs of (eastings, northings) if POLYGON_TYPE is 'ng',
 or (latitude, longitude) if POLYGON_TYPE is 'wgs84'.
 
 If for some reason any of the values above are not known, they will not

Happy hacking,
-- 
Petter Reinholdtsen


More information about the fiksgatami mailing list