From 865cf0815b8f89ac5d4be357d5c3e38d86699678 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Wed, 21 Oct 2009 13:26:40 +0200 Subject: [PATCH] Partially fix documentation translation generation - 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 | 17 ++++------------- scripts/auxiliar/texi-langutils.py | 9 +++++---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 0a1b168122..3f3460998c 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -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: diff --git a/scripts/auxiliar/texi-langutils.py b/scripts/auxiliar/texi-langutils.py index 24cb2ecec9..f35ebb8e73 100755 --- a/scripts/auxiliar/texi-langutils.py +++ b/scripts/auxiliar/texi-langutils.py @@ -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 () -- 2.39.2