Paul Vriens wrote:
Alexandre Julliard wrote:
Paul Vriens paul.vriens.wine@gmail.com writes:
- LANG_XXX, SUBLANG_DEFAULT (only 1 sublanguage in our code) should
show LANG_XXX, SUBLANG LANG_XXX_YYY.
- LANG_XXX, SUBLANG_DEFAULT (multiple sublanguages in our code)
should show all possible LANG_XXX, SUBLANG_XXX_YYY.
There's nothing special about SUBLANG_DEFAULT, it's just the first
sublanguage.
Yeah, and it's not needed as you say. The only cases we need to cover
are the SUBLANG_NEUTRAL ones that are converted to sublanguages if we
have some.
The current code made that a mood argument as well as in ver.pl we only
cover the SUBLANG_NEUTRAL cases as special ones and as said just
creating some files in scripts/conf made it work.
I propose the following changes:
- The first thing that should happen before any parsing is done is to
get a list of all the different languages Wine is translated in.
That should be a result of the parsing, I don't see why you'd need to do
this first.
Well, I was trying not to be too invasive here. Currently we do:
- Go through the makefiles
a. run "wrc --verify-translation
b. run ver.pl
Step 1b currently needs the complete list of translations in the source
to do it's work properly.
So maybe we should change that approach into:
- Go through the makefiles
a. run "wrc --verify-translation"
b. create an hash/array/whatever of translations in the source
- Loop through the results of the "wrc --verify-translation" runs.
a. run ver.pl
We of course need that same list of translations in the php-scripts. The
good things is that already have that in the form of files in the
php/langs directory (created by ver.pl).
Something like the attached splits the loop. We now need to pass that
array (string) to ver.pl.
Or do you have some other idea's how this could/should be solved.
--
Cheers,
Paul.
diff --git a/transl/scripts/checkmakefile.pl b/transl/scripts/checkmakefile.pl
index bdc9fcf..3e7cf03 100755
--- a/transl/scripts/checkmakefile.pl
+++ b/transl/scripts/checkmakefile.pl
@@ -22,6 +22,9 @@ sub shell($)
}
}
+my @all_dirs;
+my @all_langs;
+
sub mycheck
{
my($dir) = shift(@_);
@@ -69,15 +72,32 @@ sub mycheck
shell "make -C $objdir/$dir -s $targets";
shell "$toolsdir/tools/winebuild/winebuild --resources -o $workdir/dumps/res/$norm_fn.res $objs";
- shell "$wrc $incl --verify-translation $defs $srcs >$workdir/ver.txt";
+ shell "$wrc $incl --verify-translation $defs $srcs >$workdir/ver_$norm_fn.txt";
- if ("$dir" eq "dlls/kernel32") {
- shell "$scriptsdir/ver.pl "$dir" "$workdir" nonlocale $scriptsdir <$workdir/ver.txt";
- print STDERR "*** $dir [$defs] (locale run)\n";
- shell "$scriptsdir/ver.pl "$dir" "$workdir" locale $scriptsdir <$workdir/ver.txt";
- } else {
- shell "$scriptsdir/ver.pl "$dir" "$workdir" normal $scriptsdir <$workdir/ver.txt";
+ push @all_dirs, $dir;
+
+ my $verify_file = "$workdir/ver_$norm_fn.txt";
+ if ("$dir" eq "dlls/kernel32")
+ {
+ $verify_file = "$workdir/ver_no_locale_$norm_fn.txt";
+ # Don't check the nls files as they contain all languages
+ $srcs =~ s/$srcdir/$dir/locale_rc.rc//g;
+ shell "$wrc $incl --verify-translation $defs $srcs >$verify_file";
+ }
+
+ open(VERIFY, "<$verify_file");
+ while (<VERIFY>)
+ {
+ if (/^EXIST (.*)$/)
+ {
+ chomp($1);
+ if (!grep (/$1/, @all_langs))
+ {
+ push @all_langs, $1;
+ }
+ }
}
+ close(VERIFY);
}
srand();
@@ -175,3 +195,19 @@ foreach my $makefile (@makefiles)
close MAKEFILE;
&mycheck($path,$defs,@files) if @files;
}
+
+@all_langs = sort(@all_langs);
+
+foreach my $dir (@all_dirs)
+{
+ my $norm_fn = $dir;
+ $norm_fn =~ s/[^a-zA-Z0-9]/-/g;
+
+ if ("$dir" eq "dlls/kernel32") {
+ shell "$scriptsdir/ver.pl "$dir" "$workdir" nonlocale $scriptsdir <$workdir/ver_$norm_fn.txt";
+ print STDERR "*** $dir (locale run)\n";
+ shell "$scriptsdir/ver.pl "$dir" "$workdir" locale $scriptsdir <$workdir/ver_$norm_fn.txt";
+ } else {
+ shell "$scriptsdir/ver.pl "$dir" "$workdir" normal $scriptsdir <$workdir/ver_$norm_fn.txt";
+ }
+}