aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/State.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/State.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/State.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/State.pm b/perllib/FixMyStreet/DB/Result/State.pm
index 6a689d595..b8a35d42b 100644
--- a/perllib/FixMyStreet/DB/Result/State.pm
+++ b/perllib/FixMyStreet/DB/Result/State.pm
@@ -33,6 +33,16 @@ __PACKAGE__->add_unique_constraint("state_name_key", ["name"]);
# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-08-22 15:17:43
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dvtAOpeYqEF9T3otHHgLqw
+use Moo;
+use namespace::clean;
+
+with 'FixMyStreet::Roles::Translatable';
+
+sub msgstr {
+ my $self = shift;
+ my $lang = $self->result_source->schema->lang;
+ return $self->name unless $lang && $self->translated->{name}{$lang};
+ return $self->translated->{name}{$lang}{msgstr};
+}
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;