[NUUG fiksgatami] [patch] Make leftover string translatable

Petter Reinholdtsen pere at hungry.com
Thu Mar 31 09:20:47 CEST 2011


[Petter Reinholdtsen]
> With the mobile apps being tested, we found another string that need
> to be translated.

Followup on this, which do not seem to be applied yet.

The first part of the patch for send-reports add () to a function call
to get my perl mode in emacs to not mess up its context sensing.  This
is a purely cosmetic change.  The rest of that patch make the new
strings regarding nearest street name and post code translatable.

The patch for our FixMyStreet.po fix one translation (double dots) and
add another.

The patch for index.cgi is the same patch I reported earlier, making a
string used for reports submitted via import.cgi translatable.

I hope these are OK and can be applied soon.

Happy hacking,
-- 
Petter Reinholdtsen
-------------- next part --------------
diff --git a/bin/send-reports b/bin/send-reports
index 5bfee00..5eb8c54 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -142,7 +142,7 @@ foreach my $row (@$unsent) {
         # XXX Needs locks!
         my @all_councils = split /,|\|/, $row->{council};
         my ($councils, $missing) = $row->{council} =~ /^([\d,]+)(?:\|([\d,]+))?/;
-        my @councils = split /,/, $councils;
+        my @councils = split(/,/, $councils);
         $areas_info = mySociety::MaPit::call('areas', \@all_councils);
         my (@dear, %recips);
         my $all_confirmed = 1;
@@ -358,7 +358,8 @@ sub find_closest {
     if ($j) {
         $j = JSON->new->utf8->allow_nonref->decode($j);
         if ($j->{resourceSets}[0]{resources}[0]{name}) {
-            $str .= "Nearest road to the pin placed on the map (automatically generated by Bing Maps): $j->{resourceSets}[0]{resources}[0]{name}\n\n";
+            $str .= sprintf(_("Nearest road to the pin placed on the map (automatically generated by Bing Maps): %s\n\n"),
+                            $j->{resourceSets}[0]{resources}[0]{name});
         }
     }
 
@@ -368,7 +369,8 @@ sub find_closest {
     if ($j) {
         $j = JSON->new->utf8->allow_nonref->decode($j);
         if ($j->{postcode}) {
-            $str .= "Nearest postcode to the pin placed on the map (automatically generated): $j->{postcode}[0] ($j->{postcode}[1]m away)\n\n";
+            $str .= sprintf(_("Nearest postcode to the pin placed on the map (automatically generated): %s (%sm away)\n\n"),
+                            $j->{postcode}[0], $j->{postcode}[1]);
         }
     }
     return $str;
diff --git a/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po
index f5f3e56..5bc5d06 100644
--- a/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po
+++ b/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po
@@ -10,7 +10,7 @@ msgstr ""
 "Project-Id-Version: FixMyStreet\n"
 "Report-Msgid-Bugs-To: matthew at mysociety.org\n"
 "POT-Creation-Date: 2011-03-29 15:40+0100\n"
-"PO-Revision-Date: 2011-02-27 13:36MET\n"
+"PO-Revision-Date: 2011-03-31 09:12MET\n"
 "Last-Translator: Petter Reinholdtsen <pere at hungry.com>\n"
 "Language-Team: Norwegian Bokm??l <i18n-nb at lister.ping.uio.no>\n"
 "MIME-Version: 1.0\n"
@@ -1488,7 +1488,7 @@ msgstr "Denne saken er gammel og med ukjent status."
 
 #: web/index.cgi:1051 web/index.cgi:1092
 msgid "This problem has been fixed"
-msgstr "Denne saken er l??st."
+msgstr "Denne saken er l??st"
 
 #: web/index.cgi:1076
 msgid "More problems nearby"
@@ -1830,9 +1830,8 @@ msgid "Problems within %s, FixMyStreet"
 msgstr "Problemer innenfor %s, Fiksgatami"
 
 #: web/reports.cgi:333
-#, fuzzy
 msgid "(sent to both)"
-msgstr "(ikke rapportert til administrasjonen)"
+msgstr "(sent til begge)"
 
 #: web/reports.cgi:334
 msgid "(not sent to council)"
@@ -3414,6 +3413,3 @@ msgid ""
 "To stop receiving emails when there are new updates on this property,\n"
 "please follow this link: <?=$values['unsubscribe_url']?>\n"
 msgstr ""
-
-#~ msgid "Thank you for reporting an empty property on ReportEmptyHomes.com."
-#~ msgstr "Takk for at du rapporterer en tom eiendom p?? ReportEmptyHomes.com."
diff --git a/web/index.cgi b/web/index.cgi
index eb7ae7f..b73b98f 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -633,9 +633,9 @@ EOF
         if (my $token = $input{partial}) {
             $partial_id = mySociety::AuthToken::retrieve('partial', $token);
             if ($partial_id) {
-                $vars{form_start} .= $q->p({id=>'unknown'}, 'Please note your report has
-                <strong>not yet been sent</strong>. Choose a category
-                and add further information below, then submit.');
+                $vars{form_start} .=
+                    $q->p({id=>'unknown'},
+                          _('Please note your report has <strong>not yet been sent</strong>. Choose a category and add further information below, then submit.'));
             }
         }
         $vars{text_located} = $q->p(_('You have located the problem at the point marked with a purple pin on the map.


More information about the fiksgatami mailing list