diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-02-18 12:15:53 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-02-18 12:15:53 -0600 |
commit | e7b0afa2f7b8cd45bfea000f2d2238497ce0f982 (patch) | |
tree | a15b33303f26bbcb5f21a5597087a4f25bbf1987 /lib/Locale/POFileManager/File.pm | |
parent | b3fa49c38792421b72d2ebb348ca6d48a5fd670a (diff) | |
download | locale-pofilemanager-e7b0afa2f7b8cd45bfea000f2d2238497ce0f982.tar.gz locale-pofilemanager-e7b0afa2f7b8cd45bfea000f2d2238497ce0f982.zip |
centralize the filename => lang mapping, and use it in more places
Diffstat (limited to 'lib/Locale/POFileManager/File.pm')
-rw-r--r-- | lib/Locale/POFileManager/File.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Locale/POFileManager/File.pm b/lib/Locale/POFileManager/File.pm index b3aa78b..64cb60c 100644 --- a/lib/Locale/POFileManager/File.pm +++ b/lib/Locale/POFileManager/File.pm @@ -38,6 +38,13 @@ sub save { Locale::PO->save_file_fromarray($self->file->stringify, [$self->entries]); } +sub language { + my $self = shift; + my $language = $self->file->basename; + $language =~ s{(.*)\.po$}{$1}; + return $language; +} + sub find_missing_from { my $self = shift; my ($other) = @_; |