summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/lilypond-texi2html-lang.init18
-rw-r--r--make/doc-i18n-root-vars.make8
2 files changed, 25 insertions, 1 deletions
diff --git a/Documentation/lilypond-texi2html-lang.init b/Documentation/lilypond-texi2html-lang.init
new file mode 100644
index 0000000000..dc89070bc3
--- /dev/null
+++ b/Documentation/lilypond-texi2html-lang.init
@@ -0,0 +1,18 @@
+# Languages minimum initialization for texi2html
+# $LANGUAGES will be overwritten by lilypond-texi2html.init.
+
+use utf8;
+
+my @langlist = (
+ 'ca', 'cs', 'de', 'es', 'fr', 'hu', 'it', 'ja', 'nl', 'po', 'zh'
+);
+
+foreach my $lang (@langlist)
+{
+ unless (exists($LANGUAGES->{$lang}) && defined($LANGUAGES->{$lang}))
+ {
+ $LANGUAGES->{$lang} = {};
+ }
+}
+
+return 1;
diff --git a/make/doc-i18n-root-vars.make b/make/doc-i18n-root-vars.make
index 9178d57b36..9ff0df3a77 100644
--- a/make/doc-i18n-root-vars.make
+++ b/make/doc-i18n-root-vars.make
@@ -41,6 +41,7 @@ WEB_MANUALS=web
###########
ifneq ($(ISOLANG),)
+TEXI2HTML_LANG_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html-lang.init
TEXI2HTML_LANG = --document-language=$(ISOLANG)
endif
@@ -52,7 +53,12 @@ TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.ini
TEXI2HTML_SPLIT = --prefix=index --split=section
TEXI2HTML_INCLUDES += --I=. --I=$(src-dir) --I=$(outdir) $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR)
-TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_LANG) $(TEXI2HTML_INIT)
+# To overwrite texi2html default i18n messages with the LilyPond init file,
+# delete TEXI2HTML_INIT that exists before TEXI2HTML_LANG.
+TEXI2HTML_FLAGS := $(filter-out $(TEXI2HTML_INIT),$(TEXI2HTML_FLAGS))
+# Instead, add languages minimum initialization before TEXI2HTML_LANG.
+TEXI2HTML_FLAGS := $(subst $(TEXI2HTML_LANG),$(TEXI2HTML_LANG_INIT) $(TEXI2HTML_LANG),$(TEXI2HTML_FLAGS))
+TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_LANG_INIT) $(TEXI2HTML_LANG) $(TEXI2HTML_INIT)
TEXI2HTML = TOP_SRC_DIR=$(top-src-dir) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
###########