Start of non-English language support

This commit is contained in:
Duncan Ferguson 2010-01-11 19:39:20 +00:00
parent 7ecce265c7
commit 811db0cf29
4 changed files with 114 additions and 3 deletions

View file

@ -15,9 +15,10 @@ my $build = Module::Build->new(
module_name => 'App::ClusterSSH',
license => 'perl',
requires => {
'version' => '0',
'Tk' => '800.022',
'X11::Protocol' => '0.56',
'version' => '0',
'Tk' => '800.022',
'X11::Protocol' => '0.56',
'Locale::Maketext' => 0,
},
build_requires => {
'Test::Pod::Coverage' => 0,

View file

@ -0,0 +1,52 @@
package App::ClusterSSH::L10N;
use strict;
use warnings;
use Locale::Maketext 1.01;
use base qw(Locale::Maketext);
# This projects primary language is English
our %Lexicon = ( '_AUTO' => 1, );
1;
=pod
=head1
ClusterSSH::L10N - Base translations module
=head1 SYNOPSIS
use ClusterSSH::L10N;
my $lang = ClusterSSH::L10N->get_handle('en');
$lang->maketext('text to localise with args [_1]', $arg1);
=head1 DESCRIPTION
L<Locale::Maketext> based translation module for ClusterSSH. See
L<Locale::Maketext> for more information and usage.
NOTE: the default language of this module is English.
=head1 METHODS
See Locale::Maketext - there are curently no extra methods in this module.
=head1 AUTHOR
Duncan Ferguson (<duncan_j_ferguson (at) yahoo.co.uk>)
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2009 Duncan Ferguson (<duncan_j_ferguson (at) yahoo.co.uk>).
All rights reserved
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

View file

@ -0,0 +1,43 @@
package App::ClusterSSH::L10N::en;
use base 'App::ClusterSSH::L10N';
%Lexicon = ( '_AUTO' => 1, );
1;
=pod
=head1
App::ClusterSSH::L10N::en - Base English translations module
=head1 SYNOPSIS
use App::ClusterSSH::L10N;
my $lang = ClusterSSH::L10N->get_handle('en');
$lang->maketext('text to localise with args [_1]', $arg1);
=head1 DESCRIPTION
L<Locale::Maketext> based translation module for ClusterSSH. See
L<Locale::Maketext> for more information and usage.
=head1 METHODS
No method are exported. See L<Locale::Maketext>.
=head1 AUTHOR
Duncan Ferguson (<duncan_j_ferguson (at) yahoo.co.uk>)
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2009 Duncan Ferguson (<duncan_j_ferguson (at) yahoo.co.uk>).
All rights reserved
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

15
t/01l10n.t Normal file
View file

@ -0,0 +1,15 @@
use strict;
use warnings;
use FindBin qw($Bin);
use lib "$Bin/../lib";
use Test::More tests => 2;
use Test::Trap;
BEGIN { use_ok( 'App::ClusterSSH::L10N', ) }
my $handle;
$handle = App::ClusterSSH::L10N->get_handle();
isa_ok( $handle, 'App::ClusterSSH::L10N' );