[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-471-g1eb2fcb

Shawn Moore sartak at bestpractical.com
Tue Nov 16 17:07:16 EST 2010


The branch, 3.9-trunk has been updated
       via  1eb2fcb5874d3776326ce120e6415f090bca14ee (commit)
      from  59b44f437e182eeacea9f12b70e10ce49da3511d (commit)

Summary of changes:
 sbin/rt-message-catalog |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 1eb2fcb5874d3776326ce120e6415f090bca14ee
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Nov 16 17:07:31 2010 -0500

    Factor out PO_DIR and update it to share/po

diff --git a/sbin/rt-message-catalog b/sbin/rt-message-catalog
index 1c76db5..f656e84 100755
--- a/sbin/rt-message-catalog
+++ b/sbin/rt-message-catalog
@@ -53,6 +53,8 @@ use Locale::PO;
 use Getopt::Long;
 use File::Temp 'tempdir';
 
+use constant PO_DIR => 'share/po';
+
 my %commands = (
     stats   => { },
     shrink  => { 'update!' => 1, 'keep=s@' => [] },
@@ -82,7 +84,7 @@ exit;
 
 sub stats {
     my %opt = %{ shift() };
-    my $dir = shift || 'lib/RT/I18N';
+    my $dir = shift || PO_DIR;
 
     my $max = 0;
     my %res = ();
@@ -126,7 +128,7 @@ sub stats {
 
 sub shrink {
     my %opt = %{ shift() };
-    my $dir = shift || 'lib/RT/I18N';
+    my $dir = shift || PO_DIR;
 
     my %keep = map { $_ => 1 } @{ $opt{'keep'} };
 
@@ -221,7 +223,7 @@ sub rosetta {
 
     for ( @files ) {
         my ($lang) = m/([\w_]+)\.po/;
-        my $fn_orig = "lib/RT/I18N/$lang.po";
+        my $fn_orig = PO_DIR . "/$lang.po";
 
         print "$_ -> $fn_orig\n";
 
@@ -231,7 +233,7 @@ sub rosetta {
         my $ext = Locale::Maketext::Extract->new;
         $ext->read_po($tmp);
 
-        my $po_orig = Locale::PO->load_file_ashash( -e $fn_orig? $fn_orig : 'lib/RT/I18N/rt.pot' );
+        my $po_orig = Locale::PO->load_file_ashash( -e $fn_orig? $fn_orig : PO_DIR . '/rt.pot' );
         # don't want empty vales to override ours.
         # don't want fuzzy flag as when uploading to rosetta again it's not accepted by rosetta.
         foreach my $msgid ($ext->msgids) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list