Skip to content

Commit 3177e63

Browse files
committed
Use po4a to provide translatable documentation
This commit add a new "docs-l10n" make target which uses po4a to: * create .pot (PO templates) from markdown doc * update templates and po for enabled languages * generate translated markdown for completed (> 80%) translations Currently, no language has been activated. Signed-off-by: Luca Bruno <[email protected]>
1 parent b168252 commit 3177e63

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/po4a.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Add here a list of target languages; po4a will automatically
2+
# generates .po for them and build .md when translated, eg:
3+
# [po4a_langs] es fr it pt_BR
4+
[po4a_langs]
5+
[po4a_paths] doc/po/$master.pot $lang:doc/po/$lang/$master.po
6+
7+
# Add here below all source documents to be translated
8+
[type: text] doc/rust.md $lang:doc/l10n/$lang/rust.md
9+
[type: text] doc/rustpkg.md $lang:doc/l10n/$lang/rustpkg.md
10+
[type: text] doc/tutorial-container.md $lang:doc/l10n/$lang/tutorial-container.md
11+
[type: text] doc/tutorial.md $lang:doc/l10n/$lang/tutorial.md
12+
[type: text] doc/tutorial-borrowed-ptr.md $lang:doc/l10n/$lang/tutorial-borrowed-ptr.md
13+
[type: text] doc/tutorial-ffi.md $lang:doc/l10n/$lang/tutorial-ffi.md
14+
[type: text] doc/tutorial-macros.md $lang:doc/l10n/$lang/tutorial-macros.md
15+
[type: text] doc/tutorial-tasks.md $lang:doc/l10n/$lang/tutorial-tasks.md

mk/docs.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,8 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
234234
GENERATED += doc/version.md doc/version_info.html
235235

236236
docs: $(DOCS)
237+
238+
docs-l10n:
239+
po4a doc/po4a.conf
240+
241+
.PHONY: docs-l10n

0 commit comments

Comments
 (0)