App-I18N

 view release on metacpan or  search on metacpan

lib/App/I18N/Command/Gen.pm  view on Meta::CPAN

package App::I18N::Command::Gen;
use warnings;
use strict;
use Cwd;
use App::I18N::Config;
use App::I18N::Logger;
use File::Basename;
use File::Path qw(mkpath);
use File::Find::Rule;
use DateTime;
use base qw(App::I18N::Command);

sub options { (
    'podir=s'  => 'podir',
    'locale'  => 'locale',
    'output=s' => 'output_dir',
    ) }


# XXX: provide template option ?

lib/App/I18N/Command/Gen.pm  view on Meta::CPAN

Static JS

    var dict;
    dict["en"] = { ...  };
    dict["zh_tw"] = { ... };

=cut


sub _warnings {
    my $now = DateTime->now;
    return <<END;
THIS FILE IS AUTO-GENERATED BY APP::I18N, PLEASE DONT MODIFY THIS DIRECTLY.
YOU SHOULD MODIFY PO FILES.
LAST UPDATE: $now
END
}

sub run {
    my ( $self, $type ) = @_;

lib/App/I18N/I18N.pm  view on Meta::CPAN

#     my $loc_method = sub {
#         # Retain compatibility with people using "-e _" etc.
#         return \*_ unless @_; # Needed for perl 5.8
# 
#         # When $_[0] is undef, return undef.  When it is '', return ''.
#         no warnings 'uninitialized';
#         return $_[0] unless (length $_[0]);
# 
#         local $@;
#         # Force stringification to stop Locale::Maketext from choking on
#         # things like DateTime objects.
#         my @stringified_args = map {"$_"} @_;
#         my $result = eval { ${$dlh}->maketext(@stringified_args) };
#         if ($@) {
#             warn $@;
#             # Sometimes Locale::Maketext fails to localize a string and throws
#             # an exception instead.  In that case, we just return the input.
#             return join(' ', @stringified_args);
#         }
#         return $result;
#     };



( run in 0.248 second using v1.01-cache-2.11-cpan-05444aca049 )