From 5c3092f1838b4e4331dadc228aac6147a9bf24e4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 19 Feb 2010 15:51:06 -0600 Subject: a few cleanups --- lib/Locale/POFileManager.pm | 8 ++++---- lib/Locale/POFileManager/File.pm | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Locale/POFileManager.pm b/lib/Locale/POFileManager.pm index 573cf1c..811105f 100644 --- a/lib/Locale/POFileManager.pm +++ b/lib/Locale/POFileManager.pm @@ -29,9 +29,9 @@ has files => ( builder => '_build_files', init_arg => undef, handles => { - files => 'elements', - first_file => 'first', - _add_file => 'push', + files => 'elements', + _first_file => 'first', + _add_file => 'push', }, ); @@ -131,7 +131,7 @@ sub language_file { my $self = shift; my ($lang) = @_; - return $self->first_file(sub { + return $self->_first_file(sub { $_->language eq $lang; }); } diff --git a/lib/Locale/POFileManager/File.pm b/lib/Locale/POFileManager/File.pm index fd1575b..368025b 100644 --- a/lib/Locale/POFileManager/File.pm +++ b/lib/Locale/POFileManager/File.pm @@ -40,12 +40,6 @@ sub _build_entries { return (-r $filename) ? Locale::PO->load_file_asarray($filename) : []; } -sub entry_for { - my $self = shift; - my ($msgid) = @_; - return first { $_->msgid eq '"' . $msgid . '"' } $self->entries; -} - sub add_entry { my $self = shift; if (@_ == 1) { @@ -58,6 +52,12 @@ sub add_entry { } } +sub entry_for { + my $self = shift; + my ($msgid) = @_; + return first { $_->msgid eq '"' . $msgid . '"' } $self->entries; +} + sub save { my $self = shift; -- cgit v1.2.3