diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 3454c5806..fb731b9a3 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -82,12 +82,18 @@ __PACKAGE__->rabx_column('extra'); use Moo; use namespace::clean -except => [ 'meta' ]; -with 'FixMyStreet::Roles::Extra'; +with 'FixMyStreet::Roles::Extra', + 'FixMyStreet::Roles::Translatable'; __PACKAGE__->many_to_many( response_templates => 'contact_response_templates', 'response_template' ); __PACKAGE__->many_to_many( response_priorities => 'contact_response_priorities', 'response_priority' ); __PACKAGE__->many_to_many( defect_types => 'contact_defect_types', 'defect_type' ); +sub category_display { + my $self = shift; + $self->translate('category'); +} + sub get_metadata_for_input { my $self = shift; my $id_field = $self->id_field; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index f353c02ee..afa117e4c 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -206,6 +206,7 @@ my $IM = eval { with 'FixMyStreet::Roles::Abuser', 'FixMyStreet::Roles::Extra', + 'FixMyStreet::Roles::Translatable', 'FixMyStreet::Roles::PhotoSet'; =head2 @@ -456,12 +457,6 @@ sub check_for_errors { $errors{category} = _('Please choose a category'); $self->category(undef); } - elsif ($self->category - && $self->category eq _('-- Pick a property type --') ) - { - $errors{category} = _('Please choose a property type'); - $self->category(undef); - } return \%errors; } @@ -489,6 +484,11 @@ sub confirm { return 1; } +sub category_display { + my $self = shift; + $self->translate('category'); +} + sub bodies_str_ids { my $self = shift; return [] unless $self->bodies_str; @@ -635,7 +635,7 @@ sub meta_line { my $date_time = Utils::prettify_dt( $problem->confirmed ); my $meta = ''; - my $category = $problem->category; + my $category = $problem->category_display; $category = $c->cobrand->call_hook(change_category_text => $category) || $category; if ( $problem->anonymous ) { |