diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-08-16 08:58:09 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-08-16 13:52:05 +0200 |
commit | 9f22fa7cf557ef87ec61372c9e7743d04bbd5725 (patch) | |
tree | 3f5bc4de325239f5c8eeefff356af3071bc10c5b /CustomTarget_html.mk | |
parent | 7f21cd8b7c0296b13472b42a73239691c98c92b6 (diff) |
Translate the language names in JS.
Change-Id: I7185a7d0981abbacef4a152ee6ac5352ebe970cd
Reviewed-on: https://gerrit.libreoffice.org/59150
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'CustomTarget_html.mk')
-rw-r--r-- | CustomTarget_html.mk | 20 |
1 files changed, 20 insertions, 0 deletions
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 '<paragraph[^>]*id="lang_' $(if $(filter en-US,$*),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$*))/helpcontent2/source/text/shared/help/browserhelp.xhp | \ + sed -e 's/^.*<variable id="\([^"]*\)"[^>]*>\([^<]*\)<.*$$/"\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)) |