From 9f22fa7cf557ef87ec61372c9e7743d04bbd5725 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 16 Aug 2018 08:58:09 +0200 Subject: Translate the language names in JS. Change-Id: I7185a7d0981abbacef4a152ee6ac5352ebe970cd Reviewed-on: https://gerrit.libreoffice.org/59150 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- CustomTarget_html.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'CustomTarget_html.mk') diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk index ad383a0085..00c6c7e2e8 100644 --- a/CustomTarget_html.mk +++ b/CustomTarget_html.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CustomTarget_register_targets,helpcontent2/help3xsl,\ $(lang)/bookmarks.js \ $(lang)/contents.js \ $(lang)/html.text \ + $(lang)/langnames.js \ $(foreach module,$(html_TREE_MODULES),$(module)/$(lang)/contents.part) \ $(foreach module,$(html_BMARK_MODULES),$(firstword $(subst :, ,$(module)))/$(lang)/bookmarks.part) \ $(foreach module,$(html_TEXT_MODULES),filelists/html-help/$(module)/$(lang).filelist) \ @@ -47,6 +48,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \ ) > $@ \ ) +# set of installed languages - has to be language independent $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/languages.js : \ $(SRCDIR)/helpcontent2/CustomTarget_html.mk ( \ @@ -55,6 +57,24 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/languages.js : \ echo ']);' \ ) > $@ +define html_gen_langnames_js_dep +$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/langnames.js : \ + $(if $(filter en-US,$(1)),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$(1)))/helpcontent2/source/text/shared/help/browserhelp.xhp + +endef + +$(eval $(foreach lang,$(gb_HELP_LANGS),$(call html_gen_langnames_js_dep,$(lang)))) + +# names of the languages - has to be translated, ie. per language +$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/langnames.js : \ + $(SRCDIR)/helpcontent2/CustomTarget_html.mk + ( \ + echo 'var languageNames = {' ; \ + grep ']*id="lang_' $(if $(filter en-US,$*),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$*))/helpcontent2/source/text/shared/help/browserhelp.xhp | \ + sed -e 's/^.*]*>\([^<]*\)<.*$$/"\1": "\2",/' ; \ + echo '};' \ + ) > $@ + define html_gen_contents_html_dep $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/contents.part : $(call gb_HelpTarget__get_treefile,$(1),$(3)) $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/contents.part : TREE_FILE := $(call gb_HelpTarget__get_treefile,$(1),$(3)) -- cgit