Acme::MetaSyntactic::Locale - Base class for multilingual themes
package Acme::MetaSyntactic::digits; use Acme::MetaSyntactic::Locale; our @ISA = ( Acme::MetaSyntactic::Locale ); __PACKAGE__->init(); 1; =head1 NAME Acme::MetaSyntactic::digits - The numbers theme =head1 DESCRIPTION You can count on this module. Almost. =cut __DATA__ # default en # names en zero one two three four five six seven eight nine # names fr zero un deux trois quatre cinq six sept huit neuf # names it zero uno due tre quattro cinque sei sette otto nove # names yi nul eyn tsvey dray fir finf zeks zibn akht nayn
Acme::MetaSyntactic::Locale is the base class for all themes that are meant to return a random excerpt from a predefined list.
Acme::MetaSyntactic::Locale
Acme::MetaSyntactic::Locale offers several methods, so that the subclasses are easy to write (see full example in SYNOPSIS):
The constructor of a single instance. An instance will not repeat items until the list is exhausted.
If no lang parameter is given, Acme::MetaSyntactic::Locale will try to find the user locale (with the help of environment variables LANGUAGE, LANG and Win32::Locale).
lang
LANGUAGE
LANG
$lang is a two-letter language code (ISO 3166, RFC 3066). If the list is not available in the requested language, the default is used.
init() must be called when the subclass is loaded, so as to read the __DATA__ section and fully initialise it.
Return $count names (default: 1).
1
Using 0 will return the whole list in list context, and the size of the list in scalar context (according to the lang parameter passed to the constructor).
0
Return the selected language for this instance.
Return the languages supported by the theme.
Philippe 'BooK' Bruhat, <book@cpan.org>
<book@cpan.org>
Copyright 2005 Philippe 'BooK' Bruhat, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Acme::MetaSyntactic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::MetaSyntactic
CPAN shell
perl -MCPAN -e shell install Acme::MetaSyntactic
For more information on module installation, please visit the detailed CPAN module installation guide.