Revision: 6543
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6543&view=rev
Author:   owes
Date:     2012-04-14 14:46:43 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
Textual modifications. Add flag for testing purposes.

Modified Paths:
--------------
    ipcop/trunk/tools/gen_strings.pl

Modified: ipcop/trunk/tools/gen_strings.pl
===================================================================
--- ipcop/trunk/tools/gen_strings.pl    2012-04-09 17:17:05 UTC (rev 6542)
+++ ipcop/trunk/tools/gen_strings.pl    2012-04-14 14:46:43 UTC (rev 6543)
@@ -1,29 +1,23 @@
 #!/usr/bin/perl
 #
-############################################################################
-#                                                                          #
-# This file is part of the IPCop Firewall.                                 #
-#                                                                          #
-# IPCop is free software; you can redistribute it and/or modify            #
-# it under the terms of the GNU General Public License as published by     #
-# the Free Software Foundation; either version 2 of the License, or        #
-# (at your option) any later version.                                      #
-#                                                                          #
-# IPCop is distributed in the hope that it will be useful,                 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
-# GNU General Public License for more details.                             #
-#                                                                          #
-# You should have received a copy of the GNU General Public License        #
-# along with IPCop; if not, write to the Free Software                     #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
-#                                                                          #
-# Copyright (C) 2004-03-12 Mark Wormgoor <m...@wormgoor.com>               #
-#                                                                          #
-############################################################################
+# This file is part of the IPCop Firewall.
 #
-# $Id$
+# IPCop is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
 #
+# IPCop is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Copyright (C) 2004-03-12 Mark Wormgoor <m...@wormgoor.com>
+# (c) 2006-2012 The IPCop Team
+#
 # Achim Weber - 12. August 2006:
 #   Merge and modify check_strings.pl and fetchlangs.pl to generate lang files
 #   which are only contain those lang entries which are really used.
@@ -49,6 +43,8 @@
 #         The original head/top comment (which language, license, authors, 
etc.)
 #         is written in every new lang file too.
 #
+# $Id$
+#
 
 my ( %tr_en, %tr_wanted, $basedir, $targetdir);
 our (%tr, %tr_new);
@@ -58,6 +54,8 @@
 use warnings;
 use strict;
 
+# Run script for single language only
+my $test = 0;
 
 # base and target dir given? Example target: build_i486_glibc/....
 if (defined($ARGV[0]) && defined($ARGV[1])) {
@@ -92,14 +90,19 @@
     my $lang = $temp[0];
     my $uclang = uc($lang);
     my $dir = $temp[1];
+    my $lang_full = $temp[2];
+
+    # TEST:
+    next if ($test && ($dir ne "de_DE"));
+
     if ( $dir ne "" ) {
-        print "Downloading files for " . $temp[2] . " ";
+        print "Downloading files for ${lang_full} ";
         system("mkdir -p $targetdir/${dir}");
 
         &wget_retry("install", ${uclang}, "$targetdir/${dir}");
         # generate temp .pl file for the installer texts
-        &po2pl( "$targetdir/${dir}/install.po.tmp",  
"$targetdir/${dir}/install.pl.tmp");
-        unlink( "$targetdir/${dir}/install.po.tmp");
+        &po2pl( "$targetdir/${dir}/install.po.tmp", 
"$targetdir/${dir}/install.pl.tmp");
+        unlink( "$targetdir/${dir}/install.po.tmp") unless ($test);
 
         # Patch TR_CONFIGURATION_LONG with new https port number
         # First, change https port from 445 to 8443
@@ -111,8 +114,8 @@
 
         &wget_retry("ipcop", ${uclang}, "$targetdir/${dir}");
         # generate temp .pl file for GUI texts
-        &po2pl( "$targetdir/${dir}/ipcop.po.tmp",  
"$targetdir/${dir}/ipcop.pl.tmp");
-        unlink( "$targetdir/${dir}/ipcop.po.tmp");
+        &po2pl( "$targetdir/${dir}/ipcop.po.tmp", 
"$targetdir/${dir}/ipcop.pl.tmp");
+        unlink( "$targetdir/${dir}/ipcop.po.tmp") unless ($test);
 
         system 
('sed','-i','-e','s/222/8022/',"$targetdir/${dir}/ipcop.pl.tmp");
 
@@ -232,11 +235,12 @@
         my @temp = split(/:/,$_);
         my $lang = $temp[0];
         my $locale = $temp[1];
+        my $lang_full = $temp[2];
         next if($locale eq "");
-        # DEBUG:
-#       next if($locale ne "en_GB");
-#       next if($locale ne "de_DE");
 
+        # TEST:
+        next if ($test && ($locale ne "de_DE"));
+
         my $file = "$file_typ.pl";
         my $relativePath_pl= "$locale/$file.tmp";
         my $relativePath_miss= "$locale/$file.missing";
@@ -247,13 +251,13 @@
             do "$targetdir/$relativePath_pl";
         }
         else {
-            print "\n Could not generate '$file_typ' lang file for " . 
$temp[2] . ". Tmp File not found.\n";
+            print "\n Could not generate '$file_typ' lang file for 
${lang_full}. Tmp File not found.\n";
         }
         my %tr_trans = %tr;
         print "Check for translated '$file_typ' en texts: ". (keys 
%tr_trans)." \n";
 
         # generate new lang file(s)
-        print "\nGenerate '$file_typ' lang file for " . $temp[2] . "\n";
+        print "\nGenerate '$file_typ' lang file for ${lang_full}\n";
         open(FILE_MISS,">$targetdir/$relativePath_miss") or die "Unable to 
write new $relativePath_miss file.";
         flock FILE_MISS, 2;
         open(FILE_GT,">$targetdir/$relativePath_gt") or die "Unable to write 
new '$locale' gettext file.";

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to