File: PerlPPI.pod

package info (click to toggle)
liblog-report-perl 0.94-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 568 kB
  • sloc: perl: 3,649; makefile: 7
file content (112 lines) | stat: -rw-r--r-- 2,642 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
=head1 NAME

Log::Report::Extract::PerlPPI - Collect translatable strings from Perl using PPI

=head1 SYNOPSIS

 my $ppi = Log::Report::Extract::PerlPPI->new
  ( lexicon => '/usr/share/locale'
  );
 $ppi->process('lib/My/Pkg.pm');  # many times
 $ppi->showStats;   # to dispatchers which accept TRACE or INFO
 $ppi->write;       # also cleans processing memory.

=head1 DESCRIPTION

This module helps maintaining the POT files, updating the list of
message-ids which are kept in them.  After initiation, the L<process()|Log::Report::Extract::PerlPPI/"Processors">
method needs to be called with all files which changed since last processing
and the existing PO files will get updated accordingly.  If no translations
exist yet, one C<textdomain/xx.po> file will be created.

=head1 METHODS

=head2 Constructors

=over 4

=item Log::Report::Extract::PerlPPI-E<gt>B<new>(OPTIONS)

 -Option --Default
  charset  'utf-8'
  lexicon  <required>

=over 2

=item charset => STRING

The character-set used in the PO files.

=item lexicon => DIRECTORY

The place where the lexicon is kept.  When no lexicon is defined yet,
this will be the directory where an C<domain/xx.po> file will be created.

=back

=back

=head2 Accessors

=over 4

=item $obj-E<gt>B<charset>

Returns the character-set used inside the POT files.

=item $obj-E<gt>B<domains>

Returns a sorted list of all known domain names.

=item $obj-E<gt>B<index>

Returns the L<Log::Report::Lexicon::Index|Log::Report::Lexicon::Index> object, which is listing
the files in the lexicon directory tree.

=back

=head2 Processors

=over 4

=item $obj-E<gt>B<process>(FILENAME, OPTIONS)

Update the domains mentioned in the FILENAME.  All textdomains defined
in the file will get updated automatically, but not written before
all files where processed.

 -Option --Default
  charset  'iso-8859-1'

=over 2

=item charset => STRING

=back

=item $obj-E<gt>B<showStats>([DOMAINs])

Show a status about the DOMAIN (by default all domains).  At least mode
verbose is required to see this.

=item $obj-E<gt>B<write>([DOMAIN])

Update the information of the files related to DOMAIN, by default all
processed DOMAINS.  All information known about the DOMAIN is removed
from the cache.

=back

=head1 SEE ALSO

This module is part of Log-Report distribution version 0.94,
built on August 23, 2011. Website: F<http://perl.overmeer.net/log-report/>

=head1 LICENSE

Copyrights 2007-2011 by Mark Overmeer. 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://www.perl.com/perl/misc/Artistic.html>