]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 21 Mar 2008 08:40:56 +0000 (09:40 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 21 Mar 2008 08:40:56 +0000 (09:40 +0100)
* 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond:
  lilypond-book: Generate valid HTML 4.01 Transistional
  Fix @warning{} box.

Documentation/TRANSLATION
Documentation/translations.html.in
buildscripts/translations-status.py

index 61b2e6d02d0cd796e682021639eaaa54c2eaa1c6..56d6e5e3bca72a566df2385271047fe3e3b7c2ac 100644 (file)
@@ -74,95 +74,79 @@ Translation of Documentation/foo/bar should be
 Documentation/<LANG>/foo/bar.
 Unmentioned files should not be translated.
 
-Priorities:  1. delivery, 2. 3. 4. 5. later, 6. optional.
+Priorities:
+  1. delivery
+  2. 3. 4. 5. later
+  6. optional
 
 Files marked with priority 3, 4 or 5 may be submitted individually.
+Word counts (excluding lilypond snippets) are given for each file.
 
--1- Documentation index, Tutorial and Cheat Sheet
-1 user/lilypond.tely
-1 user/tutorial.itely
-1 user/dedication.itely
-1 user/cheatsheet.itely
-1 index.html.in
-  po/<MY-LANGUAGE>.po
+-1- Documentation index and Tutorial
+396   user/lilypond-learning.tely
+5593  user/tutorial.itely
+23    user/dedication.itely
+216   index.html.in
+1954  po/lilypond-doc.pot (translate to po/<MY_LANGUAGE>.po)
+8182  total
 
 In addition, user/macros.itexi may be translated in case typographic
 rules used in this file are different in your language.
 
--2- User manual introduction
-2 user/preface.itely
-2 user/introduction.itely
+-2- Introduction and beginning of Application Usage
+411   user/preface.itely
+3198  user/introduction.itely
+374   user/lilypond-program.tely
+1477  user/install.itely (partial translation)
+947   user/setup.itely
+2860  user/running.itely
+9267  total
 
 -3- Learning manual
-3 user/putting.itely -- Putting it all together
-3 user/working.itely -- Working on LilyPond files
-3 user/tweaks.itely -- Tweaking output
+8626  user/fundamental.itely -- Fundamental concepts
+12134 user/tweaks.itely -- Tweaking output
+2985  user/working.itely -- Working on LilyPond files
+483   user/templates.itely -- Templates
+24228 total
 
 -4- Notation reference
-4 user/basic-notation.itely -- Basic notation
-4 user/instrument-notation.itely -- Instrument-specific notation
-4 user/advanced-notation.itely -- Advanced notation
-4 user/changing-defaults.itely -- Changing defaults
-4 user/non-music.itely -- Non-musical notation
-4 user/spacing.itely -- Spacing issues
-4 user/programming-interface.itely -- Interfaces for programmers
-4 user/scheme-tutorial.itely -- Scheme tutorial
-
--5- Program usage
-5 user/lilypond-program.tely
-5 user/install.itely -- How to install or compile
-5 user/running.itely -- Running LilyPond
-5 user/lilypond-book.itely -- LilyPond-book
-5 user/converters.itely -- Converting from other formats
+539   user/lilypond.tely
+91    user/notation.itely -- Musical notation
+2808  user/pitches.itely
+7336  user/rhythms.itely
+1681  user/expressive.itely
+725   user/repeats.itely
+916   user/simultaneous.itely
+1861  user/staff.itely
+879   user/editorial.itely
+2336  user/text.itely
+54    user/specialist.itely -- Specialist notation
+2630  user/vocal.itely
+1275  user/chords.itely
+702   user/piano.itely
+481   user/percussion.itely
+826   user/guitar.itely
+66    user/strings.itely
+242   user/bagpipes.itely
+4289  user/ancient.itely
+2502  user/input.itely -- Input syntax
+2164  user/non-music.itely -- Non-musical notation
+8399  user/spacing.itely -- Spacing issues
+5107  user/changing-defaults.itely -- Changing defaults
+4547  user/programming-interface.itely -- Interfaces for programmers
+935   user/notation-appendices.itely -- Notation manual tables
+250   user/cheatsheet.itely -- Cheat sheet
+53641 total
+
+-5- Application usage
+2917  user/lilypond-book.itely -- LilyPond-book
+975   user/converters.itely -- Converting from other formats
+3892  total
 
 -6- Appendices whose translation is optional
-6 user/literature.itely
-6 user/templates.itely
-6 user/notation-appendices.itely
-
-* WORD COUNTS FOR CATEGORIES
-
-LANG=C wc --words $(grep ^1 TRANSLATION | cut -d ' ' -f 2)
-  777 user/lilypond.tely
- 6322 user/tutorial.itely
-   63 user/dedication.itely
-  632 user/cheatsheet.itely
-  361 index.html.in
- 8155 total
-
-LANG=C wc --words $(grep ^2 TRANSLATION | cut -d ' ' -f 2)
-  451 user/preface.itely
- 4170 user/introduction.itely
- 4621 total
-
-LANG=C wc --words $(grep ^3 TRANSLATION | cut -d ' ' -f 2)
- 2230 user/putting.itely
- 3232 user/working.itely
- 2327 user/tweaks.itely
- 7789 total
-
-LANG=C wc --words $(grep ^4 TRANSLATION | cut -d ' ' -f 2)
- 12391 user/basic-notation.itely
- 15779 user/instrument-notation.itely
-  9530 user/advanced-notation.itely
-  7386 user/changing-defaults.itely
-  3884 user/non-music.itely
-  8318 user/spacing.itely
-  4781 user/programming-interface.itely
-   915 user/scheme-tutorial.itely
- 62984 total
-
-LANG=C wc --words $(grep ^5 TRANSLATION | cut -d ' ' -f 2)
- 3566 user/running.itely
- 3549 user/lilypond-book.itely
- 1062 user/converters.itely
- 8177 total
-
-LANG=C wc --words $(grep ^6 TRANSLATION | cut -d ' ' -f 2)
-  339 user/literature.itely
- 4648 user/templates.itely
-  836 user/notation-appendices.itely
- 5823 total
+299   user/literature.itely
+960   user/scheme-tutorial.itely (needs to be revised first)
+1259  total
 
 
 TRANSLATION DETAILED INSTRUCTIONS
index f514d31f922468a183f819f6a0426186f8f09d18..6c5bc16fb48a63974401132cd646098c5460eb0a 100644 (file)
@@ -38,7 +38,7 @@ translations.template.html.in; DO NOT EDIT !-->
   is finished.
 </p>
 
- <p><i>Last updated Sun Mar 16 15:46:21 UTC 2008
+ <p><i>Last updated Fri Mar 21 08:33:58 UTC 2008
 </i></p>
 <table align="center" border="2">
  <tr align="center">
@@ -51,7 +51,7 @@ translations.template.html.in; DO NOT EDIT !-->
   <td>John Mandereau<br>
    Jean-Charles Malahieude<br>
    <span style="background-color: #1fff1f">translated</span><br>
-   <span style="background-color: #6fff29">partially up to date</span><br>
+   <span style="background-color: #1fff1f">up to date</span><br>
   </td>
   <td>Till Rettig<br>
    <span style="background-color: #1fff1f">translated</span><br>
@@ -126,7 +126,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
   <td>   <span style="background-color: #d0f0f8">not translated</span><br>
   </td>
-  <td>   <span style="background-color: #dfef77">partially translated (27 %)</span><br>
+  <td>   <span style="background-color: #dfef77">partially translated (50 %)</span><br>
   </td>
  </tr>
  <tr align="left">
@@ -249,7 +249,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
  </tr>
  <tr align="left">
-  <td>1.2 Rhythms<br>(7279)</td>
+  <td>1.2 Rhythms<br>(7336)</td>
   <td>Frédéric Chiasson<br>
    <small>Valentin Villenave<br>
    Jean-Charles Malahieude</small><br>
@@ -257,12 +257,12 @@ translations.template.html.in; DO NOT EDIT !-->
    <span style="background-color: #d587ff"></span><br>
   </td>
   <td>Till Rettig<br>
-   <span style="background-color: #dfef77">partially translated (82 %)</span><br>
+   <span style="background-color: #dfef77">partially translated (83 %)</span><br>
    <span style="background-color: #d587ff"></span><br>
   </td>
   <td>Francisco Vila<br>
-   <span style="background-color: #dfef77">partially translated (87 %)</span><br>
-   <span style="background-color: #5bff27">partially up to date</span><br>
+   <span style="background-color: #dfef77">partially translated (84 %)</span><br>
+   <span style="background-color: #83fe2c">partially up to date</span><br>
   </td>
  </tr>
  <tr align="left">
@@ -283,7 +283,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
  </tr>
  <tr align="left">
-  <td>1.4 Repeats<br>(738)</td>
+  <td>1.4 Repeats<br>(725)</td>
   <td>Valentin Villenave<br>
    <small>Jean-Charles Malahieude<br>
    John Mandereau</small><br>
@@ -296,7 +296,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
   <td>Francisco Vila<br>
    <span style="background-color: #1fff1f">translated</span><br>
-   <span style="background-color: #6fff29">partially up to date</span><br>
+   <span style="background-color: #8aff2d">partially up to date</span><br>
   </td>
  </tr>
  <tr align="left">
@@ -350,7 +350,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
  </tr>
  <tr align="left">
-  <td>1.8 Text<br>(2361)</td>
+  <td>1.8 Text<br>(2336)</td>
   <td>Jean-Charles Malahieude<br>
    <small>Valentin Villenave<br>
    John Mandereau</small><br>
@@ -361,7 +361,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
   <td>Francisco Vila<br>
    <span style="background-color: #1fff1f">translated</span><br>
-   <span style="background-color: #33ff21">partially up to date</span><br>
+   <span style="background-color: #62ff28">partially up to date</span><br>
   </td>
  </tr>
  <tr align="left">
@@ -514,10 +514,10 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
  </tr>
  <tr align="left">
-  <td>3 Input syntax<br>(2458)</td>
+  <td>3 Input syntax<br>(2502)</td>
   <td>Jean-Charles Malahieude<br>
    <span style="background-color: #dfef77">partially translated (7 %)</span><br>
-   <span style="background-color: #25fe1f">partially up to date</span><br>
+   <span style="background-color: #2cff20">partially up to date</span><br>
   </td>
   <td>   <span style="background-color: #d0f0f8">not translated</span><br>
   </td>
@@ -548,7 +548,7 @@ translations.template.html.in; DO NOT EDIT !-->
   </td>
  </tr>
  <tr align="left">
-  <td>6 Changing defaults<br>(5105)</td>
+  <td>6 Changing defaults<br>(5107)</td>
   <td>Valentin Villenave<br>
    <small>Gilles Thibault</small><br>
    <span style="background-color: #1fff1f">translated</span><br>
index 1d53780b9b613192f6c623f80fe0d8dc3f7ad42b..b9f62a706f84e0964649259062b53051f850a54c 100644 (file)
@@ -7,9 +7,10 @@ USAGE: translations-status.py BUILDSCRIPT-DIR LOCALEDIR
 
   Reads template files translations.template.html.in
 and for each LANG in LANGUAGES LANG/translations.template.html.in
-
   Writes translations.html.in and for each LANG in LANGUAGES
 translations.LANG.html.in
+  Writes out/translations-status.txt
+  Updates word counts in TRANSLATION
 """
 
 import sys
@@ -145,6 +146,24 @@ def percentage_color (percent):
         c = [hex (int ((3 * p - 2) * b + 3 * (1 - p) * a))[2:] for (a, b) in [(0xff, 0x1f), (0xff, 0xff), (0x3d, 0x1f)]]
     return ''.join (c)
 
+
+def update_word_count (text, filename, word_count):
+    return re.sub (r'(?m)^(\d+) *' + filename,
+                   str (word_count).ljust (6) + filename,
+                   text)
+
+po_msgid_re = re.compile (r'^msgid "(.*?)"(?:\n"(.*?)")*', re.M)
+
+def po_word_count (po_content):
+    s = ' '.join ([''.join (t) for t in po_msgid_re.findall (po_content)])
+    return len (space_re.split (s))
+
+sgml_tag_re = re.compile (r'<.*?>', re.S)
+
+def sgml_word_count (sgml_doc):
+    s = sgml_tag_re.sub ('', sgml_doc)
+    return len (space_re.split (s))
+
 def tely_word_count (tely_doc):
     '''
     Calculate word count of a Texinfo document node by node.
@@ -325,9 +344,11 @@ class MasterTelyDocument (TelyDocument):
         else:
             self.includes = []
 
-    # TODO
-    def print_wc_priority (self):
-        return
+    def update_word_counts (self, s):
+        s = update_word_count (s, self.filename, sum (self.word_count))
+        for i in self.includes:
+            s = i.update_word_counts (s)
+        return s
 
     def html_status (self, numbering=SectionNumber ()):
         if self.title == 'Untitled' or not self.translations:
@@ -378,6 +399,15 @@ class MasterTelyDocument (TelyDocument):
         return s
 
 
+update_category_word_counts_re = re.compile (r'(?ms)^-(\d+)-(.*?\n)\d+ *total')
+
+counts_re = re.compile (r'(?m)^(\d+) ')
+
+def update_category_word_counts_sub (m):
+    return '-' + m.group (1) + '-' + m.group (2) + \
+        str (sum ([int (c) for c in counts_re.findall (m.group (2))])).ljust (6) + 'total'
+
+
 progress ("Reading documents...")
 
 tely_files = read_pipe ("find -maxdepth 2 -name '*.tely'")[0].splitlines ()
@@ -421,3 +451,27 @@ main_status_txt += '\n'.join ([doc.text_status () for doc in master_docs])
 status_txt_file = 'out/translations-status.txt'
 progress ("Writing %s..." % status_txt_file)
 open (status_txt_file, 'w').write (main_status_txt)
+
+translation_instructions_file = 'TRANSLATION'
+progress ("Updating %s..." % translation_instructions_file)
+translation_instructions = open (translation_instructions_file).read ()
+
+for doc in master_docs:
+    translation_instructions = doc.update_word_counts (translation_instructions)
+
+for html_file in re.findall (r'(?m)^\d+ *(\S+?\.html\S*?)(?: |$)', translation_instructions):
+    word_count = sgml_word_count (open (html_file).read ())
+    translation_instructions = update_word_count (translation_instructions,
+                                                  html_file,
+                                                  word_count)
+
+for po_file in re.findall (r'(?m)^\d+ *(\S+?\.po\S*?)(?: |$)', translation_instructions):
+    word_count = po_word_count (open (po_file).read ())
+    translation_instructions = update_word_count (translation_instructions,
+                                                  po_file,
+                                                  word_count)
+
+translation_instructions = update_category_word_counts_re.sub (update_category_word_counts_sub,
+                                                               translation_instructions)
+
+open (translation_instructions_file, 'w').write (translation_instructions)