File: Root.pm

package info (click to toggle)
libcatalyst-plugin-i18n-perl 0.10-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 232 kB
  • sloc: perl: 2,137; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package TestApp::Controller::Root;
use warnings;
use strict;

use base 'Catalyst::Controller';

__PACKAGE__->config( namespace => q{} );

sub maketext : Global {
    my( $self, $c, $key ) = @_;
    $c->res->body( $c->localize( $key ) );
}

sub current_language : Global {
    my( $self, $c ) = @_;
    $c->res->body( $c->language );
}

sub current_language_tag : Global {
    my( $self, $c ) = @_;
    $c->res->body( $c->language_tag );
}

sub current_languages_list : Global {
    my( $self, $c ) = @_;
    my $h = $c->installed_languages;
    my $output = join(", ", map { "$_=".$h->{$_} } (sort keys %$h) );
    $c->res->body( $output );
}

1;