Re: http://www.gnome.org/i18n/ is outdated



Christian Rose <menthos@gnome.org> writes:

> Absolutely, but keeping that page uptodate is major work. Also, GNOME
> 2.6 will be released soon, and then we need to update that page again,
> this time with 2.6 stats.

Actually, I have a script that's supposed to make this easier.

I'm attaching it so if anyone wants to periodically update the list,
it would be great I think.

Basically, you need to get index.wml for the current page (index.html
gotten from http://gnome.org/i18n/ will do as well -- it's important
to have those language names in a list, with native names encoded
using entities), and current "essential.html" (from
 d.g.o/projects/gtp/status/gnome-2.(4|6)
).  After that, you just put them all in one directory (index.wml or
index.html renamed to index.wml, essential.html), and run:
 ./list essential.html

You'll get the list you may insert into index.wml in CVS, and
completely current and correct (depending on what essential.html you
used, of course).

Hope anyone wants to pick this up, and that this little script does
help them with it.

Cheers,
Danilo

#!/usr/bin/perl
$langset=0;
while (<>) {
    if ($langset) {
	if (/teamerror\">([0-9]{1,3}\.[0-9]{2})%<\/font>/) {
	    $number++;
	    $percent=$1;
	    if ($number==3) { # we're looking for the third occurence of this same string
		if ($percent>=80.0) {
		    push @support,$langset;
		} elsif ($percent>=50.0) {
		    push @part,$langset;
		} else {
		    push @unsup,$langset;
		}
		$langset=0;
		$number=0;
	    }
	}
    } elsif (/<a .*>([A-Za-z&; ]+)\(([^)]+)\)<\/a>/) {
	$langset=$2;
	$fullnames{$langset}=$1;
	$number=0;
    }
}

print "<h2>Currently supported languages:</h2>\n<ul>\n";
foreach $lang (sort(@support)) {
    getlangline($lang);
}
print "</ul>\n\n";

print "<h2>Currently partially supported languages:</h2>\n<ul>\n";
foreach $lang (sort(@part)) {
    getlangline($lang);
}
print "</ul>\n\n";


print "<h2>Currently unsupported languages:</h2>\n<ul>\n";
foreach $lang (sort(@unsup)) {
    getlangline($lang);
}
print "</ul>\n\n";

sub getlangline($lang) {
    $lang=$_[0];
    $fullname=$fullnames{$lang};
    # egrep returns 0 for a match, 1 or 2 in other cases
    system("egrep '^<li>$lang:' index.wml") and print "<li>$lang: $fullname</li>\n";
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]