MooseX::Types::Locale::Language - Locale::Language related constraints and coercions for Moose
{ package Foo; use Moose; use MooseX::Types::Locale::Language qw( LanguageCode LanguageName ); has 'code' => ( isa => LanguageCode, is => 'rw', coerce => 1 ); has 'name' => ( isa => LanguageName, is => 'rw', coerce => 1 ); __PACKAGE__->meta->make_immutable; } my $foo = Foo->new( code => 'JA', name => 'JAPANESE', ); print $foo->code; # 'ja' print $foo->name; # 'Japanese'
This module packages several Moose::Util::TypeConstraints with coercions, designed to work with the values of Locale::Language.
Alpha2Language
A subtype of Str, which should be defined in language code of ISO 639-1 alpha-2. If you turned coerce on, Str will be lower-case. For example, 'JA' will convert to 'ja'.
Str
coerce
'JA'
'ja'
LanguageCode
Alias of Alpha2Language.
LanguageName
A subtype of Str, which should be defined in ISO 639-1 language name. If you turned coerce on, Str will be same case as canonical name. For example, 'JAPANESE' will convert to 'Japanese'.
'JAPANESE'
'Japanese'
Locale::Language
MooseX::Types::Locale::Language::Fast
MooseX::Types::Locale::Country
None reported.
I will send patch on Locale::Language to NEILB, to solve RT #11730. (The patch supports ISO 639-2 alpha-3 bibliographic/terminology codes). cf. http://rt.cpan.org/Public/Bug/Display.html?id=11730
By doing this, this module will support ISO 639-2 alpha-3 bibliographic/terminology codes.
As necessary, Locale::Language and this module may support ISO 639-3 alpha-3 codes (comprehensive coverage of language).
No bugs have been reported.
Please report any found bugs, feature requests, and ideas for improvements to bug-moosex-types-locale-language at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Types-Locale-Language. I will be notified, and then you'll automatically be notified of progress on your bugs/requests as I make changes.
bug-moosex-types-locale-language at rt.cpan.org
When reporting bugs, if possible, please add as small a sample as you can make of the code that produces the bug. And of course, suggestions and patches are welcome.
You can find documentation for this module with the perldoc command.
perldoc
perldoc MooseX::Types::Locale::Language
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Types-Locale-Language
http://annocpan.org/dist/MooseX-Types-Locale-Language
http://search.cpan.org/dist/MooseX-Types-Locale-Language
http://cpanratings.perl.org/d/MooseX-Types-Locale-Language
This module is maintained using git. You can get the latest version from git://github.com/gardejo/p5-moosex-types-locale-language.git.
<moriya at ermitejo dot com>, http://ttt.ermitejo.com/
<moriya at ermitejo dot com>
Copyright (c) 2009 by MORIYA Masaki ("Gardejo"), http://ttt.ermitejo.com.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlgpl and perlartistic.
To install MooseX::Types::Locale::Language, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::Locale::Language
CPAN shell
perl -MCPAN -e shell install MooseX::Types::Locale::Language
For more information on module installation, please visit the detailed CPAN module installation guide.