ort translations from rails i18n project
use strict;
use warnings;
use utf8;
use YAML::Syck;
use JSON::PP;
use File::Find;
use FindBin;
use Cwd;
sub convert_one_locale {
my ($code, $input_file,
);
for my $k (keys %lexicon) {
$lexicon{$k} =~ s/%\{count\}/%1/g;
}
my $j = JSON::PP->new;
open(my $fh, ">", $output_file) or die "$output_file: $!";
print $fh $j->encode
{
/([^\/]+)\.yml/ or return;
my $code = $1;
my $output_file = "$out_i18n_dir/$code.json";
eval {
convert_one_locale($code, $File::Find::name, $output_file);
1;
his list as long as you also provide
a path (string) for C<i18n_dir> pointing to a directory with JSON files that
are recongized by L<Locale::Wolowitz>.
=head2 distance($from_time, $to_time)
Returns
just a bunch of JSON text files that you can locate with this command:
perl -MTime::Verbal -E 'say Time::Verbal->i18n_dir'
In case you need to provide your own translation JSON files, you may s
"/app/awesome/i18n");
Your should start by copying and modify one of the JSON file under
C<Time::Verbal->i18n_dir>. The JSON file should be named after the
language code as a good convention, but th