@@ -8,6 +8,12 @@ source code.
88the Markdown docs (reference manual, tutorials, etc.) distributed with
99this git repository.
1010
11+ [ po4a] ( http://po4a.alioth.debian.org/ ) is required for generating translated
12+ docs from the master (English) docs.
13+
14+ [ GNU gettext] ( http://www.gnu.org/software/gettext/ ) is required for managing
15+ the translation data.
16+
1117# Building
1218
1319To generate all the docs, just run ` make docs ` from the root of the repository.
@@ -38,3 +44,40 @@ http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
3844
3945A nice quick reference (for non-pandoc markdown) is at:
4046http://kramdown.rubyforge.org/quickref.html
47+
48+ # Notes for translators
49+
50+ To start the translation for a new language, see po4a.conf at first.
51+
52+ To generate .pot and .po files, do something like:
53+
54+ ~~~~
55+ po4a --copyright-holders="The Rust Project Developers" \
56+ --package-name="Rust" \
57+ --package-version="0.10-pre" \
58+ -M UTF-8 -L UTF-8 \
59+ po4a.conf
60+ ~~~~
61+
62+ (the version number must be changed if it is not 0.10-pre now.)
63+
64+ Now you can translate documents with .po files, commonly used with gettext. If
65+ you are not familiar with gettext-based translation, please read the online
66+ manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the
67+ file encoding of .po files.
68+
69+ When you want to make a commit, do the command below before staging your
70+ change:
71+
72+ ~~~~
73+ for f in doc/po/**/*.po; do
74+ msgattrib --untranslated $f -o $f.strip
75+ if [ -e $f.strip ]; then
76+ mv $f.strip $f
77+ else
78+ rm $f
79+ fi
80+ done
81+ ~~~~
82+
83+ This removes untranslated entries from .po files to save disk space.
0 commit comments