X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ea970889e5cdf8c24d3b0948055667c3716482f6..69b586a8f4b1cffd01f92553a171552d399ef6a5:/script/locale/merge-from-translatewiki?ds=sidebyside diff --git a/script/locale/merge-from-translatewiki b/script/locale/merge-from-translatewiki index 6f0120a45..ab89b61d9 100644 --- a/script/locale/merge-from-translatewiki +++ b/script/locale/merge-from-translatewiki @@ -30,6 +30,9 @@ merge-from-translatewiki - Get new translations from L config/locales$ for i in $(ls *yml | grep -v en.yml); do perl ../../script/locale/diff --dump-flat $i > $i.0 ;done # Merge and find out what changed: + rails_port$ perl script/locale/merge-from-translatewiki --locales-dir config/locales + + # Or, more complexy: rails_port$ for i in $(svn st config/locales/ | egrep '^M|\\?' | awk '{print $2}' | grep 'yml$'); do rm -v $i; done && svn up config/locales && perl script/locale/merge-from-translatewiki --locales-dir config/locales && svn st config/locales # Diff: @@ -51,7 +54,7 @@ Print this help message. =item --locales-dir -The locales dir we'll merge stuff into. E.g. C. +The locales dir we'll merge stuff into. F by default. =item --only-new @@ -70,14 +73,14 @@ Getopt::Long::Parser->new( config => [ qw< bundling no_ignore_case no_require_order pass_through > ], )->getoptions( 'h|help' => \my $help, - 'locales-dir=s' => \my $locales_dir, + 'locales-dir=s' => \(my $locales_dir = 'config/locales'), 'only-new' => \my $only_new, ) or help(); # On --help help() if $help; -help() unless $locales_dir; +help() unless $locales_dir and -d $locales_dir; ### ### Main @@ -207,7 +210,6 @@ sub spit_out my $yaml_out = Dump $data; open my $fh, ">", $file; - say $fh "# Imported at " . (scalar localtime) . " from Translatewiki.net"; print $fh $yaml_out; close $fh; }