diff options
-rw-r--r-- | lib/Locale/POFileManager.pm | 10 | ||||
-rw-r--r-- | lib/Locale/POFileManager/File.pm | 27 |
2 files changed, 32 insertions, 5 deletions
diff --git a/lib/Locale/POFileManager.pm b/lib/Locale/POFileManager.pm index 54317ca..5ac7e35 100644 --- a/lib/Locale/POFileManager.pm +++ b/lib/Locale/POFileManager.pm @@ -25,7 +25,7 @@ Locale::POFileManager - Helpers for keeping a set of related .po files in sync This module contains helpers for managing a set of gettext translation files, including tools to keep the translation files in sync, adding new translation files, and manipulating the translations contained in the files. It is based on -the L<Locale::PO> parser library. +the L<Locale::Maketext::Lexicon> parser library. =cut @@ -225,7 +225,7 @@ sub add_language { =head2 language_file -Returns the L<Locale::POFileManager> object corresponding to the given +Returns the L<Locale::POFileManager::File> object corresponding to the given language. =cut @@ -241,7 +241,7 @@ sub language_file { =head2 canonical_language_file -Returns the L<Locale::POFileManager> object corresponding to the +Returns the L<Locale::POFileManager::File> object corresponding to the C<canonical_language>. =cut @@ -301,10 +301,12 @@ L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Locale-POFileManager>. =head1 SEE ALSO -L<Locale::PO> +L<Locale::Maketext::Lexicon> L<Locale::Maketext> +L<Locale::PO> + =head1 SUPPORT You can find this documentation for this module with the perldoc command. diff --git a/lib/Locale/POFileManager/File.pm b/lib/Locale/POFileManager/File.pm index b024c8c..f224e56 100644 --- a/lib/Locale/POFileManager/File.pm +++ b/lib/Locale/POFileManager/File.pm @@ -50,7 +50,7 @@ Accepts a hash of arguments: =item file -The name of the file this represents. Required. +The name of the file this represents. Required, and must exist. =item stub_msgstr @@ -91,6 +91,14 @@ has stub_msgstr => ( Returns a list of msgids found in the file. +=head2 has_msgid + +Returns true if the given msgid is found in the file, and false otherwise. + +=head2 msgstr + +Returns the msgstr that corresponds with the given msgid. + =cut has lexicon => ( @@ -110,6 +118,16 @@ has lexicon => ( }, ); +=head2 headers + +Returns the list of header entries. + +=head2 header + +Returns the value of the given header entry. + +=cut + has headers => ( traits => [qw(Hash)], isa => 'HashRef', @@ -138,6 +156,13 @@ sub BUILD { $self->headers; } +=head2 add_entry + +Adds an entry to the translation file. Arguments are a hash, with valid keys +being C<msgid> and C<msgstr>. + +=cut + sub add_entry { my $self = shift; my %args = @_; |