From 1e831ea8e2d9d99cea278dcaedb29dd86207712a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 13 Apr 2010 12:15:40 +0200 Subject: [PATCH] translations-status.py: Better @multitable fixup. Somewhat readable PDF and info. The html-only output is still a lot nicer, however. Add a warning, consider using HTML-only for now! --- Documentation/de/translations.itexi | 14 +++---- Documentation/es/translations.itexi | 32 +++++++-------- Documentation/fr/translations.itexi | 12 +++--- Documentation/hu/translations.itexi | 16 ++++---- Documentation/it/translations.itexi | 4 +- Documentation/ja/translations.itexi | 8 ++-- Documentation/nl/translations.itexi | 6 +-- Documentation/translations.itexi | 52 ++++++++++++------------- scripts/auxiliar/translations-status.py | 46 +++++++++++++++------- 9 files changed, 104 insertions(+), 86 deletions(-) diff --git a/Documentation/de/translations.itexi b/Documentation/de/translations.itexi index 6d40e16c40..c0ba6ff0d1 100644 --- a/Documentation/de/translations.itexi +++ b/Documentation/de/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Aufsatz über den automatischen Musiksatz @@ -138,7 +138,7 @@ teilweise @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Extending LilyPond @@ -258,7 +258,7 @@ teilweise @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond Handbuch zum Lernen @@ -463,7 +463,7 @@ ja @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond Benutzerhandbuch @@ -1181,7 +1181,7 @@ teilweise @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond Programmbenutzung @@ -1330,7 +1330,7 @@ ja @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond -- Notation für Jedermann diff --git a/Documentation/es/translations.itexi b/Documentation/es/translations.itexi index 03b563cfa6..a4c8680890 100644 --- a/Documentation/es/translations.itexi +++ b/Documentation/es/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Registro de cambios de LilyPond @@ -57,7 +57,7 @@ parcialmente @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Ensayo sobre grabado musical automatizado @@ -70,7 +70,7 @@ Ensayo sobre grabado musical automatizado Títulos de sección @* 93 -@tab +@tab Team-es @tab @tab @ifhtml @@ -97,7 +97,7 @@ sí LilyPond --- \TITLE\ @* 1107 -@tab +@tab Team-es @tab @tab @ifhtml @@ -124,7 +124,7 @@ sí 1 Grabado musical @* 5297 -@tab +@tab Team-es @tab @tab @ifhtml @@ -151,7 +151,7 @@ parcialmente 2 Lista de referencias bibliográficas @* 319 -@tab +@tab Team-es @tab @tab @ifhtml @@ -177,7 +177,7 @@ sí @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Extending LilyPond @@ -190,7 +190,7 @@ Extending LilyPond Títulos de sección @* 107 -@tab +@tab Team-es @tab @tab @ifhtml @@ -217,7 +217,7 @@ sí LilyPond --- \TITLE\ @* 1107 -@tab +@tab Team-es @tab @tab @ifhtml @@ -244,7 +244,7 @@ sí A Tutorial de Scheme @* 4934 -@tab +@tab Team-es @tab @tab @ifhtml @@ -271,7 +271,7 @@ parcialmente 1 Interfaces para programadores @* 3815 -@tab +@tab Team-es @tab @tab @ifhtml @@ -297,7 +297,7 @@ sí @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Manual de aprendizaje de GNU LilyPond @@ -498,7 +498,7 @@ sí @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Referencia de la notación de GNU LilyPond @@ -1239,7 +1239,7 @@ sí @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond: manual de utilización del programa @@ -1440,7 +1440,7 @@ sí @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond: notación musical para todos diff --git a/Documentation/fr/translations.itexi b/Documentation/fr/translations.itexi index ee788ae47c..7cafe6fc1e 100644 --- a/Documentation/fr/translations.itexi +++ b/Documentation/fr/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:19 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Essai sur la gravure musicale automatisée @@ -144,7 +144,7 @@ oui @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond -- Manuel d'initiation @@ -373,7 +373,7 @@ partiellement @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond -- Manuel de notation @@ -1151,7 +1151,7 @@ partiellement @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond -- Utilisation des programmes @@ -1279,7 +1279,7 @@ partiellement @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond -- la notation musicale pour tous diff --git a/Documentation/hu/translations.itexi b/Documentation/hu/translations.itexi index c107b95afb..927f59cdda 100644 --- a/Documentation/hu/translations.itexi +++ b/Documentation/hu/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond Tankönyv @@ -219,7 +219,7 @@ partially @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond Használati útmutató @@ -232,7 +232,7 @@ LilyPond Használati útmutató Section titles @* 135 -@tab +@tab Team-hu @tab @tab @ifhtml @@ -259,7 +259,7 @@ partially LilyPond --- \TITLE\ @* 1107 -@tab +@tab Team-hu @tab @tab @ifhtml @@ -286,7 +286,7 @@ partially 1 A @command{lilypond} használata @* 2902 -@tab +@tab Team-hu @tab @tab @ifhtml @@ -313,7 +313,7 @@ yes 2 A @command{convert-ly} használata @* 1189 -@tab +@tab Team-hu @tab @tab @ifhtml @@ -339,7 +339,7 @@ yes @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond -- kottaszedés mindenkinek diff --git a/Documentation/it/translations.itexi b/Documentation/it/translations.itexi index fd351d1b83..71541463c7 100644 --- a/Documentation/it/translations.itexi +++ b/Documentation/it/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem Manuale di apprendimento di LilyPond diff --git a/Documentation/ja/translations.itexi b/Documentation/ja/translations.itexi index 18e87031b5..eded04be9e 100644 --- a/Documentation/ja/translations.itexi +++ b/Documentation/ja/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond -- 学習マニュアル @@ -219,7 +219,7 @@ partially @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem GNU LilyPond -- アプリケーション使用方法 @@ -393,7 +393,7 @@ partially @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond -- みんなの楽譜作成 diff --git a/Documentation/nl/translations.itexi b/Documentation/nl/translations.itexi index 22dc17d61b..fe330d151f 100644 --- a/Documentation/nl/translations.itexi +++ b/Documentation/nl/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:20 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond beginnershandleiding @@ -165,7 +165,7 @@ ja @end multitable -@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0 +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond -- Muzieknotatie voor iedereen diff --git a/Documentation/translations.itexi b/Documentation/translations.itexi index 2b22b660a5..4a0b0b9302 100644 --- a/Documentation/translations.itexi +++ b/Documentation/translations.itexi @@ -16,9 +16,9 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Tue Apr 13 08:17:19 UTC 2010 +@emph{Last updated Tue Apr 13 10:11:41 UTC 2010 } -@multitable +@multitable @columnfractions 0.5 0.5 @headitem LilyPond Changes @@ -53,7 +53,7 @@ partially up to date @end multitable -@multitable +@multitable @columnfractions 0.25 0.25 0.25 0.25 @headitem Essay on automated music engraving @@ -87,7 +87,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -180,7 +180,7 @@ translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -273,7 +273,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -370,7 +370,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -465,7 +465,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -534,7 +534,7 @@ up to date @end multitable -@multitable +@multitable @columnfractions 0.333333333333 0.333333333333 0.333333333333 @headitem Extending LilyPond @@ -567,7 +567,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -617,7 +617,7 @@ translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -667,7 +667,7 @@ partially translated (4 %) @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -717,7 +717,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -767,7 +767,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-es @* @ifhtml @@ -793,7 +793,7 @@ up to date @end multitable -@multitable +@multitable @columnfractions 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125 @headitem LilyPond Learning Manual @@ -2626,7 +2626,7 @@ up to date @end multitable -@multitable +@multitable @columnfractions 0.25 0.25 0.25 0.25 @headitem LilyPond Notation Reference @@ -5191,7 +5191,7 @@ up to date @end multitable -@multitable +@multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @headitem LilyPond Application Usage @@ -5275,7 +5275,7 @@ translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -5396,7 +5396,7 @@ translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -5519,7 +5519,7 @@ not translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -5640,7 +5640,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -5781,7 +5781,7 @@ not translated @ifnothtml partially up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -5902,7 +5902,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -6023,7 +6023,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -6144,7 +6144,7 @@ not translated @ifnothtml up to date @end ifnothtml -@tab +@tab Team-hu @* @ifhtml @@ -6193,7 +6193,7 @@ up to date @end multitable -@multitable +@multitable @columnfractions 0.142857142857 0.142857142857 0.142857142857 0.142857142857 0.142857142857 0.142857142857 0.142857142857 @headitem LilyPond -- Music notation for everyone diff --git a/scripts/auxiliar/translations-status.py b/scripts/auxiliar/translations-status.py index 7337a4f43c..221746360b 100755 --- a/scripts/auxiliar/translations-status.py +++ b/scripts/auxiliar/translations-status.py @@ -12,12 +12,16 @@ USAGE: cd Documentation && translations-status.py contributor/doc-translation-list.itexi TODO: - * decide if we really want this in printed output: - - the PDF output of TexiMarkup () is useless - - the INFO output of TexiMarkup() is useless - - using markup = HTMLMarkup (), we get nice - popups -- do we want that with texi output? -- how? - or possibly links to the git archive? + * using markup = TexiMarkup (), html tables (columns) + are evenly spaced and bit too wide. This can + be fixed by using + @multitable @columnfractions 0 0 0 0 0 0 0 0, + but with that, PDF and info output get borked. + * in info and PDF, columns have too little separation + * using markup = HTMLMarkup (), we get nice + + popups -- do we want that with texi output? -- how? + or possibly links to the git archive? ''' @@ -203,7 +207,7 @@ class HTMLMarkup (object): Translation status currently only available in HTML. @end ifnothtml ''' - + self.html (string) + + string + self.texi_footer) def entity (self, name, string='', attributes=[]): attr_list = ''.join ([' %s="%s"' % x for x in attributes]) @@ -237,12 +241,22 @@ th { border: 1px solid black; text-align: center; } td { border: 1px solid black; text-align: center; } !--> ''') - + (string - .replace ('''item \n@tab ''', '''item -''') - .replace ('@multitable', - '@multitable @columnfractions' + ' 0' * 10)) + + self.columnfraction_disaster (self.itemtab_disaster (string)) + self.texi_footer) + def itemtab_disaster (self, string): + return string.replace ('''item \n@tab ''', '''item +''') + def columnfraction_disaster (self, string): + if False: + # nice trick for html-only + return string.replace ('@multitable', '@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0') + tables = re.findall ('(?s)(@multitable)(.*?)(@item)', string) + for t in tables: + columns = len (re.findall ('(?s)(\n@tab)', t[1])) + 1 + columnfractions = '@columnfractions ' + (' ' + str (1.0/columns)) * columns + string = string.replace ('@multitable\n', + '@multitable %(columnfractions)s\n' % locals (), 1) + return string def entity (self, name, string='', attributes=[]): return ''' @%(name)s @@ -357,8 +371,8 @@ class TranslatedTelyDocument (TelyDocument): and (not self.translators or not self.translators[0]) and not 'macros.itexi' in self.filename): error (self.filename + ''': error: no translator name found -please specify one ore more lines in the master file -@c Translator: FirstName LastName[, FirstName LastName]..''') + please specify one ore more lines in the master file + @c Translator: FirstName LastName[, FirstName LastName]..''') self.checkers = [] m = checkers_re.findall (self.contents) if m: @@ -696,7 +710,11 @@ date_time = buildlib.read_pipe ('LANG= date -u')[0] # TEXI output sort of works # TODO: table border, td-titles :-) # markup = HTMLMarkup () +#sys.stderr.write ('''translations-status.py:713: warning: using markup = HTMLMarkup (): HTML only\n''') markup = TexiMarkup () +sys.stderr.write ('''translations-status.py:717: warning: using markup = TexiMarkup (): ugly HTML + output, questionable PDF and info output. + Consider using HTML-only markup = HTMLMarkup ()\n''') main_status_body = markup.paragraph (markup.emph (last_updated_string % date_time)) main_status_body += '\n'.join ([doc.texi_status (markup) for doc in master_docs]) -- 2.39.2