#!/usr/bin/perl use strict; use warnings; use FindBin qw( $Bin ); use lib "$Bin/../lib"; use Data::Dumper::Concise; use TopTable::Maketext; use Config::ZOMG; use Path::Class::Dir; # Load the Catalyst config my $tt_config = Config::ZOMG->new( name => "TopTable" ); my $config_hash = $tt_config->load; # Load the locales from the config my (@locales, %inheritance, $config); $config = $config_hash->{I18N}{locales}; foreach my $locale (keys %$config) { push(@locales, $locale); $inheritance{$locale} = $config->{$locale}{inherits} if defined $config->{$locale}{inherits}; } # Get the directory where the messages are defined my $dir = Path::Class::Dir->new( "$Bin/..", "root", "locale" ); # Load the lexicon TopTable::Maketext->load_lexicon( locales => \@locales, directories => [$dir], gettext_style => 1, inheritance => \%inheritance, ); my $lang = TopTable::Maketext->get_handle( "en_GB" ); printf "%s\n", $lang->maketext( "menu.title.league-tables", "Division Three" ); 1;