From d0f75b9b35806b64e42158708c58808a7a42928b Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 17 Dec 2018 07:30:05 -0300 Subject: Initial commit --- lib/Gettext.pm6 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lib/Gettext.pm6 (limited to 'lib') diff --git a/lib/Gettext.pm6 b/lib/Gettext.pm6 new file mode 100644 index 0000000..55b8651 --- /dev/null +++ b/lib/Gettext.pm6 @@ -0,0 +1,67 @@ +use v6.d; +unit module Gettext:ver<0.0.1>; + +use NativeCall; + +enum LocaleCategory is export ( + # Character classification and case conversion. + LcCType => 0, + # Non-monetary numeric formats. + LcNumeric => 1, + # Date and time formats. + LcTime => 2, + # Collation order. + LcCollate => 3, + # Monetary formats. + LcMonetary => 4, + # Formats of informative and diagnostic messages and interactive responses. + LcMessages => 5, + # For all. + LcAll => 6, + # Paper size. + LcPaper => 7, + # Name formats. + LcName => 8, + # Address formats and location information. + LcAddress => 9, + # Telephone number formats. + LcTelephone => 10, + # Measurement units (Metric or Other). + LcMeasurement => 11, + # Metadata about the locale information. + LcIdentification => 12, +); + +our sub gettext(Str is encoded('utf8') --> Str) is native { … } +sub bindtextdomain(Str:D, Str:D --> Str) is native is export {…} +sub textdomain(Str:D --> Str) is native is export { … } +sub setlocale(int32, Str:D --> Str ) is native is export { … } + +sub _(Str:D $a --> Str) is export { gettext($a) } + + +=begin pod + +=head1 NAME + +Gettext - Perl6 binding for L + +=head1 SYNOPSIS + + use Gettext; + +=head1 DESCRIPTION + +Gettext is ... + +=head1 AUTHOR + +Matias Linares + +=head1 COPYRIGHT AND LICENSE + +Copyright 2018 Matias Linares + +This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0. + +=end pod -- cgit v1.2.3-70-g09d2