]> git.donarmstrong.com Git - lilypond.git/commitdiff
Partially fix documentation translation generation
authorJohn Mandereau <john.mandereau@gmail.com>
Wed, 21 Oct 2009 11:26:40 +0000 (13:26 +0200)
committerJohn Mandereau <john.mandereau@gmail.com>
Wed, 21 Oct 2009 17:10:08 +0000 (19:10 +0200)
- generate Texinfo skeletons with @translationof;

- do not copy any file besides GNUmakefile and Texinfo skeletons into
new language directories -- for each such file, either it is common to
all languages or it needs to be translated, thus in either case it
should not be copied into the new language directory;

- do not create directories for nuts, they can be created later using
TRANSLATION_DIRS=newdir new-lang.

Documentation/GNUmakefile
scripts/auxiliar/texi-langutils.py

index 0a1b168122be1ef95f7376c3e6167bafc54fd9ba..3f3460998c0d5598a3640544df47c25635ab7bbe 100644 (file)
@@ -119,6 +119,7 @@ extra-local-help:
 \n\
 Translations specific targets (see TRANSLATION for details):\n\
   new-lang ISOLANG=LL  create and initialize subdirectory \'LL' for language \'LL\n\
+(if \'LL exists, update missing file)\n\
   po-update            update and replace PO files for documentation with msgmerged versions\n\
   check-translation ISOLANG=LL   show changes in English docs since last translation update\n\
   update-translation ISOLANG=LL  call $$$$EDITOR to help updating the translation\n\
@@ -257,30 +258,20 @@ new-lang-dir:
        rm -f $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi
        for i in $$(cd $(outdir) && ls -1 *.*tely *.*texi); do\
            test -e $(ISOLANG)/$(DIR)/$$i\
+               || test -e $(ISOLANG)/$$i\
                || mv $(outdir)/$$i $(ISOLANG)/$(DIR)/$$i;\
        done
 
 new-lang:
 # Also for updating/adding missing files
+       mkdir -p $(ISOLANG)
        $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) :
-       $(foreach i, $(EXTRA_TRANSLATION_FILES), \
-           (test -e $(ISOLANG)/$(i) \
-               || cp fr/$(i) $(ISOLANG)/$(i)) && ) true
        msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
        test -e po/$(ISOLANG).po || cp po/lilypond-doc.pot po/$(ISOLANG).po
        @echo "***  Please add a language definition for $(ISOLANG) in python/langdefs.py  ***"
 
-#TRANSLATION_DIRS = $(shell git ls-files $(ISOLANG) | $(PYTHON) $(buildscript-dir)/pytt.py '/[^/]*$$' / | sort -u )
-TRANSLATION_DIRS = general learning notation texidocs usage
+TRANSLATION_DIRS = general texidocs
 TRANSLATION_FILES = $(shell git ls-files $(ISOLANG) | grep -v GNUmakefile)
-EXTRA_TRANSLATION_FILES =\
- dedication.itely\
- common-macros.itexi\
- macros.itexi\
- translations.html.in\
- translations.template.html.in\
-#
-
 
 TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely)
 skeleton-update:
index 24cb2ecec9a6f9e69e7127c333228498b6de8f7a..f35ebb8e731b8ff29aa5f8cf0c922050da9f496f 100755 (executable)
@@ -110,7 +110,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
             subst.update (locals ())
             g.write (i_blurb % subst)
             tutu = texinfo_with_menus_re.findall (texifile)
-            node_trigger = False
+            node_just_defined = ''
             for item in tutu:
                 if item[0] == '*':
                     g.write ('* ' + item[1] + '::\n')
@@ -127,9 +127,10 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                     if item[3].startswith ('{') or not item[3].strip ():
                         space = ''
                     g.write ('@' + item[2] + space + item[3] + '\n')
-                    if node_trigger:
+                    if node_just_defined:
+                        g.write ('@translationof ' + node_just_defined + '\n')
                         g.write (n_blurb)
-                        node_trigger = False
+                        node_just_defined = ''
                     elif item[2] == 'include':
                         includes.append (item[3])
                     else:
@@ -137,7 +138,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                             output_file.write ('# @' + item[2] + ' in ' + \
                                 printedfilename + '\n_(r"' + item[3].strip () + '")\n')
                         if item[2] == 'node':
-                            node_trigger = True
+                            node_just_defined = item[3].strip ()
             g.write (end_blurb)
             g.close ()