Re: stattrans.pl improvements

2001-09-11 Thread Gerfried Fuchs
On Mon, Sep 10, 2001, Matt Kraai wrote:
> On Mon, Sep 10, 2001 at 07:00:48PM +0200, Gerfried Fuchs wrote:
> I just realized that the translated/not translated and
> up-to-date/outdated column pairs with always share the same color,
> so there is no need to calculate it twice.

 Now that you notice it, I thougt about it and came to the same result.

> Actually, this was generated by an old version of the script.
> I've regenerated, and the percentages are now correct.

 Yes, they look really fine now.

> If it is really confusing, I'd rather restructure the table as
> follows:
> 
> Language  Translated  UntranslatedUp-to-date  Out-of-date
> 
> Catalan (ca)  18 (1%) 953 (98%)   14 (77%)4 (22%)
> ...
> Turkish (tr)  30 (3%) 941 (96%)   24 (80%)6 (20%)

 That could help, I guess - on the other hand, I think up-to-date and
outdated should be next to translated (for they are both related to
translated) - so having untranslated first would help there, I guess.
But that might just be me.  I would even try if maybe having up-to-date
and outdated in one single tabledata would help, seperated with a 

 Hmm, tried it, doesn't really look that good, forget it :)

 So long,
Alfie
-- 
 You never learn anything  |   /"\   ,'~~.
   by doing it right.  |  / chaos \  alfie.ist.org   |o ?~\
   -- unknown  |  \inside!/  [EMAIL PROTECTED]  /_   ~<\
   |   \_/   \__,~ \>



Re: stattrans.pl improvements

2001-09-10 Thread Matt Kraai
On Mon, Sep 10, 2001 at 07:00:48PM +0200, Gerfried Fuchs wrote:
> On Mon, Sep 10, 2001, Matt Kraai wrote:
> > The first hunk of this patch calculates the percentages of
> > up-to-date and outdated pages relative to the number of pages
> > translated into that language, rather than the total number of
> > pages.
> > 
> > The first part of the second hunk inverts the colorization of the
> > outdated and untranslated pages so that they are green when things
> > are good (i.e., no outdated/untranslated page) and red when things
> > are bad.
> 
>  Yes, that tweak sounds really reasonable.

I just realized that the translated/not translated and
up-to-date/outdated column pairs with always share the same color,
so there is no need to calculate it twice.

> > The second part of second hunk eliminates the special case for
> > English so that its translation statistics are also displayed on
> > the index page.
> 
>  Whooo!  This is all I ever wanted, and what we really need. I once
> asked about it and was frowned upon - but I think people will see that
> it helps us - like, people with originals in their language can now check
> if they forgot to update the english version, finally!

Glad to hear that it will help.

> > You can see the results of these changes at
> > http://opensource.lineo.com/~kraai/stats/.  Are any/all of these
> > changes OK?
> 
>  There is one little mistake in this page (I guess then, in the script,
> too):  The untranslated files have the same % like the translated files,
> although the numbers differ.  The translated % seems to be the correct
> one.

Actually, this was generated by an old version of the script.
I've regenerated, and the percentages are now correct.

>  Maybe you should add a second  row below "Up to date" and
> "Outdated" which says "percents relative to translated" or such, to not
> let come up any confusion.  Maybe in a small font or such.

If it is really confusing, I'd rather restructure the table as
follows:

LanguageTranslated  Untranslated
Up-to-date  Out-of-date

Catalan (ca)18 (1%) 953 (98%)
14 (77%)4 (22%)
...
Turkish (tr)30 (3%) 941 (96%)
24 (80%)6 (20%)

Anyway, here is a slightly improved patch.  It's output
(up-to-date this time) is available at the same place.  It also
changes the percentage calculation so that they always add up to
100 (it rounds pessimistically).

Matt

Index: stattrans.pl
===
RCS file: /cvs/webwml/webwml/stattrans.pl,v
retrieving revision 1.25
diff -u -r1.25 stattrans.pl
--- stattrans.pl2001/09/07 21:46:20 1.25
+++ stattrans.pl2001/09/10 18:12:51
@@ -260,10 +260,10 @@
 $wml{$lang} = $translated{$lang};
 $translated{$lang} = $translated{$lang} - $outdated{$lang};
 
-$percent_a{$lang} = $wml{$lang}/$wml{english} * 100;
-$percent_t{$lang} = $translated{$lang}/$wml{english} * 100;
-$percent_o{$lang} = $outdated{$lang}/$wml{english} * 100;
-$percent_u{$lang} = $untranslated{$lang}/$wml{english} * 100;
+$percent_a{$lang} = int($wml{$lang}/$wml{english} * 100);
+$percent_t{$lang} = int($translated{$lang}/$wml{$lang} * 100);
+$percent_o{$lang} = 100 - $percent_t{$lang};
+$percent_u{$lang} = 100 - $percent_a{$lang};
 
 if (open (HTML, ">$config{'htmldir'}/$l.html")) {
printf HTML "%s: %s\n", $config{'title'}, ucfirst $lang;
@@ -331,19 +331,13 @@
 
 $color_a = get_color ($percent_a{$lang});
 $color_t = get_color ($percent_t{$lang});
-$color_o = get_color ($percent_o{$lang});
-$color_u = get_color ($percent_u{$lang});
 
 print HTML "";
 printf HTML "%s (%s)", $l, ucfirst $lang, 
$l;
 printf HTML "%d (%d%%)", $color_a, 
$wml{$lang}, $percent_a{$lang};
-if ($l ne "en") {
-  printf HTML "%d (%d%%)", $color_t, 
$translated{$lang}, $percent_t{$lang};
-  printf HTML "%d (%d%%)", $color_o, 
$outdated{$lang}, $percent_o{$lang};
-  printf HTML "%d (%d%%)", $color_u, 
$untranslated{$lang}, $percent_u{$lang};
-} else {
-  print HTML "---";
-}
+printf HTML "%d (%d%%)", $color_t, 
$translated{$lang}, $percent_t{$lang};
+printf HTML "%d (%d%%)", $color_t, 
$outdated{$lang}, $percent_o{$lang};
+printf HTML "%d (%d%%)", $color_a, 
$untranslated{$lang}, $percent_u{$lang};
 print HTML "\n",
 }
 



Re: stattrans.pl improvements

2001-09-10 Thread Josip Rodin
On Mon, Sep 10, 2001 at 10:26:29AM -0600, Matt Kraai wrote:
> The second part of second hunk eliminates the special case for
> English so that its translation statistics are also displayed on
> the index page.

When I made that special case it didn't occur to me that English would have
anything other than 100%, sorry about that.

It would be cool to have everything handle original= settings properly :o)

-- 
 2. That which causes joy or happiness.



Re: stattrans.pl improvements

2001-09-10 Thread Gerfried Fuchs
Hi!

On Mon, Sep 10, 2001, Matt Kraai wrote:
> The first hunk of this patch calculates the percentages of
> up-to-date and outdated pages relative to the number of pages
> translated into that language, rather than the total number of
> pages.
> 
> The first part of the second hunk inverts the colorization of the
> outdated and untranslated pages so that they are green when things
> are good (i.e., no outdated/untranslated page) and red when things
> are bad.

 Yes, that tweak sounds really reasonable.

> The second part of second hunk eliminates the special case for
> English so that its translation statistics are also displayed on
> the index page.

 Whooo!  This is all I ever wanted, and what we really need. I once
asked about it and was frowned upon - but I think people will see that
it helps us - like, people with originals in their language can now check
if they forgot to update the english version, finally!


> You can see the results of these changes at
> http://opensource.lineo.com/~kraai/stats/.  Are any/all of these
> changes OK?

 There is one little mistake in this page (I guess then, in the script,
too):  The untranslated files have the same % like the translated files,
although the numbers differ.  The translated % seems to be the correct
one.

> Unfixed by this patch, non-English originals with no English
> translation are not included in any of the statistics.  I'm
> planning to fix that.

 Sounds reasonable and good.  If there is an orig next to the
translation-check it should be considered correctly.

 Maybe you should add a second  row below "Up to date" and
"Outdated" which says "percents relative to translated" or such, to not
let come up any confusion.  Maybe in a small font or such.

 Something along these lines:

---
--- stattrans.pl2001/09/07 21:46:20 1.25
+++ stattrans.pl2001/09/10 16:59:36
@@ -324,7 +324,8 @@
 
 print HTML $border_head;
 print HTML "\n";
-print HTML "LanguageTranslationsUp to 
dateOutdatedNot translated\n";
+print HTML "LanguageTranslationsUp to dateOutdatedNot translated\n";
+print HTML "percents relative to 
translated\n";
 foreach $lang (@search_in) {
 $l = $langs{$lang};
 $l = "zh-cn" if ($l eq "zh"); # kludge
---

 That should do the trick.
Alfie 
-- 
 You never learn anything  |   /"\   ,'~~.
   by doing it right.  |  / chaos \  alfie.ist.org   |o ?~\
   -- unknown  |  \inside!/  [EMAIL PROTECTED]  /_   ~<\
   |   \_/   \__,~ \>



Re: stattrans.pl improvements

2001-09-10 Thread Denis Barbier
On Mon, Sep 10, 2001 at 10:26:29AM -0600, Matt Kraai wrote:
> Howdy,

Hi Matt,

> The first hunk of this patch calculates the percentages of
> up-to-date and outdated pages relative to the number of pages
> translated into that language, rather than the total number of
> pages.

Does not seem to work, on your webpage uptodate==outdated and
translated==nottranslated.

> The first part of the second hunk inverts the colorization of the
> outdated and untranslated pages so that they are green when things
> are good (i.e., no outdated/untranslated page) and red when things
> are bad.

Good.

> The second part of second hunk eliminates the special case for
> English so that its translation statistics are also displayed on
> the index page.

Good.

Denis