Hi - I hope it's okay to post this here, I know it's not about Catalyst

I'm using CatalystX::I18N::* in order to be able to internationalise my
site.  I have that working nicely, and my site text is coming from

However, I've been trying to access these codes from my database model (in
order to generate, e.g., success or failure messages when checking input
before creating / updating) and am struggling.

According to the CatalystX::I18N docs, CatalystX::I18N::Maketext is a
'Helpful wrapper around Locale::Maketext. Can also be used outside of

I have MyApp::Maketext setup as directed:

package MyApp::Maketext;

use strict;
use warnings;
use parent qw(CatalystX::I18N::Maketext);


I have a little test script running, the setup for which is this:


use strict;
use warnings;
use FindBin qw( $Bin );
use lib "$Bin/../lib";
use TopTable::Maketext;
use Path::Class::Dir;

my $dir = Path::Class::Dir->new( "$Bin/..", "root", "locale" );
  locales => ["en_GB"], # Required
  directories => [$dir], # Required
  gettext_style => 0, # Optional, Default 1

I am then trying two different ways to get a handle to the maketext()

my $lang = TopTable::Maketext->get_handle;
printf "%s\n", $lang->maketext( "menu.title.news" );

Gives the following result:
Can't call method "maketext" on an undefined value at bin\maketext-demo.pl
line 23.

If I swap ->get_handle to ->new:
my $lang = TopTable::Maketext->new;
printf "%s\n", $lang->maketext( "menu.title.news" );

I get the following:
maketext doesn't know how to say:
as needed at bin\maketext-demo.pl line 23.

I'm at a bit of a loss as to what to try next!  Thank you so much in
advance for any pointers anyone can give.

List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to