package AccessCheck::L10N; use Mojo::Base 'Locale::Maketext'; use Locale::Maketext::Lexicon::Gettext; sub load_custom_lexicon { my ($self, $directory) = @_; my $language = $self->language_tag(); my $lexicon_file = sprintf("%s/%s.po", $directory , $language); return unless -f $lexicon_file; Locale::Maketext::Lexicon->import({ $language => [Gettext => $lexicon_file], _decode => 1, }); } 1;