summaryrefslogtreecommitdiffstats
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
parent599185df57b9ae0c16cddd3185cd27c2a05cd934 (diff)
downloadlocale-pofilemanager-4879437a0f628b3d685a3972695aed5011622ca4.tar.gz
locale-pofilemanager-4879437a0f628b3d685a3972695aed5011622ca4.zip
update dzil stuff
-rw-r--r--.gitignore10
-rw-r--r--Changes9
-rw-r--r--bin/po_add_stubs8
-rw-r--r--bin/po_find_missing8
-rw-r--r--dist.ini7
-rw-r--r--lib/Locale/POFileManager.pm42
-rw-r--r--lib/Locale/POFileManager/File.pm42
-rw-r--r--t/000-load.t11
8 files changed, 66 insertions, 71 deletions
diff --git a/.gitignore b/.gitignore
index bfd20cf..badbea1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,16 @@
cover_db
-META.yml
+META.*
+MYMETA.*
Makefile
blib
inc
pm_to_blib
MANIFEST
Makefile.old
+nytprof.out
+MANIFEST.bak
+*.sw[po]
+.build
+Locale-POFileManager-*
+*.bs
+*.o
diff --git a/Changes b/Changes
index 4ca03d8..70b2efd 100644
--- a/Changes
+++ b/Changes
@@ -1,12 +1,15 @@
Revision history for Locale::POFileManager
-0.03 02/24/2010
+{{$NEXT}}
+ Doc cleanups
+
+0.03 2010-02-24
Rewrite to use Locale::Maketext::Lexicon rather than Locale::PO. This
removes the ability to modify existing translations (modifications are
append-only now), but should make everything else more robust.
-0.02 02/21/2010
+0.02 2010-02-21
Depend on File::Temp 0.19 for the newdir method
-0.01 02/19/2010
+0.01 2010-02-19
Initial release
diff --git a/bin/po_add_stubs b/bin/po_add_stubs
index 3682fb9..1191053 100644
--- a/bin/po_add_stubs
+++ b/bin/po_add_stubs
@@ -1,6 +1,14 @@
#!/usr/bin/env perl
use strict;
use warnings;
+# PODNAME: po_add_stubs
+# ABSTRACT: add stubs for missing msgids to a set of po files
+
+=head1 SYNOPSIS
+
+ po_add_stubs <directory> <language>
+
+=cut
use Locale::POFileManager;
diff --git a/bin/po_find_missing b/bin/po_find_missing
index 38a9bb0..8b1bdb4 100644
--- a/bin/po_find_missing
+++ b/bin/po_find_missing
@@ -1,6 +1,14 @@
#!/usr/bin/env perl
use strict;
use warnings;
+# PODNAME: po_find_missing
+# ABSTRACT: find missing keys from a set of po files
+
+=head1 SYNOPSIS
+
+ po_find_missing <directory> <language>
+
+=cut
use Locale::POFileManager;
diff --git a/dist.ini b/dist.ini
index 9df46f8..a91bea4 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,13 +1,12 @@
name = Locale-POFileManager
-version = 0.03
author = Jesse Luehrs <doy at tozt dot net>
license = Perl_5
copyright_holder = Jesse Luehrs
-abstract = Helpers for keeping a set of related .po files in sync
-[@Classic]
+[@DOY]
+dist = Locale-POFileManager
-[Prereq]
+[Prereqs]
File::Temp = 0.19
List::MoreUtils = 0
Locale::Maketext::Lexicon = 0
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
diff --git a/t/000-load.t b/t/000-load.t
deleted file mode 100644
index c530ad0..0000000
--- a/t/000-load.t
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use Test::More;
-
-use_ok('Locale::POFileManager')
- or BAIL_OUT("couldn't load Locale::POFileManager");
-use_ok('Locale::POFileManager::File')
- or BAIL_OUT("couldn't load Locale::POFileManager::File");
-
-done_testing;