diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-11 10:44:10 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-11 10:44:10 +0100 |
commit | 8e320beadae7cbc65967fc851f2448bbb1c7b2e0 (patch) | |
tree | e5e171bd592453fb0187541a97a6795a4645b9fa | |
parent | 5fd5a93ef47e606ad0d3ae339eed0eb04aa2db26 (diff) |
Prevent unnecessary string translation.
Calling the function 'translate' causes gettext-extract to add the
string to the .po file. Also, we no longer need an admin 'updated'
message as the main form has its own success message.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Roles/Translatable.pm | 2 |
4 files changed, 3 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 0fa58eb9d..87773a31b 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -469,8 +469,6 @@ sub update_translations : Private { ); } } - - $c->stash->{updated} = _('Translations updated'); } sub body_params : Private { diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index fb731b9a3..f9cbf1c44 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -91,7 +91,7 @@ __PACKAGE__->many_to_many( defect_types => 'contact_defect_types', 'defect_type' sub category_display { my $self = shift; - $self->translate('category'); + $self->translate_column('category'); } sub get_metadata_for_input { diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index afa117e4c..a12f8c20d 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -486,7 +486,7 @@ sub confirm { sub category_display { my $self = shift; - $self->translate('category'); + $self->translate_column('category'); } sub bodies_str_ids { diff --git a/perllib/FixMyStreet/Roles/Translatable.pm b/perllib/FixMyStreet/Roles/Translatable.pm index 49f10d51a..803cf7a1a 100644 --- a/perllib/FixMyStreet/Roles/Translatable.pm +++ b/perllib/FixMyStreet/Roles/Translatable.pm @@ -9,7 +9,7 @@ sub translate_around { $self->_translate($col, $fallback); } -sub translate { +sub translate_column { my ($self, $col) = (shift, shift); my $fallback = $self->$col(@_); $self->_translate($col, $fallback); |