summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-10-09 10:36:40 -0500
committerJesse Luehrs <doy@tozt.net>2011-10-09 10:44:23 -0500
commit4879437a0f628b3d685a3972695aed5011622ca4 (patch)
treec3a8cddd8df3721d6ac134467990b2f9cff038a9 /lib
parent599185df57b9ae0c16cddd3185cd27c2a05cd934 (diff)
downloadlocale-pofilemanager-4879437a0f628b3d685a3972695aed5011622ca4.tar.gz
locale-pofilemanager-4879437a0f628b3d685a3972695aed5011622ca4.zip
update dzil stuff
Diffstat (limited to 'lib')
-rw-r--r--lib/Locale/POFileManager.pm42
-rw-r--r--lib/Locale/POFileManager/File.pm42
2 files changed, 32 insertions, 52 deletions
diff --git a/lib/Locale/POFileManager.pm b/lib/Locale/POFileManager.pm
index 5ac7e35..9d4fffd 100644
--- a/lib/Locale/POFileManager.pm
+++ b/lib/Locale/POFileManager.pm
@@ -2,10 +2,7 @@ package Locale::POFileManager;
use Moose;
use MooseX::Types::Path::Class qw(Dir);
use Scalar::Util qw(reftype weaken);
-
-=head1 NAME
-
-Locale::POFileManager - Helpers for keeping a set of related .po files in sync
+# ABSTRACT: Helpers for keeping a set of related .po files in sync
=head1 SYNOPSIS
@@ -29,9 +26,7 @@ the L<Locale::Maketext::Lexicon> parser library.
=cut
-=head1 METHODS
-
-=head2 new
+=method new
Accepts a hash of arguments:
@@ -54,9 +49,7 @@ C<canonical_language>. Optional.
=back
-=cut
-
-=head2 base_dir
+=method base_dir
Returns a L<Path::Class::Dir> object corresponding to the C<base_dir> passed to
the constructor.
@@ -70,7 +63,7 @@ has base_dir => (
coerce => 1,
);
-=head2 files
+=method files
Returns a list of L<Locale::POFileManager::File> objects corresponding to the
.po files that were found in the C<base_dir>.
@@ -110,7 +103,7 @@ sub _build_files {
return \@files;
}
-=head2 canonical_language
+=method canonical_language
Returns the canonical language id passed to the constructor.
@@ -135,7 +128,7 @@ sub BUILD {
unless $self->has_language($self->canonical_language);
}
-=head2 stub_msgstr
+=method stub_msgstr
Returns the string passed to the constructor as C<stub_msgstr> if it was a
string, or a coderef wrapped to supply the C<canonical_msgstr> option if it was
@@ -163,7 +156,7 @@ sub stub_msgstr {
}
}
-=head2 has_language
+=method has_language
Returns true if a language file exists for the given language in the
C<base_dir>, false otherwise.
@@ -181,7 +174,7 @@ sub has_language {
return;
}
-=head2 add_language
+=method add_language
Creates a new language file for the language passed in as an argument. Creates
a header for that file copied over from the header in the C<canonical_language>
@@ -223,7 +216,7 @@ sub add_language {
$self->_add_file($pofile);
}
-=head2 language_file
+=method language_file
Returns the L<Locale::POFileManager::File> object corresponding to the given
language.
@@ -239,7 +232,7 @@ sub language_file {
});
}
-=head2 canonical_language_file
+=method canonical_language_file
Returns the L<Locale::POFileManager::File> object corresponding to the
C<canonical_language>.
@@ -251,7 +244,7 @@ sub canonical_language_file {
return $self->language_file($self->canonical_language);
}
-=head2 find_missing
+=method find_missing
Searches through all of the files in the C<base_dir>, and returns a hash
mapping language names to an arrayref of msgids that were found in the
@@ -271,7 +264,7 @@ sub find_missing {
return %ret;
}
-=head2 add_stubs
+=method add_stubs
Adds stub msgid (and possibly msgstr, if the C<stub_msgstr> option was given)
entries to each language file for each msgid found in the C<canonical_language>
@@ -335,16 +328,11 @@ L<http://search.cpan.org/dist/Locale-POFileManager>
=back
-=head1 AUTHOR
-
- Jesse Luehrs <doy at tozt dot net>
-
-=head1 COPYRIGHT AND LICENSE
+=begin Pod::Coverage
-This software is copyright (c) 2010 by Jesse Luehrs.
+BUILD
-This is free software; you can redistribute it and/or modify it under
-the same terms as perl itself.
+=end Pod::Coverage
=cut
diff --git a/lib/Locale/POFileManager/File.pm b/lib/Locale/POFileManager/File.pm
index 2b38cef..88bb4a0 100644
--- a/lib/Locale/POFileManager/File.pm
+++ b/lib/Locale/POFileManager/File.pm
@@ -1,5 +1,6 @@
package Locale::POFileManager::File;
use Moose;
+# ABSTRACT: A single .po file
use MooseX::Types::Path::Class qw(File);
use List::MoreUtils qw(any);
@@ -11,10 +12,6 @@ require Locale::Maketext::Lexicon;
Locale::Maketext::Lexicon::set_option(decode => 1);
Locale::Maketext::Lexicon::set_option(allow_empty => 1);
-=head1 NAME
-
-Locale::POFileManager::File - A single .po file
-
=head1 SYNOPSIS
use Locale::POFileManager;
@@ -40,9 +37,7 @@ manipulating the translation entries in it.
=cut
-=head1 METHODS
-
-=head2 new
+=method new
Accepts a hash of arguments:
@@ -62,7 +57,7 @@ and C<lang>. Optional.
=cut
-=head2 file
+=method file
Returns a L<Path::Class::File> object corresponding to the C<file> passed to
the constructor.
@@ -76,7 +71,7 @@ has file => (
required => 1,
);
-=head2 stub_msgstr
+=method stub_msgstr
Returns the C<stub_msgstr> passed to the constructor.
@@ -87,15 +82,15 @@ has stub_msgstr => (
isa => 'Str|CodeRef',
);
-=head2 msgids
+=method msgids
Returns a list of msgids found in the file.
-=head2 has_msgid
+=method has_msgid
Returns true if the given msgid is found in the file, and false otherwise.
-=head2 msgstr
+=method msgstr
Returns the msgstr that corresponds with the given msgid.
@@ -118,11 +113,11 @@ has lexicon => (
},
);
-=head2 headers
+=method headers
Returns the list of header entries.
-=head2 header
+=method header
Returns the value of the given header entry.
@@ -156,7 +151,7 @@ sub BUILD {
$self->headers;
}
-=head2 add_entry
+=method add_entry
Adds an entry to the translation file. Arguments are a hash, with valid keys
being C<msgid> and C<msgstr>.
@@ -182,7 +177,7 @@ sub add_entry {
$self->_add_lexicon_entry($msgid => $msgstr);
}
-=head2 language
+=method language
Returns the language that this file corresponds to.
@@ -195,7 +190,7 @@ sub language {
return $language;
}
-=head2 find_missing_from
+=method find_missing_from
Takes another translation file (either as a filename or as a
L<Locale::POFileManager::File> object), and returns a list of msgids that the
@@ -217,7 +212,7 @@ sub find_missing_from {
return @ret;
}
-=head2 add_stubs_from
+=method add_stubs_from
Takes another translation file (either as a filename or as a
L<Locale::POFileManager::File> object), and adds stubs for each msgid that the
@@ -244,16 +239,13 @@ sub add_stubs_from {
__PACKAGE__->meta->make_immutable;
no Moose;
-=head1 AUTHOR
-
- Jesse Luehrs <doy at tozt dot net>
+=pod
-=head1 COPYRIGHT AND LICENSE
+=begin Pod::Coverage
-This software is copyright (c) 2010 by Jesse Luehrs.
+BUILD
-This is free software; you can redistribute it and/or modify it under
-the same terms as perl itself.
+=end Pod::Coverage
=cut