• R/O
  • SSH
  • HTTPS

miranda-jp: Commit


Commit MetaInfo

Revision90 (tree)
Zeit2012-06-30 20:00:02
Autortaguchi-ch

Log Message

add optional feature

Ändern Zusammenfassung

Diff

--- trunk/miranda-tools/lpgen/lpgen.pl (revision 89)
+++ trunk/miranda-tools/lpgen/lpgen.pl (revision 90)
@@ -39,8 +39,7 @@
3939 my $vermin = '';
4040 my $build = '';
4141
42-if (@ARGV && $ARGV[0] eq "version")
43-{
42+if (@ARGV && $ARGV[0] eq "version") {
4443 shift @ARGV;
4544 $vermaj = shift @ARGV;
4645 $vermin = shift @ARGV;
@@ -48,48 +47,37 @@
4847 }
4948 else
5049 {
51-#Get default version no. from m_version.h
50+#Get default version number from m_version.h
5251 ($vermaj, $vermin, $build) = get_version( $version_file );
5352 }
5453
55-# 1st arg version major i.e. 07 for "0.7"
56-if ($vermaj =~ /^([0-9]*)([0-9])$/)
57-{
58- if ($1 eq "")
59- {
60- $version = $2;
61- }
62- else
63- {
64- $version = "$1.$2";
65- }
66-}
67-else
68-{
69- $version = $vermaj;
70-}
71-# 2nd arg version minor i.e. 1 for "0.7.1"
72-if ($vermin =~ /^[0-9]+$/)
73-{
74- $version .= ".$vermin";
75-}
76-else
77-{
78- $version .= $vermin;
79-}
54+ # 1st arg version major i.e. 07 for "0.7"
55+ if ($vermaj =~ /^([0-9]*)([0-9])$/) {
56+ if ($1 eq "") {
57+ $version = $2;
58+ } else {
59+ $version = "$1.$2";
60+ }
61+ } else {
62+ $version = $vermaj;
63+ }
64+ # 2nd arg version minor i.e. 1 for "0.7.1"
65+ if ($vermin =~ /^[0-9]+$/) {
66+ $version .= ".$vermin";
67+ } else {
68+ $version .= $vermin;
69+ }
8070
81-# 3rd arg build number i.e. 36 for "0.7.1 build 36"
82-if ($build =~ /^[0-9]+$/)
83-{
84- $version .= " build $build";
85-}
86-else
87-{
88- $version .= $build;
89-}
71+ # 3rd arg build number i.e. 36 for "0.7.1 build 36"
72+ if ($build =~ /^[0-9]+$/) {
73+ $version .= " build $build";
74+ } else {
75+ $version .= $build;
76+ }
9077
9178 #Language Files
92-if (!@ARGV) {
79+#If you want to get keywords from *trans*.txt also, set Options '/all' or 'version xx xx xx /all'.
80+if (!@ARGV || $ARGV[0] eq "/all" ) {
9381 create_langfile(
9482 '../../miranda',
9583 '../../miranda/i18n/langpack_english.txt',
@@ -138,7 +126,10 @@
138126 print "Building language file for $rootdir:\n";
139127 find({ wanted => \&csearch, preprocess => \&pre_dir }, $rootdir);
140128 find({ wanted => \&rcsearch, preprocess => \&pre_dir }, $rootdir);
141- find({ wanted => \&txtsearch, preprocess => \&pre_dir }, $rootdir);
129+ if( @ARGV && $ARGV[0] eq "/all" )
130+ {
131+ find({ wanted => \&txtsearch, preprocess => \&pre_dir }, $rootdir);
132+ }
142133
143134 open(WRITE, "> $outfile") or die;
144135 print WRITE <<HEADER;
@@ -191,7 +182,6 @@
191182 sub append_str {
192183 my $str = shift(@_);
193184 my $found = shift(@_);
194-# $str = substr($str, 1, length($str) - 2);
195185 if (length($str) gt 0 and $str ne "List1" and $str ne "Tree1" and $str =~ /[a-zA-Z]+/g) {
196186 my $path = $File::Find::name;
197187 $path =~ s/(\.\.\/)+miranda\///;
@@ -222,6 +212,7 @@
222212 }
223213 close(READ);
224214 $_ = $all;
215+ s/\\\n//g;
225216 while (/(?:Button_SetIcon_IcoLib|Translate[A-Z]{0,2}|LPGENT?|ICQTranslateUtfStatic)\s*\(\s*\"([^\\]*?(\\.[^\\]*?)*)\"\s*[,\)]/g) {
226217 $found += append_str($1, $found);
227218 }
@@ -261,7 +252,6 @@
261252 }
262253 close(READ);
263254 $_ = $all;
264-# while ( /(\[.*?\])\n/g ) {
265255 while ( /\[(.*?)\]\n/g ) {
266256 $found += append_str($1, $found);
267257 }
@@ -268,6 +258,7 @@
268258 print "($found)\n";
269259 }
270260 }
261+
271262 sub get_version
272263 {
273264 my $version_file = shift(@_);
Show on old repository browser