Mercurial > pidgin.yaz
changeset 11466:eaa10266cd96
[gaim-migrate @ 13706]
translation stats update (http://gaim.sf.net/l10n/ now points to statistics from HEAD instead of oldstatus)
yes, I'll make the XSL prettier later. It's "good enough" for the moment
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 08 Sep 2005 05:11:07 +0000 |
parents | 448bc3b8eb63 |
children | 2952c6dfa738 |
files | po/l10n.xsl po/stats.pl |
diffstat | 2 files changed, 51 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/l10n.xsl Thu Sep 08 05:11:07 2005 +0000 @@ -0,0 +1,46 @@ +<?xml version='1.0' ?> +<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + <xsl:template match='/project'> + <html> + <head> + <title><xsl:value-of select='@name'/> translation statistics</title> + <style> + .bargraph { + width: 200px; + height: 20px; + background: black; + border-collapse: collapse; + border-spacing: 0px; + margin: 0px; + border: 0px; + padding: 0px; + } + + </style> + </head> + <body> + <h1><xsl:value-of select='@name' /> translation statistics</h1> + <table> + <tr><th>Language</th><th colspan='2'>Translated</th><th colspan='2'>Fuzzy</th><th colspan='2'>Untranslated</th></tr> + <xsl:for-each select="lang"> + <xsl:sort select='@code' /> + <tr> + <td><a><xsl:attribute name='href'><xsl:value-of select='@code'/>.po</xsl:attribute><xsl:value-of select='@code'/></a></td> + <td><xsl:value-of select='@translated'/></td><td><xsl:value-of select="format-number(@translated div ../@strings * 100,'#.##')"/> %</td> + <td><xsl:value-of select='@fuzzy'/></td><td><xsl:value-of select="format-number(@fuzzy div ../@strings * 100,'#.##')"/> %</td> + <td><xsl:value-of select='../@strings - (@translated + @fuzzy)'/></td><td><xsl:value-of select="format-number((../@strings - (@translated + @fuzzy)) div ../@strings * 100,'#.##')"/> %</td> + <td> + <table class='bargraph'><tr> + <td bgcolor='green'><xsl:attribute name='width'><xsl:value-of select='round(@translated div ../@strings * 200)'/>px;</xsl:attribute></td> + <td bgcolor='blue'><xsl:attribute name='width'><xsl:value-of select='round(@fuzzy div ../@strings * 200)'/>px;</xsl:attribute></td> + <td bgcolor='red'></td> + </tr></table> + </td> + </tr> + </xsl:for-each> + </table> + <a><xsl:attribute name='href'><xsl:value-of select='@pofile'/></xsl:attribute><xsl:value-of select='@pofile'/></a> generated on <xsl:value-of select='@generated'/> + </body> + </html> + </xsl:template> +</xsl:stylesheet>
--- a/po/stats.pl Wed Sep 07 16:20:39 2005 +0000 +++ b/po/stats.pl Thu Sep 08 05:11:07 2005 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright 2003-2004 Nathan Walp <faceprint@faceprint.com> +# Copyright 2003-2005 Nathan Walp <faceprint@faceprint.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ # Foundation, Inc., 50 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +use POSIX qw(strftime); + my $PACKAGE="gaim"; @@ -47,10 +49,11 @@ die "unable to get total: $!" unless (/(\d+) untranslated messages/); $total = $1; +$generated = strftime "%Y-%m-%d %H:%M:%S", gmtime; print "<?xml version='1.0'?>\n"; print "<?xml-stylesheet type='text/xsl' href='l10n.xsl'?>\n"; -print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total'>\n"; +print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total' generated='$generated'>\n"; foreach $index (0 .. $#pos) { $trans = $fuzz = $untrans = 0;