logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

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 Log::Report::Lexicon::POT.

       Extends "DESCRIPTION" in Log::Report::Lexicon::Table.

Diagnostics

       Error: only acceptable parameter is 'ACTIVE'

Inheritance

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

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 http://dev.perl.org/licenses/

perl v5.40.1                                       2025-04-24              Log::Report::Lexicon::POTcompact(3pm)

Methods

       Extends "METHODS" in Log::Report::Lexicon::Table.

   Constructors
       Extends "Constructors" in Log::Report::Lexicon::Table.

       Log::Report::Lexicon::POTcompact->new(%options)
           Inherited, see "Constructors" in Log::Report::Lexicon::Table

       Log::Report::Lexicon::POTcompact->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

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

   Attributes
       Extends "Attributes" in Log::Report::Lexicon::Table.

       $obj->filename()
           Returns the name of the source file for this data.

       $obj->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.

   ManagingPO's
       Extends "Managing PO's" in Log::Report::Lexicon::Table.

       Translation

       Extends "Translation" in Log::Report::Lexicon::Table.

       $obj->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 "undef" when the translation is not defined.

       $obj->msgstr( $msgid, [$count, [$msgctxt] )
           Returns the translated string for $msgid.  When not specified, $count is 1 (the single form).

       Administration

       Extends "Administration" in Log::Report::Lexicon::Table.

       $obj->add($po)
           Inherited, see "Administration" in Log::Report::Lexicon::Table

       $obj->header($field)
           Inherited, see "Administration" in Log::Report::Lexicon::Table

       $obj->nrPlurals()
           Inherited, see "Administration" in Log::Report::Lexicon::Table

       $obj->pluralIndex($count)
           Inherited, see "Administration" in Log::Report::Lexicon::Table

       $obj->setupPluralAlgorithm()
           Inherited, see "Administration" in Log::Report::Lexicon::Table

       $obj->translations( [$active] )
           Inherited, see "Administration" in Log::Report::Lexicon::Table

Name

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

See Also

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

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);

See Also