[interchange-cvs] interchange - racke modified 2 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Wed May 28 10:42:01 2003


User:      racke
Date:      2003-05-28 14:41:25 GMT
Modified:  .        Makefile.PL
Modified:  scripts  localize.PL
Log:
-s option added to localize script

Revision  Changes    Path
2.38      +1 -1      interchange/Makefile.PL


rev 2.38, prev_rev 2.37
Index: Makefile.PL
===================================================================
RCS file: /anon_cvs/repository/interchange/Makefile.PL,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -r2.37 -r2.38
--- Makefile.PL	8 Apr 2003 22:47:07 -0000	2.37
+++ Makefile.PL	28 May 2003 14:41:24 -0000	2.38
@@ -801,7 +801,7 @@
 		lang=`basename $$langfile .cfg`; \
 		mv $$langfile $$langfile.old; \
 		cat $(UILCDIR)/default.cfg >> $$langfile.old; \
-		if ! $(INSTALLBIN)/localize -n -m $$langfile.old -u $(UIMENUDIR) -l $$lang `find $(UIDIR) -type f -not -empty` > $$langfile; then \
+		if ! $(INSTALLBIN)/localize -n -s -m $$langfile.old -u $(UIMENUDIR) -l $$lang `find $(UIDIR) -type f -not -empty` > $$langfile; then \
 		echo "Failed to generate locale file $$langfile"; \
 		mv $$langfile.old $$langfile; \
 		fi; \



2.6       +15 -7     interchange/scripts/localize.PL


rev 2.6, prev_rev 2.5
Index: localize.PL
===================================================================
RCS file: /anon_cvs/repository/interchange/scripts/localize.PL,v
retrieving revision 2.5
retrieving revision 2.6
diff -u -r2.5 -r2.6
--- localize.PL	1 Apr 2003 22:24:30 -0000	2.5
+++ localize.PL	28 May 2003 14:41:25 -0000	2.6
@@ -3,7 +3,7 @@
 #
 # Interchange localizer
 #
-# $Id: localize.PL,v 2.5 2003/04/01 22:24:30 racke Exp $
+# $Id: localize.PL,v 2.6 2003/05/28 14:41:25 racke Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 # Copyright (C) 2003 ICDEVGROUP <interchange@icdevgroup.org>
@@ -32,7 +32,7 @@
 use Vend::Util qw(readfile escape_chars);
 require Vend::Config;
 use Getopt::Std;
-use vars qw($opt_c $opt_d $opt_l $opt_M $opt_m $opt_n $opt_o $opt_t $opt_u);
+use vars qw($opt_c $opt_d $opt_l $opt_M $opt_m $opt_n $opt_o $opt_s $opt_t $opt_u);
 
 BEGIN {
 	($Global::VendRoot = $ENV{MINIVEND_ROOT})
@@ -52,7 +52,7 @@
 my $USAGE = <<EOF;
 $0 -- produce localization file from set of pages
 
-usage:    localize -l lg_CC [-d lg_CC] [-m file|-t] [-u dir] file [file2 file3 ...]
+usage:    localize -l lg_CC [-d lg_CC|-s] [-m file|-t] [-u dir] file [file2 file3 ...]
 
 OPTIONS
 
@@ -66,6 +66,7 @@
                when in regular mode, strip MM_ from [LC] defs
     -o         Rewrite [L] sections with [L msgNNNN], adjust file and data
                -- mutually exclusive with -c
+    -s         Suppress default locale.
     -t         Two page mode, mutually exclusive with -m 
     -u <dir>   UI directory, e.g. /usr/lib/interchange/lib/UI. This can
 	           be used to include the menu titles in the output.
@@ -87,7 +88,7 @@
 
 EOF
 
-getopts('cd:l:Mm:notu:') or die "$USAGE\n";
+getopts('cd:l:Mm:nostu:') or die "$USAGE\n";
 
 die "$USAGE\n" if $@;
 die "$USAGE\n" unless $opt_l;
@@ -333,8 +334,14 @@
 		$dat = ($Comment{$key} || '') and
 			$dat =~ s/\n/\n# /g;
 
-		$def_text .= "# $dat\n" if $dat;
-
+		if ($dat) {
+			if ($opt_s) {
+				$loc_text .= "# $dat\n";
+			} else {
+				$def_text .= "# $dat\n";
+			}
+		}
+		
         unless ($opt_n) {
 		    if ($dat) {
 			    $cmt = $dat;
@@ -355,6 +362,7 @@
 					 :  'undef';
 		$loc_text .= ",\n\n";
 
+		next if $opt_s;
 		next unless $Comment{$key};
 		$def_text .= "$text,\n";
 		$def_text .= &$Uneval($Comment{$key});
@@ -375,7 +383,7 @@
 
 =head1 VERSION
 
-# $Id: localize.PL,v 2.5 2003/04/01 22:24:30 racke Exp $
+# $Id: localize.PL,v 2.6 2003/05/28 14:41:25 racke Exp $
 
 =head1 SYNOPSIS