diff options
author | David Prévot <taffit-guest> | 2011-03-09 23:18:59 +0000 |
---|---|---|
committer | David Prévot <taffit-guest> | 2011-03-09 23:18:59 +0000 |
commit | 6dada565c8be2c59dfff9e9a9e806b78791b1ce8 (patch) | |
tree | 681b16b968dfe6b423af9d2039e64bee8f80b802 | |
parent | 23d0911b7c4b16e8c9aab82d2fa3d75492b2f9fc (diff) |
Makes website translation stats available in other languages
CVS version numbers
stattrans.pl: 1.100 -> 1.101
english/devel/website/stats/Makefile: 1.1 -> 1.2
english/devel/website/stats/README: INITIAL -> 1.1
english/po/Makefile: 1.82 -> 1.83
english/po/stats.pot: INITIAL -> 1.1
english/template/debian/basic.wml: 1.93 -> 1.94
english/template/debian/navbar.wml: 1.83 -> 1.84
english/template/debian/stats_tags.wml: INITIAL -> 1.1
french/devel/website/stats/Makefile: INITIAL -> 1.1
french/po/stats.fr.po: INITIAL -> 1.1
-rw-r--r-- | english/devel/website/stats/Makefile | 37 | ||||
-rw-r--r-- | english/devel/website/stats/README | 9 | ||||
-rw-r--r-- | english/po/Makefile | 9 | ||||
-rw-r--r-- | english/po/stats.pot | 216 | ||||
-rw-r--r-- | english/template/debian/basic.wml | 1 | ||||
-rw-r--r-- | english/template/debian/navbar.wml | 23 | ||||
-rw-r--r-- | english/template/debian/stats_tags.wml | 21 | ||||
-rw-r--r-- | french/devel/website/stats/Makefile | 1 | ||||
-rw-r--r-- | french/po/stats.fr.po | 211 | ||||
-rwxr-xr-x | stattrans.pl | 120 |
10 files changed, 586 insertions, 62 deletions
diff --git a/english/devel/website/stats/Makefile b/english/devel/website/stats/Makefile index 23de3320370..9ffffd5630d 100644 --- a/english/devel/website/stats/Makefile +++ b/english/devel/website/stats/Makefile @@ -9,5 +9,38 @@ NOGENERICDEP := true include $(WMLBASE)/Make.lang -%.$(LANGUAGE).html: %.wml - $(WML) $(<F) +SOURCESTATS = $(shell ls $(ENGLISHDIR)/$(CUR_DIR)/*.wml) + +STATSOK = $(patsubst $(ENGLISHDIR)/$(CUR_DIR)/%.wml,%.$(LANGUAGE).html, \ + $(SOURCESTATS)) + +ifndef SUBLANG +STATS = $(STATSOK) +else +STATS = $(sort $(foreach i,$(SUBLANG),\ + $(patsubst $(ENGLISHDIR)/$(CUR_DIR)/%.wml,%.$(LANGUAGE)-$(i).html, \ + $(SOURCESTATS)))) +$(STATS): $(STATSOK) +endif + +DESTSTATS = $(patsubst %.html,$(HTMLDIR)/%.html,$(STATS)) + +%.$(LANGUAGE).html: $(ENGLISHDIR)/$(CUR_DIR)/%.wml + $(WML) $(shell egrep '^-D (CUR_|CHAR)' $(WMLBASE)/.wmlrc) \ + $(shell echo $<) +ifeq "$(LANGUAGE)" "zh" + @echo -n " * Converting: [zh_CN.GB2312], " + @$(B5TOGB) < $(patsubst %.zh.html,%.zh-cn.html,$@).tmp > $(patsubst %.zh.html,%.zh-cn.html,$@) + @rm -f $(patsubst %.zh.html,%.zh-cn.html,$@).tmp + @$(TOCN) $(patsubst %.zh.html,%.zh-cn.html,$@) + @echo -n "[zh_HK.Big5], " + @mv -f $(patsubst %.zh.html,%.zh-hk.html,$@).tmp $(patsubst %.zh.html,%.zh-hk.html,$@) + @$(TOHK) $(patsubst %.zh.html,%.zh-hk.html,$@) + @echo "[zh_TW.Big5]." + @mv -f $(patsubst %.zh.html,%.zh-tw.html,$@).tmp $(patsubst %.zh.html,%.zh-tw.html,$@) + @$(TOTW) $(patsubst %.zh.html,%.zh-tw.html,$@) +endif + +all:: $(STATS) + +install:: $(DESTSTATS) diff --git a/english/devel/website/stats/README b/english/devel/website/stats/README new file mode 100644 index 00000000000..ad76164f496 --- /dev/null +++ b/english/devel/website/stats/README @@ -0,0 +1,9 @@ +Translators: in order to provide translated statistics, you just need +to add a webwml/$lang/devel/website/stats directory with a minimal +Makefile (see webwml/french/devel/website/stats/Makefile) and translate +the stats.$ll.po file. + +Chinese build is currently broken due to deprecated encoding of Spanish +(characters in maintainer names of outdated translation), it can only +be added as soon as Spanish moves to UTF-8 (of once Spanish +translations are up to date ;-). diff --git a/english/po/Makefile b/english/po/Makefile index facc799a6df..0cc41dcb183 100644 --- a/english/po/Makefile +++ b/english/po/Makefile @@ -8,7 +8,9 @@ include $(WMLBASE)/Make.lang LOCALEROOT = $(WMLBASE)/../locale -DOMAINS = templates bugs cdimage consultants countries date distrib doc l10n langs legal mailinglists newsevents organization ports search security vendors vote wnpp others +DOMAINS = templates bugs cdimage consultants countries date distrib \ + doc l10n langs legal mailinglists newsevents organization \ + ports search security stats vendors vote wnpp others bugs_FILES = $(ENGLISHDIR)/Bugs/pkgreport-opts.inc cdimage_FILES = $(TEMPLDIR)/cdimage.wml @@ -42,6 +44,7 @@ security_FILES = $(TEMPLDIR)/security.wml \ $(ENGLISHDIR)/security/faq.inc \ $(ENGLISHDIR)/security/dsa.rdf.in \ $(ENGLISHDIR)/security/make-ref-table.pl +stats_FILES = $(WMLBASE)/../stattrans.pl $(TEMPLDIR)/stats_tags.wml vendors_FILES = $(ENGLISHDIR)/CD/vendors/vendors.CD.def vote_FILES = $(TEMPLDIR)/votebar.wml wnpp_FILES = $(TEMPLDIR)/wnpp.wml @@ -79,6 +82,7 @@ SOURCEFILES = \ $(ports_FILES) \ $(search_FILES) \ $(security_FILES) \ + $(stats_FILES) \ $(vendors_FILES) \ $(vote_FILES) \ $(wnpp_FILES) \ @@ -138,6 +142,9 @@ $(ENGLISHDIR)/po/search.pot: # $(search_FILES) $(ENGLISHDIR)/po/security.pot: # $(security_FILES) $(ENGLISHDIR)/po/wmlxgettext.pl security $(security_FILES) > $@ +$(ENGLISHDIR)/po/stats.pot: # $(stats_FILES) + $(ENGLISHDIR)/po/wmlxgettext.pl stats $(stats_FILES) > $@ + $(ENGLISHDIR)/po/vendors.pot: # $(vendors_FILES) $(ENGLISHDIR)/po/wmlxgettext.pl vendors $(vendors_FILES) > $@ diff --git a/english/po/stats.pot b/english/po/stats.pot new file mode 100644 index 00000000000..a7dcf78bbab --- /dev/null +++ b/english/po/stats.pot @@ -0,0 +1,216 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../stattrans.pl:203 +#: ../../stattrans.pl:207 +msgid "This translation is too out of date" +msgstr "" + +#: ../../stattrans.pl:205 +#: ../../stattrans.pl:389 +msgid "Wrong translation version" +msgstr "" + +#: ../../stattrans.pl:209 +msgid "The original is newer than this translation" +msgstr "" + +#: ../../stattrans.pl:212 +#: ../../stattrans.pl:389 +msgid "The original no longer exists" +msgstr "" + +#: ../../stattrans.pl:370 +msgid "hits" +msgstr "" + +#: ../../stattrans.pl:370 +msgid "hit count N/A" +msgstr "" + +#: ../../stattrans.pl:482 +msgid "Translation summary for" +msgstr "" + +#: ../../stattrans.pl:485 +msgid "Translated" +msgstr "" + +#: ../../stattrans.pl:485 +#: ../../stattrans.pl:558 +#: ../../stattrans.pl:627 +#: ../../stattrans.pl:673 +#: ../../stattrans.pl:716 +msgid "Up to date" +msgstr "" + +#: ../../stattrans.pl:485 +#: ../../stattrans.pl:628 +#: ../../stattrans.pl:674 +msgid "Outdated" +msgstr "" + +#: ../../stattrans.pl:485 +#: ../../stattrans.pl:629 +#: ../../stattrans.pl:675 +#: ../../stattrans.pl:718 +msgid "Not translated" +msgstr "" + +#: ../../stattrans.pl:502 +msgid "Note: the lists of pages are sorted by popularity. Hover over the page name to see the number of hits." +msgstr "" + +#: ../../stattrans.pl:507 +msgid "Outdated translations" +msgstr "" + +#: ../../stattrans.pl:509 +#: ../../stattrans.pl:557 +msgid "File" +msgstr "" + +#: ../../stattrans.pl:510 +#: ../../stattrans.pl:517 +msgid "Translation" +msgstr "" + +#: ../../stattrans.pl:511 +msgid "Origin" +msgstr "" + +#: ../../stattrans.pl:512 +msgid "Comment" +msgstr "" + +#: ../../stattrans.pl:513 +#: ../../stattrans.pl:514 +msgid "Unified diff" +msgstr "" + +#: ../../stattrans.pl:513 +#: ../../stattrans.pl:514 +msgid "Colored diff" +msgstr "" + +#: ../../stattrans.pl:515 +msgid "Diff" +msgstr "" + +#: ../../stattrans.pl:516 +msgid "Log" +msgstr "" + +#: ../../stattrans.pl:518 +msgid "Maintainer" +msgstr "" + +#: ../../stattrans.pl:524 +msgid "General pages not translated" +msgstr "" + +#: ../../stattrans.pl:525 +msgid "Untranslated general pages" +msgstr "" + +#: ../../stattrans.pl:530 +msgid "News items not translated" +msgstr "" + +#: ../../stattrans.pl:531 +msgid "Untranslated news items" +msgstr "" + +#: ../../stattrans.pl:536 +msgid "Consultant/user pages not translated" +msgstr "" + +#: ../../stattrans.pl:537 +msgid "Untranslated consultant/user pages" +msgstr "" + +#: ../../stattrans.pl:542 +msgid "International pages not translated" +msgstr "" + +#: ../../stattrans.pl:543 +msgid "Untranslated international pages" +msgstr "" + +#: ../../stattrans.pl:548 +msgid "Translated pages (up-to-date)" +msgstr "" + +#: ../../stattrans.pl:555 +#: ../../stattrans.pl:700 +msgid "Translated templates (PO files)" +msgstr "" + +#: ../../stattrans.pl:556 +#: ../../stattrans.pl:703 +msgid "PO Translation Statistics" +msgstr "" + +#: ../../stattrans.pl:559 +#: ../../stattrans.pl:717 +msgid "Fuzzy" +msgstr "" + +#: ../../stattrans.pl:560 +msgid "Untranslated" +msgstr "" + +#: ../../stattrans.pl:577 +msgid "Total:" +msgstr "" + +#: ../../stattrans.pl:589 +#: ../../stattrans.pl:741 +msgid "Created with" +msgstr "" + +#: ../../stattrans.pl:607 +msgid "Translated web pages" +msgstr "" + +#: ../../stattrans.pl:610 +msgid "Translation Statistics by Page Count" +msgstr "" + +#: ../../stattrans.pl:625 +#: ../../stattrans.pl:671 +#: ../../stattrans.pl:715 +msgid "Language" +msgstr "" + +#: ../../stattrans.pl:626 +#: ../../stattrans.pl:672 +msgid "Translations" +msgstr "" + +#: ../../stattrans.pl:653 +msgid "Translated web pages (by size)" +msgstr "" + +#: ../../stattrans.pl:656 +msgid "Translation Statistics by Page Size" +msgstr "" + +#: ../../english/template/debian/stats_tags.wml:6 +msgid "Debian web site translation statistics" +msgstr "" + +#: ../../english/template/debian/stats_tags.wml:10 +msgid "There are %d pages to translate." +msgstr "" + +#: ../../english/template/debian/stats_tags.wml:14 +msgid "There are %d bytes to translate." +msgstr "" + +#: ../../english/template/debian/stats_tags.wml:18 +msgid "There are %d strings to translate." +msgstr "" + diff --git a/english/template/debian/basic.wml b/english/template/debian/basic.wml index baef460cdc3..8128f8390f7 100644 --- a/english/template/debian/basic.wml +++ b/english/template/debian/basic.wml @@ -3,6 +3,7 @@ #use wml::debian::common_translation #use wml::debian::common_tags +#use wml::debian::language_names <ifeq "$(DOCTYPE)" xhtml "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" diff --git a/english/template/debian/navbar.wml b/english/template/debian/navbar.wml index ed7e5c4515c..d46a4d9061b 100644 --- a/english/template/debian/navbar.wml +++ b/english/template/debian/navbar.wml @@ -2,6 +2,7 @@ #use wml::debian::mirrors #use wml::debian::events_common #use wml::debian::links.tags +#use wml::debian::stats_tags <div id="header"> <div id="upperheader"> @@ -40,25 +41,23 @@ $eng_dir =~ s,(.*)/webwml/\w*,$1/webwml/english,; my $relative_path = '.'; -# Use the current page name (no link) - my $breadcrumbs = q%$(title)%; - + my $breadcrumbs; # If the current page is already the index, go one directory up if ( '$(WML_SRC_FILENAME)' eq 'index.wml' ) { # Use only year for security/YYYY and vote/YYYY directories - $breadcrumbs = $1 if ( $eng_dir =~ m,security/(\d{4})$, or $eng_dir =~ m,vote/(\d{4})$, ); + $breadcrumbs = "$1 <!--" if ( $eng_dir =~ m,security/(\d{4})$, or $eng_dir =~ m,vote/(\d{4})$, ); # Use short name for l10n stats #616340 - $breadcrumbs = 'PO' if ( $eng_dir =~ m,international/l10n/po$, ); - $breadcrumbs = 'PO Debconf' if ( $eng_dir =~ m,international/l10n/po-debconf$, ); - $breadcrumbs = 'po4a' if ( $eng_dir =~ m,international/l10n/po4a$, ); + $breadcrumbs = 'PO <!--' if ( $eng_dir =~ m,international/l10n/po$, ); + $breadcrumbs = 'PO Debconf <!--' if ( $eng_dir =~ m,international/l10n/po-debconf$, ); + $breadcrumbs = 'po4a <!--' if ( $eng_dir =~ m,international/l10n/po4a$, ); $relative_path = '..'; $eng_dir =~ s,/\w*([-.]\w*)?$,,; } # Use language code for l10n stats #616340 - $breadcrumbs = '@tmpl_lang@' if ( $breadcrumbs =~ m,@tmpl_lang@, ); +# $breadcrumbs = '@tmpl_lang@' if ( $breadcrumbs =~ m,\@tmpl_lang\@, ); # Loop to get each directory index title # no breadcrumb for 404 page @@ -92,6 +91,10 @@ elsif ( $eng_dir =~ m,international/l10n/po4a$, ) { $title = 'po4a' ; } + # Handle translated title in website stats + elsif ( $eng_dir =~ m,website/stats$, ) + { $title = '<stats_title>' ; } + # Normal case: use $(title) else { <protect pass=2> @@ -112,8 +115,10 @@ }} # Actually print breadcrumbs - print '<p id="breadcrumbs">'.$breadcrumbs.'</p>'; + print '<p id="breadcrumbs">'.$breadcrumbs; + </perl> +$(title)<!-- --></p> </when> # # Handle DPN: use date and only year for News/weekly/YYYY directory diff --git a/english/template/debian/stats_tags.wml b/english/template/debian/stats_tags.wml new file mode 100644 index 00000000000..f43378269ba --- /dev/null +++ b/english/template/debian/stats_tags.wml @@ -0,0 +1,21 @@ +#use wml::debian::common_tags + +<bind-gettext-domain domain="stats" /> + +<define-tag stats_title whitespace="delete"> +<gettext domain="stats">Debian web site translation statistics</gettext> +</define-tag> + +<define-tag stats_pages whitespace="delete"> +<: printf '<gettext domain="stats">There are %d pages to translate.</gettext>', %0 :> +</define-tag> + +<define-tag stats_bytes whitespace="delete"> +<: printf '<gettext domain="stats">There are %d bytes to translate.</gettext>', %0 :> +</define-tag> + +<define-tag stats_strings whitespace="delete"> +<: printf '<gettext domain="stats">There are %d strings to translate.</gettext>', %0 :> +</define-tag> + + diff --git a/french/devel/website/stats/Makefile b/french/devel/website/stats/Makefile new file mode 100644 index 00000000000..ea01966a131 --- /dev/null +++ b/french/devel/website/stats/Makefile @@ -0,0 +1 @@ +include $(subst webwml/french,webwml/english,$(CURDIR))/Makefile diff --git a/french/po/stats.fr.po b/french/po/stats.fr.po new file mode 100644 index 00000000000..dd044066472 --- /dev/null +++ b/french/po/stats.fr.po @@ -0,0 +1,211 @@ +# Templates files for stats modules +# Copyright (C) 2011 Software in the Public Interest, Inc. +# +# David Prévot <david@tilapin.org>, 2011. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"PO-Revision-Date: 2011-03-08 12:46-0400\n" +"Last-Translator: David Prévot <david@tilapin.org>\n" +"Language-Team: French <debian-l10n-french@lists.debian.org>\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: ../../english/template/debian/stats_tags.wml:6 +msgid "Debian web site translation statistics" +msgstr "Statistiques de traduction du site web Debian" + +#: ../../english/template/debian/stats_tags.wml:10 +msgid "There are %d pages to translate." +msgstr "%d pages restent à traduire." + +#: ../../english/template/debian/stats_tags.wml:14 +msgid "There are %d bytes to translate." +msgstr "%d octets restent à traduire." + +#: ../../english/template/debian/stats_tags.wml:18 +msgid "There are %d strings to translate." +msgstr "%d chaînes restent à traduire." + +#: ../../stattrans.pl:203 ../../stattrans.pl:207 +msgid "This translation is too out of date" +msgstr "Cette traduction est trop incomplète" + +#: ../../stattrans.pl:205 ../../stattrans.pl:389 +msgid "Wrong translation version" +msgstr "Mauvaise version de traduction" + +#: ../../stattrans.pl:209 +msgid "The original is newer than this translation" +msgstr "L'original est plus récent que sa traduction" + +#: ../../stattrans.pl:212 ../../stattrans.pl:389 +msgid "The original no longer exists" +msgstr "L'original n'existe plus" + +#: ../../stattrans.pl:370 +msgid "hit count N/A" +msgstr "Nombre de visites indisponible" + +#: ../../stattrans.pl:370 +msgid "hits" +msgstr "visites" + +#: ../../stattrans.pl:482 +msgid "Translation summary for" +msgstr "Vue globale des traductions pour la langue :" + +#: ../../stattrans.pl:485 ../../stattrans.pl:629 ../../stattrans.pl:675 +#: ../../stattrans.pl:718 +msgid "Not translated" +msgstr "Non traduites" + +#: ../../stattrans.pl:485 ../../stattrans.pl:628 ../../stattrans.pl:674 +msgid "Outdated" +msgstr "Incomplètes" + +#: ../../stattrans.pl:485 +msgid "Translated" +msgstr "Traduites" + +#: ../../stattrans.pl:485 ../../stattrans.pl:558 ../../stattrans.pl:627 +#: ../../stattrans.pl:673 ../../stattrans.pl:716 +msgid "Up to date" +msgstr "À jour" + +#: ../../stattrans.pl:502 +msgid "" +"Note: the lists of pages are sorted by popularity. Hover over the page name " +"to see the number of hits." +msgstr "" +"Remarque : les listes de pages sont classées par popularité. Le nombre de " +"visites apparaît lorsque le pointeur passe sur le nom de la page." + +#: ../../stattrans.pl:507 +msgid "Outdated translations" +msgstr "Traductions incomplètes" + +#: ../../stattrans.pl:509 ../../stattrans.pl:557 +msgid "File" +msgstr "Fichier" + +#: ../../stattrans.pl:510 ../../stattrans.pl:517 +msgid "Translation" +msgstr "Traduction" + +#: ../../stattrans.pl:511 +msgid "Origin" +msgstr "Original" + +#: ../../stattrans.pl:512 +msgid "Comment" +msgstr "Commentaire" + +#: ../../stattrans.pl:513 ../../stattrans.pl:514 +msgid "Colored diff" +msgstr "Différentiel coloré" + +#: ../../stattrans.pl:513 ../../stattrans.pl:514 +msgid "Unified diff" +msgstr "Différentiel unifié" + +#: ../../stattrans.pl:515 +msgid "Diff" +msgstr "Différentiel" + +#: ../../stattrans.pl:516 +msgid "Log" +msgstr "Journal" + +#: ../../stattrans.pl:518 +msgid "Maintainer" +msgstr "Responsable" + +#: ../../stattrans.pl:524 +msgid "General pages not translated" +msgstr "Pages générales non traduites" + +#: ../../stattrans.pl:525 +msgid "Untranslated general pages" +msgstr "Pages générales non traduites" + +#: ../../stattrans.pl:530 +msgid "News items not translated" +msgstr "Nouvelles non traduites" + +#: ../../stattrans.pl:531 +msgid "Untranslated news items" +msgstr "Nouvelles non traduites" + +#: ../../stattrans.pl:536 +msgid "Consultant/user pages not translated" +msgstr "Pages de consultants et d'utilisateurs non traduites" + +#: ../../stattrans.pl:537 +msgid "Untranslated consultant/user pages" +msgstr "Pages de consultants et d'utilisateurs non traduites" + +#: ../../stattrans.pl:542 +msgid "International pages not translated" +msgstr "Pages internationales non traduites" + +#: ../../stattrans.pl:543 +msgid "Untranslated international pages" +msgstr "Pages internationales non traduites" + +#: ../../stattrans.pl:548 +msgid "Translated pages (up-to-date)" +msgstr "Pages web traduites (à jour)" + +#: ../../stattrans.pl:555 ../../stattrans.pl:700 +msgid "Translated templates (PO files)" +msgstr "Chaînes traduites (fichiers PO)" + +#: ../../stattrans.pl:556 ../../stattrans.pl:703 +msgid "PO Translation Statistics" +msgstr "Statistiques de traduction des fichiers PO" + +#: ../../stattrans.pl:559 ../../stattrans.pl:717 +msgid "Fuzzy" +msgstr "Approximatives" + +#: ../../stattrans.pl:560 +msgid "Untranslated" +msgstr "Non traduites" + +#: ../../stattrans.pl:577 +msgid "Total:" +msgstr "Total :" + +#: ../../stattrans.pl:589 ../../stattrans.pl:741 +msgid "Created with" +msgstr "Page créée avec" + +#: ../../stattrans.pl:607 +msgid "Translated web pages" +msgstr "Pages web traduites" + +#: ../../stattrans.pl:610 +msgid "Translation Statistics by Page Count" +msgstr "Statistiques de traduction par nombre de pages" + +#: ../../stattrans.pl:625 ../../stattrans.pl:671 ../../stattrans.pl:715 +msgid "Language" +msgstr "Langue" + +#: ../../stattrans.pl:626 ../../stattrans.pl:672 +msgid "Translations" +msgstr "Traductions" + +#: ../../stattrans.pl:653 +msgid "Translated web pages (by size)" +msgstr "Pages web traduites (par taille)" + +#: ../../stattrans.pl:656 +msgid "Translation Statistics by Page Size" +msgstr "Statistiques de traduction par taille de pages" + diff --git a/stattrans.pl b/stattrans.pl index 80668389073..bdff370eff4 100755 --- a/stattrans.pl +++ b/stattrans.pl @@ -45,7 +45,7 @@ $| = 1; $opt_h = "/srv/www.debian.org/webwml/english/devel/website/stats"; $opt_w = "/srv/www.debian.org/webwml"; $opt_p = "*.(wml|src)"; -$opt_t = "Debian web site translation statistics"; +$opt_t = '<stats_title>'; $opt_v = 0; $opt_d = "u"; $opt_l = undef; @@ -200,16 +200,16 @@ sub check_translation # From translation-check.wml if ( $major_number != $major_translated_number ) { - return "This translation is too out of date"; + return '<gettext domain="stats">This translation is too out of date</gettext>'; } elsif ( $last_number - $last_translated_number < 0 ) { - return "Wrong translation version"; + return '<gettext domain="stats">Wrong translation version</gettext>'; } elsif ( $last_number - $last_translated_number >= $max_versions ) { - return "This translation is too out of date"; + return '<gettext domain="stats">This translation is too out of date</gettext>'; } elsif ( $last_number - $last_translated_number >= $min_versions ) { - return "The original is newer than this translation"; + return '<gettext domain="stats">The original is newer than this translation</gettext>'; } } elsif ( !$version && $translation) { - return "The original no longer exists"; + return '<gettext domain="stats">The original no longer exists</gettext>'; } return ""; } @@ -367,7 +367,7 @@ foreach $lang (@search_in) { foreach $file (@filenames) { next if ($file eq ""); (my $base = $file) =~ s/\.wml$//; - my $hits = exists $hits{$base} ? $hits{$base}.' hits' : 'hit count N/A'; + my $hits = exists $hits{$base} ? $hits{$base}.' <gettext domain="stats">hits</gettext>' : '<gettext domain="stats">hit count N/A</gettext>'; # Translated pages if (index ($wmlfiles{$lang}, " $file ") >= 0) { $translated{$lang}++; @@ -386,7 +386,7 @@ foreach $lang (@search_in) { $o_body .= sprintf "<td>%s</td>", $transversion{"$lang/$file"}; $o_body .= sprintf "<td>%s</td>", $version{"$orig/$file"}; $o_body .= sprintf "<td>%s</td>", $msg; - if ($msg eq "Wrong translation version" || $msg eq "The original no longer exists") { + if ($msg eq '<gettext domain="stats">Wrong translation version</gettext>' || $msg eq '<gettext domain="stats">The original no longer exists</gettext>') { $o_body .= "<td></td><td></td>"; } else { $o_body .= sprintf "<td><a href=\"http://alioth.debian.org/scm/viewvc.php/webwml/$orig/%s?root=webwml\&view=diff\&r1=%s\&r2=%s\&diff_format=%s\">%s\ ->\ %s</a></td>", @@ -474,14 +474,14 @@ foreach $lang (@search_in) { $percent_us{$lang} = 100 - $percent_as{$lang}; if (open (HTML, ">$config{'htmldir'}/$l.wml")) { - printf HTML "#use wml::debian::template title=\"%s\"\n", ucfirst $lang; + printf HTML "#use wml::debian::template title=\"<:=\$trans{\$CUR_ISO_LANG}{%s}:>\"\n", $lang; print HTML "#use wml::debian::toc\n\n"; $color = get_color ($percent_a{$lang}); - printf HTML "<table summary=\"Translation summary for $lang\" style=\"background-color: %s\; width: 100%\; font-weight: bold\; margin: 0\; text-align: center\;\">\n", $color; + printf HTML '<table summary="<gettext domain="stats">Translation summary for</gettext> <:=$trans{$CUR_ISO_LANG}{'.$lang.'} :>" style="background-color: %s; width: 100%; font-weight: bold; margin: 0; text-align: center;">'."\n", $color; print HTML "<colgroup span=\"4\" width=\"25%\"></colgroup>\n"; - print HTML "<tr><th>Translated</th><th>Up-to-date</th><th>Outdated</th><th>Not translated</th></tr>\n<tr>"; + print HTML '<tr><th><gettext domain="stats">Translated</gettext></th><th><gettext domain="stats">Up to date</gettext></th><th><gettext domain="stats">Outdated</gettext></th><th><gettext domain="stats">Not translated</gettext></th></tr>'."\n<tr>\n"; printf HTML "<td>%d files (%.1f%%)</td>", $wml{$lang}, $percent_a{$lang}; printf HTML "<td>%d files (%.1f%%)</td>", $translated{$lang}, $percent_t{$lang}; printf HTML "<td>%d files (%.1f%%)</td>", $outdated{$lang}, $percent_o{$lang}; @@ -498,59 +498,65 @@ foreach $lang (@search_in) { # Make the table of content print HTML "<toc-display/>\n"; if (%hits) { - print HTML "<p>Note: The lists of pages are sorted by popularity. Hover over the page name to see the number of hits.</p>\n"; + print HTML '<p><gettext domain="stats">Note: the lists of pages are sorted by popularity. Hover over the page name to see the number of hits.</gettext></p>'."\n"; } # outputs the content if ($o_body) { - print HTML "<toc-add-entry name=\"outdated\">Outdated translations</toc-add-entry>\n"; + print HTML '<toc-add-entry name="outdated"><gettext domain="stats">Outdated translations</gettext></toc-add-entry>'."\n"; print HTML "<table summary=\"Outdated translations\" border=0 cellpadding=1 cellspacing=1>\n"; - print HTML "<tr><th>File</th><th>Translated</th><th>Origin</th><th>Comment</th>"; - if ($opt_d eq "u") { print HTML "<th>Unified diff</th><th>Colored diff</th>"; } - elsif ($opt_d eq "h") { print HTML "<th>Colored diff</th><th>Unified diff</th>"; } - else { print HTML "<th>Diff</th>"; } - print HTML "<th>Log</th>"; - print HTML "<th>Translation</th>"; - print HTML "<th>Maintainer</th>"; + print HTML '<tr><th><gettext domain="stats">File</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Translation</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Origin</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Comment</gettext></th>'."\n"; + if ($opt_d eq "u") { print HTML '<th><gettext domain="stats">Unified diff</gettext></th><th><gettext domain="stats">Colored diff</gettext></th>'; } + elsif ($opt_d eq "h") { print HTML '<th><gettext domain="stats">Colored diff</gettext></th><th><gettext domain="stats">Unified diff</gettext></th>'; } + else { print HTML '<th><gettext domain="stats">Diff</gettext></th>'; } + print HTML '<th><gettext domain="stats">Log</gettext></th>'; + print HTML '<th><gettext domain="stats">Translation</gettext></th>'; + print HTML '<th><gettext domain="stats">Maintainer</gettext></th>'; print HTML "</tr>\n"; print HTML $o_body; print HTML "</table>\n"; } if ($u_body) { - print HTML "<toc-add-entry name=\"untranslated\">General pages not translated</toc-add-entry>\n"; - print HTML "<table summary=\"Untranslated general pages\">\n"; + print HTML '<toc-add-entry name="untranslated"><gettext domain="stats">General pages not translated</gettext></toc-add-entry>'."\n"; + print HTML '<table summary="<gettext domain="stats">Untranslated general pages</gettext>">'."\n"; print HTML $u_body; print HTML "</table>\n"; } if ($un_body) { - print HTML "<toc-add-entry name=\"untranslated-news\">News items not translated</toc-add-entry>\n"; - print HTML "<table summary=\"Untranslated news items\">\n"; + print HTML '<toc-add-entry name="untranslated-news"><gettext domain="stats">News items not translated</gettext></toc-add-entry>'."\n"; + print HTML '<table summary="<gettext domain="stats">Untranslated news items</gettext>">'."\n"; print HTML $un_body; print HTML "</table>\n"; } if ($uu_body) { - print HTML "<toc-add-entry name=\"untranslated-user\">Consultant/user pages not translated</toc-add-entry>\n"; - print HTML "<table summary=\"Untranslated consultant/user pages\">\n"; + print HTML '<toc-add-entry name="untranslated-user"><gettext domain="stats">Consultant/user pages not translated</gettext></toc-add-entry>'."\n"; + print HTML '<table summary="<gettext domain="stats">Untranslated consultant/user pages</gettext>">'."\n"; print HTML $uu_body; print HTML "</table>\n"; } if ($ui_body) { - print HTML "<toc-add-entry name=\"untranslated-l10n\">International pages not translated</toc-add-entry>\n"; - print HTML "<table summary=\"Untranslated international pages\">\n"; + print HTML '<toc-add-entry name="untranslated-l10n"><gettext domain="stats">International pages not translated</gettext></toc-add-entry>'."\n"; + print HTML '<table summary="<gettext domain="stats">Untranslated international pages</gettext>">'."\n"; print HTML $ui_body; print HTML "</table>\n"; } if ($t_body) { - print HTML "<toc-add-entry name=\"uptodate\">Translated pages (up-to-date)</toc-add-entry>\n"; + print HTML '<toc-add-entry name="uptodate"><gettext domain="stats">Translated pages (up-to-date)</gettext></toc-add-entry>'."\n"; print HTML "<ul class=\"discless\">\n"; print HTML $t_body; print HTML "</ul>\n"; } # outputs the gettext stats if ($lang ne 'english') { - print HTML "<toc-add-entry name=\"gettext\">Translation of templates (gettext files)</toc-add-entry>\n"; - print HTML "<table summary=\"Gettext statistics\" width=\"100%\">\n"; - print HTML "<tr><th>File</th><th>Up to date</th><th>Fuzzy</th><th>Untranslated</th><th>Total</th></tr>\n"; + print HTML '<toc-add-entry name="gettext"><gettext domain="stats">Translated templates (PO files)</gettext></toc-add-entry>'."\n"; + print HTML '<table summary="<gettext domain="stats">PO Translation Statistics</gettext>" width="100%">'."\n"; + print HTML '<tr><th><gettext domain="stats">File</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Up to date</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Fuzzy</gettext></th>'."\n"; + print HTML '<th><gettext domain="stats">Untranslated</gettext></th></tr>'."\n"; foreach my $domain (sort keys %po_total) { next if $domain eq 'total'; print HTML "<tr>"; @@ -566,7 +572,8 @@ foreach $lang (@search_in) { printf HTML "<td align=right>%d</td>", $po_total{$domain}; print HTML "</tr>\n"; } - print HTML "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr><tr><th>Total:</th>"; + print HTML "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>\n"; + print HTML '<tr><th><gettext domain="stats">Total:</gettext></th>'; $color_t = get_color ($percent_po_t{'total'}{$lang}); $color_f = get_color (100 - $percent_po_f{'total'}{$lang}); $color_u = get_color (100 - $percent_po_u{'total'}{$lang}); @@ -578,7 +585,7 @@ foreach $lang (@search_in) { print HTML "</table>\n"; } - print HTML "<address>Created with <a href=\"http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup\&root=webwml\">webwml-stattrans</a></address>\n"; + print HTML '<address><gettext domain="stats">Created with</gettext> <a href="http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup&root=webwml">webwml-stattrans</a></address>'."\n"; close (HTML); } else { print "Can't open $config{'htmldir'}/$l.wml\n"; @@ -593,11 +600,12 @@ print "Creating index.wml... " if ($config{'verbose'}); open (HTMLI, ">$config{'htmldir'}/index.wml") || die "Can't open $config{'htmldir'}/index.wml"; +print HTMLI "#use wml::debian::stats_tags\n"; printf HTMLI "#use wml::debian::template title=\"%s\"\n\n", $config{'title'}; -print HTMLI "<h2>Translated web pages</h2>\n"; -printf HTMLI "<p>There are %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'}); +print HTMLI '<h2><gettext domain="stats">Translated web pages</gettext></h2>'."\n"; +printf HTMLI "<p><stats_pages %d></p>\n",($wml{'english'}+$untranslated{'english'}); -print HTMLI "<table summary=\"Translation Statistics by Page Count\" class=\"stattrans\">\n"; +print HTMLI '<table summary="<gettext domain="stats">Translation Statistics by Page Count</gettext>" class="stattrans">'."\n"; print HTMLI "<colgroup width=\"20%\">\n"; print HTMLI "<col>\n"; print HTMLI "</colgroup>"; @@ -612,7 +620,11 @@ print HTMLI "<col width=\"10%\">\n"; print HTMLI "<col width=\"10%\">\n"; print HTMLI "</colgroup>"; print HTMLI "<thead>"; -print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; +print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Translations</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Outdated</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n"; print HTMLI "</thead>"; print HTMLI "<tbody>"; foreach $lang (@search_in) { @@ -625,7 +637,7 @@ foreach $lang (@search_in) { $color_u = get_color (100 - $percent_u{$lang}); print HTMLI "<tr>"; - printf HTMLI "<th><a href=\"%s\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; + printf HTMLI "<th><a href=\"%s\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_a, $wml{$lang}, $percent_a{$lang}; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_t, $translated{$lang}, $percent_t{$lang}; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_o, $outdated{$lang}, $percent_o{$lang}; @@ -636,10 +648,10 @@ foreach $lang (@search_in) { print HTMLI "</tbody>"; print HTMLI "</table>\n"; -print HTMLI "<h2>Translated web pages (by size)</h2>\n"; -printf HTMLI "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}+$untranslated_s{'english'}); +print HTMLI '<h2><gettext domain="stats">Translated web pages (by size)</gettext></h2>'."\n"; +printf HTMLI "<p><stats_bytes %d></p>\n",($wml_s{'english'}+$untranslated_s{'english'}); -print HTMLI "<table summary=\"Translation Statistics by Page Size\" class=\"stattrans\">\n"; +print HTMLI '<table summary="<gettext domain="stats">Translation Statistics by Page Size</gettext>" class="stattrans">'."\n"; print HTMLI "<colgroup span=\"1\">\n"; print HTMLI "<col width=\"20%\">\n"; print HTMLI "</colgroup>"; @@ -654,7 +666,11 @@ print HTMLI "<col width=\"13%\">\n"; print HTMLI "<col width=\"7%\">\n"; print HTMLI "</colgroup>"; print HTMLI "<thead>"; -print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; +print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Translations</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Outdated</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n"; print HTMLI "</thead>"; print HTMLI "<tbody>"; @@ -668,7 +684,7 @@ foreach $lang (@search_in) { $color_u = get_color (100 - $percent_u{$lang}); print HTMLI "<tr>"; - printf HTMLI "<th><a href=\"%s\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; + printf HTMLI "<th><a href=\"%s\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_a, $wml_s{$lang}, $percent_as{$lang}; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_t, $translated_s{$lang}, $percent_ts{$lang}; printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_o, $outdated_s{$lang}, $percent_os{$lang}; @@ -679,9 +695,10 @@ foreach $lang (@search_in) { print HTMLI "</tbody>"; print HTMLI "</table>\n"; -print HTMLI "<h2>Translated templates (gettext files)</h2>\n"; -printf HTMLI "<p>There are %d strings to translate.</p>\n",$po_total{'total'}; -print HTMLI "<table summary=\"Gettext Translation Statistics\"class=\"stattrans\">\n"; +print HTMLI '<h2><gettext domain="stats">Translated templates (PO files)</gettext></h2>'."\n"; +printf HTMLI "<p><stats_strings %d></p>\n",$po_total{'total'}; + +print HTMLI '<table summary="<gettext domain="stats">PO Translation Statistics</gettext>"class="stattrans">'."\n"; print HTMLI "<colgroup span=\"1\"width=\"28%\">\n"; print HTMLI "</colgroup>"; print HTMLI "<colgroup span=\"6\" width=\"12%\">\n"; @@ -693,7 +710,10 @@ print HTMLI "<col width=\"12%\">\n"; print HTMLI "<col width=\"12%\">\n"; print HTMLI "</colgroup>"; print HTMLI "<thead>"; -print HTMLI "<tr><th>Language</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Fuzzy</th><th colspan=\"2\">Not translated</th></tr>\n"; +print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Fuzzy</gettext></th>'."\n"; +print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n"; print HTMLI "</thead>"; print HTMLI "<tbody>"; foreach $lang (@search_in) { @@ -702,7 +722,7 @@ foreach $lang (@search_in) { @processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh"; foreach $l (@processed_langs) { print HTMLI "<tr>"; - printf HTMLI "<th><a href=\"%s#gettext\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; + printf HTMLI "<th><a href=\"%s#gettext\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l; $color_t = get_color ($percent_po_t{'total'}{$lang}); $color_f = get_color (100 - $percent_po_f{'total'}{$lang}); $color_u = get_color (100 - $percent_po_u{'total'}{$lang}); @@ -716,7 +736,7 @@ foreach $lang (@search_in) { print HTMLI "</tbody>"; print HTMLI "</table>\n"; -print HTMLI "<address>Created with <a href=\"http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup\&root=webwml\">webwml-stattrans</a></address>\n"; +print HTMLI '<address><gettext domain="stats">Created with</gettext> <a href="http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup&root=webwml">webwml-stattrans</a></address>'."\n"; close (HTMLI); print "done.\n" if ($config{'verbose'}); |