[Rt-commit] r15788 - rt/3.8/trunk/sbin

clkao at bestpractical.com clkao at bestpractical.com
Sun Sep 7 22:29:12 EDT 2008


Author: clkao
Date: Sun Sep  7 22:29:12 2008
New Revision: 15788

Added:
   rt/3.8/trunk/sbin/merge-rosetta.pl

Log:
script for merging translation from rosetta.

Added: rt/3.8/trunk/sbin/merge-rosetta.pl
==============================================================================
--- (empty file)
+++ rt/3.8/trunk/sbin/merge-rosetta.pl	Sun Sep  7 22:29:12 2008
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+use strict;
+use LWP::Simple 'getstore';
+use Archive::Extract;
+use File::Temp;
+use File::Copy 'copy';
+
+my $url = shift or die 'must provide rosseta download url';
+
+my $dir = File::Temp::tempdir;
+my ($fname) = $url =~ m{([^/]+)$};
+print "Downloading $url\n";
+getstore($url => "$dir/$fname");
+print "Extracting $dir/$fname\n";
+my $ae = Archive::Extract->new(archive => "$dir/$fname");
+my $ok = $ae->extract( to => $dir );
+
+for (<$dir/rt/*.po>) {
+    my ($name) = m/([\w_]+)\.po/;
+    my $fname = "lib/RT/I18N/$name";
+
+    print "$_ -> $fname.po\n";
+    copy($_ => "$fname.po");
+}
+
+print "Merging new strings\n";
+system("$^X sbin/extract-message-catalog");


More information about the Rt-commit mailing list