aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/JS.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-04-03 10:37:39 +0100
committerStruan Donald <struan@exo.org.uk>2012-04-03 10:37:39 +0100
commit592924059a07a5a30e8a09dfc4ca8dea56c5c77a (patch)
treec99e86d3e3f780427bbf7a9ec0ae5187b697dfa5 /perllib/FixMyStreet/App/Controller/JS.pm
parent65066d275557e16448aa99ecdfa4df62d4d79649 (diff)
parentd92bbef188eff6c14adf0f0c7b032846b1be85a6 (diff)
Merge remote-tracking branch 'origin/master' into send-report-rewrite
Conflicts: bin/send-reports perllib/FixMyStreet/Cobrand/Default.pm perllib/FixMyStreet/Cobrand/FixMyStreet.pm
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/JS.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/JS.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/JS.pm b/perllib/FixMyStreet/App/Controller/JS.pm
new file mode 100755
index 000000000..ae2f06605
--- /dev/null
+++ b/perllib/FixMyStreet/App/Controller/JS.pm
@@ -0,0 +1,30 @@
+package FixMyStreet::App::Controller::JS;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+FixMyStreet::App::Controller::JS - Catalyst Controller
+
+=head1 DESCRIPTION
+
+JS Catalyst Controller. To return a language-dependent list
+of validation strings.
+
+=head1 METHODS
+
+=cut
+
+sub validation_strings : LocalRegex('^validation_strings\.(.*?)\.js$') : Args(0) {
+ my ( $self, $c ) = @_;
+ my $lang = $c->req->captures->[0];
+ $c->cobrand->set_lang_and_domain( $lang, 1 );
+ $c->res->content_type( 'application/javascript' );
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+