=encoding utf8

=head1 NAME

Log::Report::Lexicon::POTcompact - use translations from a POT file

=head1 INHERITANCE

 Log::Report::Lexicon::POTcompact
   is a Log::Report::Lexicon::Table

=head1 SYNOPSIS

 # using a PO table efficiently
 my $pot = Log::Report::Lexicon::POTcompact->read('po/nl.po')
    or die;

 my $header = $pot->msgid('');
 print $pot->msgstr('msgid', 3);

=head1 DESCRIPTION

This module is translating, based on PO files. PO files are used to store
translations in humanly readable format for most of existing translation
frameworks, like GNU gettext and Perl's Maketext.

Internally, this module tries to be as efficient as possible: high
speed and low memory foot-print.  You will not be able to sub-class
this class cleanly.

If you like to change the content of PO files, then use
L<Log::Report::Lexicon::POT|Log::Report::Lexicon::POT>.

Extends L<"DESCRIPTION" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"DESCRIPTION">.
 
=head1 METHODS

Extends L<"METHODS" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"METHODS">.
 
=head2 Constructors

Extends L<"Constructors" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"Constructors">.
 
=over 4

=item Log::Report::Lexicon::POTcompact-E<gt>B<new>(%options)

Inherited, see L<Log::Report::Lexicon::Table/"Constructors">

=item Log::Report::Lexicon::POTcompact-E<gt>B<read>($filename, %options)

Read the POT table information from $filename, as compact as possible.
Comments, plural-form, and such are lost on purpose: they are not
needed for translations.

 -Option --Default
  charset  undef

=over 2

=item charset => STRING

When the charset is not specified, it will be taken from the content-type
field in the po-file header.

=back

=back

=head2 Attributes

Extends L<"Attributes" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"Attributes">.
 
=over 4

=item $obj-E<gt>B<filename>()

Returns the name of the source file for this data.

=item $obj-E<gt>B<originalCharset>()

[1.09] Returns the character-set of the strings found in the file.  They will
get translated into utf8 before being used in Perl.

=back

=head2 Managing PO's

Extends L<"Managing PO's" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"Managing PO's">.
 
=head3 Translation

Extends L<"Translation" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"Translation">.
 
=over 4

=item $obj-E<gt>B<msgid>( STRING, [$msgctxt] )

Lookup the translations with the STRING.  Returns a SCALAR, when only
one translation is known, and an ARRAY wherein there are multiple.
Returns C<undef> when the translation is not defined.

=item $obj-E<gt>B<msgstr>( $msgid, [$count, [$msgctxt] )

Returns the translated string for $msgid.  When not specified, $count is 1
(the single form).

=back

=head3 Administration

Extends L<"Administration" in Log::Report::Lexicon::Table|Log::Report::Lexicon::Table/"Administration">.
 
=over 4

=item $obj-E<gt>B<add>($po)

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=item $obj-E<gt>B<header>($field)

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=item $obj-E<gt>B<nrPlurals>()

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=item $obj-E<gt>B<pluralIndex>($count)

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=item $obj-E<gt>B<setupPluralAlgorithm>()

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=item $obj-E<gt>B<translations>( [$active] )

Inherited, see L<Log::Report::Lexicon::Table/"Administration">

=back

=head1 DIAGNOSTICS

=over 4

=item Error: only acceptable parameter is 'ACTIVE'

=back

=head1 SEE ALSO

This module is part of Log-Report-Lexicon distribution version 1.12,
built on April 18, 2025. Website: F<http://perl.overmeer.net/CPAN/>

=head1 LICENSE

Copyrights 2007-2025 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://dev.perl.org/licenses/>

