[Miranda-jp-cvs] commit-notify[45] add subprocess txtsearch

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2012年 5月 24日 (木) 20:38:13 JST


Revision: 45
          http://sourceforge.jp/projects/miranda-jp/scm/svn/commits/45
Author:   taguchi-ch
Date:     2012-05-24 20:38:13 +0900 (Thu, 24 May 2012)
Log Message:
-----------
add subprocess txtsearch

Modified Paths:
--------------
    trunk/miranda-tools/lpgen/lpgen.pl

-------------- next part --------------
Modified: trunk/miranda-tools/lpgen/lpgen.pl
===================================================================
--- trunk/miranda-tools/lpgen/lpgen.pl	2012-05-24 11:34:44 UTC (rev 44)
+++ trunk/miranda-tools/lpgen/lpgen.pl	2012-05-24 11:38:13 UTC (rev 45)
@@ -138,6 +138,8 @@
 	print "Building language file for $rootdir:\n";
 	find({ wanted => \&csearch, preprocess => \&pre_dir }, $rootdir);
 	find({ wanted => \&rcsearch, preprocess => \&pre_dir }, $rootdir);
+	find({ wanted => \&txtsearch, preprocess => \&pre_dir }, $rootdir);
+
 	open(WRITE, "> $outfile") or die;
 	print WRITE <<HEADER;
 Miranda Language Pack Version 1
@@ -247,6 +249,24 @@
 	}
 }
 
+sub txtsearch {
+	if ( -f $_ and $_ =~ m/.*?trans.*?\.txt$/i) {
+		my $found = 0;
+		my $file = $_;
+		print "  Processing $_ ";
+		open(READ, "< $_") or return;
+		my $all = '';
+		while (my $lines = <READ>) {
+			$all = $all.$lines;
+		}
+		close(READ);
+		$_ = $all;
+		while ( /(\[.*?\])\n/g ) {
+			$found += append_str($1, $found);
+		}
+		print "($found)\n";
+	}
+}
 sub get_version
 {
 	my $version_file = shift(@_);



Miranda-jp-cvs メーリングリストの案内
Back to archive index