Skip to content

Simplify translation workflow by using high-level po4a #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ endef
define clean-function
if [ -d ./$(1) ]; then \
cd ./$(1) && rm -rf build/ \
translations/ \
.cache/ \
public/ \
modules/installation/nav-installation-guide.pdf.$(2).adoc \
Expand All @@ -88,7 +89,8 @@ define clean-function
modules/retail/nav-retail-guide.pdf.$(2).adoc \
modules/architecture/nav-architecture-guide.pdf.$(2).adoc \
modules/quickstart-public-cloud/nav-quickstart-public-cloud-guide.pdf.$(2).adoc \
modules/large-deployments/nav-large-deployments.pdf.$(2).adoc; \
modules/large-deployments/nav-large-deployments-guide.pdf.$(2).adoc \
modules/quickstart-sap/nav-quickstart-sap-guide.pdf.$(2).adoc; \
fi
endef

Expand Down Expand Up @@ -284,11 +286,11 @@ help: ## Prints a basic help menu about available targets

.PHONY: pot
pot:
$(shell $(current_dir)/make_pot.sh)
$(current_dir)/make_pot.sh

.PHONY: translations
translations:
$(shell $(current_dir)/use_po.sh)
$(current_dir)/use_po.sh

.PHONY: clean
clean: clean-en clean-es
Expand Down
12 changes: 7 additions & 5 deletions Makefile.es
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ pdf-tar-suma-$(LANGCODE_ES):
.PHONY: prepare-antora-suma-$(LANGCODE_ES)
prepare-antora-suma-$(LANGCODE_ES):
-mkdir -p $(LANGDIR_ES) && \
cp antora.yml $(LANGDIR_ES)/antora.yml && \
cp -a antora.yml $(LANGDIR_ES)/antora.yml && \
sed "s/\.\/branding/\.\.\/\.\.\/branding/;\
s/\-\ url\:\ \./\-\ url\:\ \.\.\/\.\.\//;\
s/start_path\:\ \./\start_path\:\ translations\/$(LANGCODE_ES)/;\
s/dir:\ \.\/build\/en/dir:\ \.\.\/\.\.\/build\/$(LANGCODE_ES)/;" suma-site.yml > $(LANGDIR_ES)/suma-site.yml && \
cd $(LANGDIR_ES) && \
if [ ! -e branding ]; then ln -s ../../branding; fi
if [ ! -e branding ]; then ln -s ../../branding; fi && \
cp -a $(CURDIR)/modules/ROOT/pages/common_gfdl1.2_i.adoc $(CURDIR)/$(LANGDIR_ES)/modules/ROOT/pages/

.PHONY: antora-suma-$(LANGCODE_ES)
antora-suma-$(LANGCODE_ES): clean-$(LANGCODE_ES) pdf-all-suma-$(LANGCODE_ES) pdf-tar-suma-$(LANGCODE_ES)
Expand All @@ -47,7 +48,7 @@ obs-packages-suma-$(LANGCODE_ES): clean-$(LANGCODE_ES) pdf-all-suma-$(LANGCODE_E

# Generate PDF versions of all SUMA books
.PHONY: pdf-all-suma-$(LANGCODE_ES)
pdf-all-suma-$(LANGCODE_ES): prepare-antora-suma-$(LANGCODE_ES) translations pdf-install-suma-$(LANGCODE_ES) pdf-client-configuration-suma-$(LANGCODE_ES) pdf-upgrade-suma-$(LANGCODE_ES) pdf-reference-suma-$(LANGCODE_ES) pdf-administration-suma-$(LANGCODE_ES) pdf-salt-suma-$(LANGCODE_ES) pdf-retail-suma-$(LANGCODE_ES) pdf-quickstart-public-cloud-suma-$(LANGCODE_ES) pdf-large-deployment-suma-$(LANGCODE_ES) ##pdf-architecture-suma-webui-$(LANGCODE_ES)
pdf-all-suma-$(LANGCODE_ES): translations prepare-antora-suma-$(LANGCODE_ES) pdf-install-suma-$(LANGCODE_ES) pdf-client-configuration-suma-$(LANGCODE_ES) pdf-upgrade-suma-$(LANGCODE_ES) pdf-reference-suma-$(LANGCODE_ES) pdf-administration-suma-$(LANGCODE_ES) pdf-salt-suma-$(LANGCODE_ES) pdf-retail-suma-$(LANGCODE_ES) pdf-quickstart-public-cloud-suma-$(LANGCODE_ES) pdf-large-deployment-suma-$(LANGCODE_ES) ##pdf-architecture-suma-webui-$(LANGCODE_ES)

.PHONY: modules/installation/nav-installation-guide.pdf.$(LANGCODE_ES).adoc
modules/installation/nav-installation-guide.pdf.$(LANGCODE_ES).adoc:
Expand Down Expand Up @@ -161,7 +162,8 @@ prepare-antora-uyuni-$(LANGCODE_ES):
s/start_path\:\ \./\start_path\:\ translations\/es/;\
s/dir:\ \.\/build\/en/dir:\ \.\.\/\.\.\/build\/es/;" uyuni-site.yml > $(LANGDIR_ES)/uyuni-site.yml && \
cd $(LANGDIR_ES) && \
if [ ! -e branding ]; then ln -s ../../branding; fi
if [ ! -e branding ]; then ln -s ../../branding; fi && \
cp -a $(CURDIR)/modules/ROOT/pages/common_gfdl1.2_i.adoc $(CURDIR)/$(LANGDIR_ES)/modules/ROOT/pages/

.PHONY: antora-uyuni-$(LANGCODE_ES)
antora-uyuni-$(LANGCODE_ES): clean-$(LANGCODE_ES) pdf-all-uyuni-$(LANGCODE_ES) pdf-tar-uyuni-$(LANGCODE_ES)
Expand All @@ -173,7 +175,7 @@ obs-packages-uyuni-$(LANGCODE_ES): clean-$(LANGCODE_ES) pdf-all-uyuni-$(LANGCODE

# Generate PDF versions of all UYUNI books
.PHONY: pdf-all-uyuni-$(LANGCODE_ES)
pdf-all-uyuni-$(LANGCODE_ES): prepare-antora-uyuni-$(LANGCODE_ES) translations pdf-install-uyuni-$(LANGCODE_ES) pdf-client-configuration-uyuni-$(LANGCODE_ES) pdf-upgrade-uyuni-$(LANGCODE_ES) pdf-reference-uyuni-$(LANGCODE_ES) pdf-administration-uyuni-$(LANGCODE_ES) pdf-salt-uyuni-$(LANGCODE_ES) pdf-retail-uyuni-$(LANGCODE_ES) pdf-quickstart-public-cloud-uyuni-$(LANGCODE_ES) pdf-large-deployment-uyuni-$(LANGCODE_ES) ##pdf-architecture-uyuni-webui-$(LANGCODE_ES)
pdf-all-uyuni-$(LANGCODE_ES): translations prepare-antora-uyuni-$(LANGCODE_ES) pdf-install-uyuni-$(LANGCODE_ES) pdf-client-configuration-uyuni-$(LANGCODE_ES) pdf-upgrade-uyuni-$(LANGCODE_ES) pdf-reference-uyuni-$(LANGCODE_ES) pdf-administration-uyuni-$(LANGCODE_ES) pdf-salt-uyuni-$(LANGCODE_ES) pdf-retail-uyuni-$(LANGCODE_ES) pdf-quickstart-public-cloud-uyuni-$(LANGCODE_ES) pdf-large-deployment-uyuni-$(LANGCODE_ES) ##pdf-architecture-uyuni-webui-$(LANGCODE_ES)

## Generate PDF version of the UYUNI Installation Guide
.PHONY: pdf-install-uyuni-$(LANGCODE_ES)
Expand Down
14 changes: 14 additions & 0 deletions l10n-weblate/ROOT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[po4a_langs] es zh_CN cs
[po4a_paths] l10n-weblate/ROOT/ROOT.pot $lang:l10n-weblate/ROOT/$lang.po

[po4a_alias:adoc] adoc opt:"-M UTF-8 -L UTF-8"

[options] opt:"--porefs=counter"

[type: asciidoc] modules/ROOT/_attributes.adoc $lang:translations/$lang/modules/ROOT/_attributes.adoc
[type: asciidoc] modules/ROOT/pages/_partials/entities.adoc $lang:translations/$lang/modules/ROOT/pages/_partials/entities.adoc
#[type: asciidoc] modules/ROOT/pages/common_gfdl1.2_i.adoc $lang:translations/$lang/modules/ROOT/pages/common_gfdl1.2_i.adoc
[type: asciidoc] modules/ROOT/pages/index-uyuni.adoc $lang:translations/$lang/modules/ROOT/pages/index-uyuni.adoc
[type: asciidoc] modules/ROOT/pages/index.adoc $lang:translations/$lang/modules/ROOT/pages/index.adoc
[type: asciidoc] modules/ROOT/pages/snippets/add_channels_cli.adoc $lang:translations/$lang/modules/ROOT/pages/snippets/add_channels_cli.adoc
[type: asciidoc] modules/ROOT/nav.adoc $lang:translations/$lang/modules/ROOT/nav.adoc
Loading