Skip to content

remove l10n #19966

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 1 commit into from
Dec 22, 2014
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -216,36 +216,6 @@ endef
$(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname))))


# Localized documentation

# FIXME: I (huonw) haven't actually been able to test properly, since
# e.g. (by default) I'm doing an out-of-tree build (#12763), but even
# adjusting for that, the files are too old(?) and are rejected by
# po4a.
#
# As such, I've attempted to get it working as much as possible (and
# switching from pandoc to rustdoc), but preserving the old behaviour
# (e.g. only running on the guide)
.PHONY: l10n-mds
l10n-mds: $(D)/po4a.conf \
$(foreach lang,$(L10N_LANG),$(D)/po/$(lang)/*.md.po)
$(warning WARNING: localized documentation is experimental)
po4a --copyright-holder="The Rust Project Developers" \
--package-name="Rust" \
--package-version="$(CFG_RELEASE)" \
-M UTF-8 -L UTF-8 \
$(D)/po4a.conf

define DEF_L10N_DOC
DOC_L10N_TARGETS += doc/l10n/$(1)/$(2).html
doc/l10n/$(1)/$(2).html: l10n-mds $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(2))
@$$(call E, rustdoc: $$@)
$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) doc/l10n/$(1)/$(2).md
endef

$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),guide)))


######################################################################
# Rustdoc (libstd/extra)
######################################################################
Expand Down Expand Up @@ -294,7 +264,3 @@ endif

docs: $(DOC_TARGETS)
compiler-docs: $(COMPILER_DOC_TARGETS)

docs-l10n: $(DOC_L10N_TARGETS)

.PHONY: docs-l10n
46 changes: 0 additions & 46 deletions src/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
document converter, is required to generate docs as HTML from Rust's
source code.

[po4a](http://po4a.alioth.debian.org/) is required for generating translated
docs from the master (English) docs.

[GNU gettext](http://www.gnu.org/software/gettext/) is required for managing
the translation data.

## Building

To generate all the docs, just run `make docs` from the root of the repository.
Expand Down Expand Up @@ -44,43 +38,3 @@ The syntax for pandoc flavored markdown can be found at:
A nice quick reference (for non-pandoc markdown) is at:

- http://kramdown.gettalong.org/quickref.html

## Notes for translators

Notice: The procedure described below is a work in progress. We are working on
translation system but the procedure contains some manual operations for now.

To start the translation for a new language, see `po4a.conf` at first.

To generate `.pot` and `.po` files, do something like:

~~~~
po4a --copyright-holder="The Rust Project Developers" \
--package-name="Rust" \
--package-version="0.13.0" \
-M UTF-8 -L UTF-8 \
src/doc/po4a.conf
~~~~

(the version number must be changed if it is not `0.13.0` now.)

Now you can translate documents with `.po` files, commonly used with gettext. If
you are not familiar with gettext-based translation, please read the online
manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the
file encoding of `.po` files.

When you want to make a commit, do the command below before staging your
change:

~~~~
for f in src/doc/po/**/*.po; do
msgattrib --translated $f -o $f.strip
if [ -e $f.strip ]; then
mv $f.strip $f
else
rm $f
fi
done
~~~~

This removes untranslated entries from `.po` files to save disk space.
28 changes: 0 additions & 28 deletions src/doc/po4a.conf

This file was deleted.