NAME
DateTime::Language - base class for DateTime.pm-related language localization
SYNOPSIS
package DateTime::Language::Gibberish;
use base qw(DateTime::Language);
DESCRIPTION
This class provides most of the methods needed to implement language localization for DateTime.pm. A subclass of this language simply
USAGE
This module provides one somewhat interesting function, subclasses()
. Calling this method returns a list of subclass names, minus the leading "DateTime::Language::" portion.
SUBCLASSING
People who want to add support for new languages may be interested in subclassing this module.
The simplest way to do this is to simply declare your new module, let's call it DateTime::Language::Inhumi
, a subclass of DateTime::Language
, and to define a set of global variables in your namespace.
These globals are:
@DayNames
The names of each day, starting with Monday.
@DayAbbreviations
Abbreviated names for each day.
@MonthNames
The names of each month, starting with January.
@MonthAbbreviations
Abbreviated names for each month.
@AMPM
The terms used for AM and PM in the language you are implementing.
The DateTime::Language
module implements methods that use these globals as needed. If you need to implement more complex algorithms, you can override the following methods:
month_names
Returns a list of month names.
month_name( $dt )
Given a
DateTime
object, this method should return the correct month name.month_abbreviations
Returns a list of month abbreviations.
month_abbreviation( $dt )
Given a
DateTime
object, this method should return the correct month abbreviation.day_names
Returns a list of day names.
day_name( $dt )
Given a
DateTime
object, this method should return the correct day name.day_abbreviations
Returns a list of day abbreviations.
day_abbreviation( $dt )
Given a
DateTime
object, this method should return the correct day abbreviation.am_pm( $dt )
Given a
DateTime
object, returns the correct AM or PM abbreviation.
SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.
AUTHOR
Dave Rolsky <autarch@urth.org>
However, please see the CREDITS file for more details on who I really stole all the code from.
COPYRIGHT
Copyright (c) 2003 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Portions of the code in this distribution are derived from other works. Please see the CREDITS file for more details.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
datetime@perl.org mailing list
http://datetime.perl.org/