aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-09 18:49:34 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-09 18:49:34 +0100
commit6a71f6c5918878eaf5dd372ac60fd4b2e57d0ed7 (patch)
treeca1a191b627f7ff506478b85533888a777c8ec15
parenta648b8b4d44752ec3286551478b191ac348a94c5 (diff)
nget a phrase to stop it being duplicated in the .po file, and some more missing strings.
-rwxr-xr-xbin/gettext-nget-patch26
-rw-r--r--templates/web/default/admin/council_edit.html2
-rw-r--r--templates/web/default/admin/list_updates.html2
-rw-r--r--templates/web/default/admin/search_reports.html2
-rw-r--r--templates/web/emptyhomes/report/new/no_councils_text.html8
5 files changed, 29 insertions, 11 deletions
diff --git a/bin/gettext-nget-patch b/bin/gettext-nget-patch
index 8f8dbc346..223bcc816 100755
--- a/bin/gettext-nget-patch
+++ b/bin/gettext-nget-patch
@@ -5,6 +5,8 @@
use File::Find qw/find/;
+my %out;
+
find( sub {
next unless -f;
open (FP, $_) or die $!;
@@ -16,15 +18,25 @@ find( sub {
$text .= <FP>;
} until $text =~ /\)/;
$text =~ /nget\(\s*"(.*?)"\s*,\s*"(.*?)"\s*,\s*(.*?)\s*\)/s;
- print <<EOF;
+ $out{$1} = {
+ file => $File::Find::name,
+ line => $line,
+ s => $1,
+ p => $2,
+ };
+ }
+ close FP;
+}, 'templates');
+
+foreach (values %out) {
+ print <<EOF;
-#: $File::Find::name:$line
+#: $_->{file}:$_->{line}
#, perl-format
-msgid "$1"
-msgid_plural "$2"
+msgid "$_->{s}"
+msgid_plural "$_->{p}"
msgstr[0] ""
msgstr[1] ""
EOF
- }
- close FP;
-}, 'templates');
+}
+
diff --git a/templates/web/default/admin/council_edit.html b/templates/web/default/admin/council_edit.html
index c766bbd08..f6e820bab 100644
--- a/templates/web/default/admin/council_edit.html
+++ b/templates/web/default/admin/council_edit.html
@@ -32,7 +32,7 @@
<input type="hidden" name="area_id" value="[% area_id %]">
<input type="hidden" name="posted" value="new">
- <input type="submit" name="Save changes" value="Save changes">
+ <input type="submit" name="Save changes" value="[% loc('Save changes') %]">
</form>
<h2>[% loc('History') %]</h2>
diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html
index a6005bc00..92f41f348 100644
--- a/templates/web/default/admin/list_updates.html
+++ b/templates/web/default/admin/list_updates.html
@@ -28,7 +28,7 @@
<td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
<td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td>
<td>[% update.text | html %]</td>
- <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">Edit</a></td>
+ <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td>
<tr>
[% END -%]
</table>
diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/search_reports.html
index 2406dc73e..3809965f6 100644
--- a/templates/web/default/admin/search_reports.html
+++ b/templates/web/default/admin/search_reports.html
@@ -49,7 +49,7 @@
[%- IF problem.state == 'confirmed' %]<br>[% loc('Last&nbsp;update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]</small>
</td>
<td>[% PROCESS format_time time=problem.whensent %]</td>
- <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">Edit</a></td>
+ <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
</tr>
[%- END -%]
</table>
diff --git a/templates/web/emptyhomes/report/new/no_councils_text.html b/templates/web/emptyhomes/report/new/no_councils_text.html
index f2ab01666..dbe9cd510 100644
--- a/templates/web/emptyhomes/report/new/no_councils_text.html
+++ b/templates/web/emptyhomes/report/new/no_councils_text.html
@@ -1,4 +1,10 @@
<p>
-[% loc('We do not yet have details for the council that covers this location.'); %]
+[%
+ nget(
+ "We do not yet have details for the council that covers this location.",
+ "We do not yet have details for the councils that cover this location.",
+ all_councils.size
+ );
+%]
[% loc("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."); %]
</p>