DateTime-Calendar-FrenchRevolutionary
view release on metacpan or search on metacpan
lib/DateTime/Calendar/FrenchRevolutionary/Locale/en.pm view on Meta::CPAN
# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
# Perl DateTime extension for providing English strings for the French Revolutionary calendar
# Copyright (c) 2003, 2004, 2010, 2011, 2014, 2016, 2019, 2021 Jean Forget. All rights reserved.
#
# See the license in the embedded documentation below.
#
package DateTime::Calendar::FrenchRevolutionary::Locale::en;
use utf8;
use strict;
use warnings;
use vars qw($VERSION);
$VERSION = '0.17'; # same as parent module DT::C::FR
my @months_short = qw (Vin Fog Fro Sno Rai Win Bud Flo Mea Rea Hea Fru S-C);
# based on Thomas Carlyle's book:
my @months = qw(Vintagearious Fogarious Frostarious
Snowous Rainous Windous
Buddal Floweral Meadowal
Reapidor Heatidor Fruitidor);
push @months, "additional day";
my @decade_days = qw (Firsday Seconday Thirday Fourday Fifday Sixday Sevenday Eightday Nineday Tenday);
my @decade_days_short = qw (Fir Two Thi Fou Fif Six Sev Eig Nin Ten);
my @am_pms = qw(AM PM);
my $date_before_time = "1";
my $default_date_format_length = "medium";
my $default_time_format_length = "medium";
my $date_parts_order = "dmy";
my %date_formats = (
"short" => "\%d\/\%m\/\%Y",
"medium" => "\%a\ \%d\ \%b\ \%Y",
"long" => "\%A\ \%d\ \%B\ \%EY",
"full" => "\%A\ \%d\ \%B\ \%EY\,\ \%{feast_long\}",
);
my %time_formats = (
"short" => "\%H\:\%M",
"medium" => "\%H\:\%M\:\%S",
"long" => "\%H\:\%M\:\%S",
"full" => "\%H\ h\ \%M\ mn \%S\ s",
);
# When initializing an array with lists within lists, it means one of two things:
# Either it is a newbie who does not know how to make multi-dimensional arrays,
# Or it is a (at least mildly) experienced Perl-coder who, for some reason,
# wants to initialize a flat array with the concatenation of lists.
# I am a (at least mildly) experienced programmer who wants to use qw() and yet insert
# comments in some places.
# This array is mainly based on L<https://www.allhotelscalifornia.com/kokogiakcom/frc/default.asp>
# Used with permission from Alan Taylor
# Checked with Jonathan Badger's FrenchRevCal-ruby and Wikipedia
my @feast = (
# Vendémiaire
qw(
lib/DateTime/Calendar/FrenchRevolutionary/Locale/en.pm view on Meta::CPAN
is recaptured. Bellegarde recaptured, it was the last
enemy-occupied place in France.
1302
2 additional day I Army of Eastern Pyrenees. The French troops take
Sterry.
2 additional day II Army of Sambre and Meuse. Victory on the whole
French army front, from Maseick to Sprimont.
Capture of Lauwfeld, Emale and Montenack; crossing of Ourte and
Laywale.
2 additional day IV Army of the Rhine and Moselle. The enemy attacks
the Kehl fort in vain.
1303
3 additional day III Army of Sambre and Meuse. Fight on the Lahn
river; capture of Limbourg, Dietz and Nasseau.
Army of Italy. Austrian defeat on the Borghetto line.
3 additional day V Death of general Hoche, general-in-chief of
the Army of Sambre and Meuse.
1304
4 additional day I Army of Western Pyrenees. Capture of Villefranche
and the Prades camp.
Capture of Escalo and Uaborsy, which were occupied by Spanish troops.
4 additional day II Army of Sambre and Meuse. The Clermont highgrounds
are stormed, after 7 successive attacks.
Army of Italy. Victory at Cairo over the Piemontese, supported by
10,000 Austrians.
4 additional day III Surrender of Manheim.
1305
5 additional day II Army of Western Pyrenees. Spanish troops at
Mont-Roch are routed.
5 additional day IV Death of general Marceau, aged 27, killed at
Altenkirchen by a carbine shot.
EVENTS
delete $event{dummy};
}
# A module must return a true value. Traditionally, a module returns 1.
# But this module is a revolutionary one, so it discards all old traditions.
"Ah ! ça ira ! ça ira !";
__END__
=encoding utf8
=head1 NAME
DateTime::Calendar::FrenchRevolutionary::Locale::en -- English localization for the French
revolutionary calendar.
=head1 SYNOPSIS
use DateTime::Calendar::FrenchRevolutionary::Locale;
my $english_locale = DateTime::Calendar::FrenchRevolutionary::Locale->load('en');
my $english_month_name =$english_locale->month_name($date);
=head1 DESCRIPTION
This module provides localization for DateTime::Calendar::FrenchRevolutionary.
Usually, its methods will be invoked only from DT::C::FR.
The month names come from Thomas Carlyle's book. Most of the feast
names come from Alan Taylor's kokogiak.com web site, later checked
with Wikipedia and with Jonathan Badger's French Revolutionary
Calendar module written in Ruby. The day names are from this module's
author.
=head1 USAGE
This module provides the following class methods:
=over 4
=item * new
Returns an object instance, which is just a convenient value to be
stored in a variable.
Contrary to the widely used Gregorian calendar, there is no need to
customize a French Revolutionary calendar locale. Therefore, there are
no instance data and no instance methods.
=item * month_name ($date)
Returns an English translation for C<$date>'s month, where C<$date> is
a C<DateTime::Calendar::FrenchRevolutionary> object.
=item * month_abbreviation ($date)
Returns a 3-letter abbreviation for the English month name.
=item * day_name ($date)
Returns an English translation for the day name.
=item * day_abbreviation ($date)
Returns a 3-letter abbreviation for the English day name.
=item * am_pm ($date)
Returns a code (typically C<AM> or C<PM>) showing whether the datetime
is in the morning or the afternoon. Outside the sexagesimal time with
a 1..12 hour range, this is not very useful.
=item * feast_short ($date)
Hopefully returns an adequate English translation for the plant,
animal or tool that correspond to C<$date>'s feast.
Note: in some cases, the feast French name is left untranslated, while
in some other cases, the translation is inadequate. If you are fluent
in both French and English, do not hesitate to send corrections to the
author.
=item * feast_long ($date)
Same as C<feast_short>, with a "day" suffix, as in the current
calendar's "groundhog day" or "Colombus day".
=item * feast_caps ($date)
Same as C<feast_long> with capitalized first letters.
=item * on_date ($date)
Gives a small text about the events which occurred the same month and
day as C<$date> between the calendar's epoch (22 Sep 1792) and the day
it was rescinded (31 Dec 1805).
Most of these events come from an anonymous propaganda book published
in year VIII (1799--1800). The others are common knowledge available
in any French History book or any encyclopedia.
=item * full_date_format, long_date_format, medium_date_format, short_date_format
Class methods, giving four C<strftime> canned formats for dates,
without the need to remember all the C<%> specifiers.
=item * full_time_format, long_time_format, medium_time_format, short_time_format
Same thing, C<strftime> canned formats for decimal time.
=item * full_datetime_format, long_datetime_format, medium_datetime_format, short_datetime_format
Same thing, for formats including both the date and the decimal time.
=item * default_date_format, default_time_format, default_datetime_format
Class methods suggesting one each of the date formats, of the time
formats and of the datetime formats.
=item * default_date_format_length, default_time_format_length
While C<default_date_format> and C<default_time_format> give the
actual default formats, with C<%> and all, these class methods give a
one-word description of the default formats: C<short>, C<medium>,
C<long> or C<full>.
=item * date_formats, time_formats
These class methods give a hashtable where the key is the length
(C<short>, C<medium>, C<long> and C<full>) and the value is the
corresponding format, complete with C<%> and specifiers.
=item * month_names, month_abbreviations, day_names, day_abbreviations
Class methods giving the whole array of month or day names or abbrevs,
not limited to the date implemented by the invocant.
=back
=head1 SUPPORT
Support for this module is provided via the datetime@perl.org email
list. See L<https://lists.perl.org/> for more details.
Please report any bugs or feature requests to Github at
L<https://github.com/jforget/DateTime-Calendar-FrenchRevolutionary>,
and create an issue or submit a pull request.
If you have no feedback after a week or so, try to reach me by email
at JFORGET at cpan dot org. The notification from Github may have
failed to reach me. In your message, please mention the distribution
name in the subject, so my spam filter and I will easily dispatch the
email to the proper folder.
On the other hand, I may be on vacation or away from Internet for a
( run in 2.274 seconds using v1.01-cache-2.11-cpan-364913b4093 )