Skip to content

Commit

Permalink
auto merge of #11507 : omasanori/rust/reduce-po, r=alexcrichton
Browse files Browse the repository at this point in the history
This work is done by execute these commands manually:

    $ po4a --copyright-holders="The Rust Project Developers" \
        --package-name="Rust" \
        --package-version="0.10-pre" \
        -M UTF-8 -L UTF-8 \
        doc/po4a.conf
    $ for f in doc/po/**/*.po; do
    >   msgattrib --untranslated $f -o $f.strip
    >   if [ -e $f.strip ]; then
    >       mv $f.strip $f
    >   else
    >       rm $f
    >   fi
    > done

It should be managed by the build system automatically to use in our
translation workflow, but I've not yet done that.

At least one mostly-translated (over 80% translation rate) document is needed to test the translation workflow, so I'll working on Japanese translation.
  • Loading branch information
bors committed Jan 14, 2014
2 parents 9dbbfb8 + 006d169 commit d150f6b
Show file tree
Hide file tree
Showing 23 changed files with 3,847 additions and 13,137 deletions.
46 changes: 46 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ source code.
the Markdown docs (reference manual, tutorials, etc.) distributed with
this git repository.

[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 @@ -38,3 +44,43 @@ http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown

A nice quick reference (for non-pandoc markdown) is at:
http://kramdown.rubyforge.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.10-pre" \
-M UTF-8 -L UTF-8 \
po4a.conf
~~~~

(the version number must be changed if it is not 0.10-pre 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 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.
152 changes: 152 additions & 0 deletions doc/po/ja/complement-cheatsheet.md.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Japanese translations for Rust package
# Copyright (C) 2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: Rust 0.10-pre\n"
"POT-Creation-Date: 2014-01-13 12:01+0900\n"
"PO-Revision-Date: 2014-01-13 12:01+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. type: Plain text
#: doc/complement-cheatsheet.md:13
#, fuzzy
#| msgid ""
#| "~~~~ let x: f64 = 4.0; let y: uint = x as uint; assert!(y == 4u); ~~~~"
msgid "~~~ let x: int = 42; let y: ~str = x.to_str(); ~~~"
msgstr ""
"~~~~\n"
"let x: f64 = 4.0;\n"
"let y: uint = x as uint;\n"
"assert!(y == 4u);\n"
"~~~~"

#. type: Plain text
#: doc/complement-cheatsheet.md:17
#, fuzzy
#| msgid ""
#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
msgid ""
"Use [`FromStr`](http://static.rust-lang.org/doc/master/std/from_str/trait."
"FromStr.html), and its helper function, [`from_str`](http://static.rust-lang."
"org/doc/master/std/from_str/fn.from_str.html)."
msgstr ""
"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"

#. type: Plain text
#: doc/complement-cheatsheet.md:22
#, fuzzy
#| msgid ""
#| "~~~~ let x: f64 = 4.0; let y: uint = x as uint; assert!(y == 4u); ~~~~"
msgid "~~~ let x: Option<int> = from_str(\"42\"); let y: int = x.unwrap(); ~~~"
msgstr ""
"~~~~\n"
"let x: f64 = 4.0;\n"
"let y: uint = x as uint;\n"
"assert!(y == 4u);\n"
"~~~~"

#. type: Plain text
#: doc/complement-cheatsheet.md:29
#, fuzzy
#| msgid "~~~~ use std::task::spawn;"
msgid "~~~ use std::num::ToStrRadix;"
msgstr ""
"~~~~\n"
"use std::task::spawn;"

#. type: Plain text
#: doc/complement-cheatsheet.md:33
#, fuzzy
#| msgid ""
#| "~~~~ let x: f64 = 4.0; let y: uint = x as uint; assert!(y == 4u); ~~~~"
msgid "let x: int = 42; let y: ~str = x.to_str_radix(16); ~~~"
msgstr ""
"~~~~\n"
"let x: f64 = 4.0;\n"
"let y: uint = x as uint;\n"
"assert!(y == 4u);\n"
"~~~~"

#. type: Plain text
#: doc/complement-cheatsheet.md:37
#, fuzzy
#| msgid ""
#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
msgid ""
"Use [`FromStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait."
"FromStrRadix.html), and its helper function, [`from_str_radix`](http://"
"static.rust-lang.org/doc/master/std/num/fn.from_str_radix.html)."
msgstr ""
"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"

#. type: Plain text
#: doc/complement-cheatsheet.md:40
#, fuzzy
#| msgid "~~~~ use std::task::spawn;"
msgid "~~~ use std::num::from_str_radix;"
msgstr ""
"~~~~\n"
"use std::task::spawn;"

#. type: Plain text
#: doc/complement-cheatsheet.md:46
#, fuzzy
#| msgid "## Operators"
msgid "# File operations"
msgstr "## 演算子"

#. type: Plain text
#: doc/complement-cheatsheet.md:54
#, fuzzy
#| msgid "~~~~ use std::task::spawn;"
msgid "~~~ {.xfail-test} use std::path::Path; use std::io::fs::File;"
msgstr ""
"~~~~\n"
"use std::task::spawn;"

#. type: Plain text
#: doc/complement-cheatsheet.md:63
#, fuzzy
#| msgid ""
#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
msgid ""
"Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer."
"html#method.lines) method on a [`BufferedReader`](http://static.rust-lang."
"org/doc/master/std/io/buffered/struct.BufferedReader.html)."
msgstr ""
"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"

#. type: Plain text
#: doc/complement-cheatsheet.md:77
#, fuzzy
#| msgid "## Using other crates"
msgid "# String operations"
msgstr "## 他のクレートの利用"

#. type: Plain text
#: doc/complement-cheatsheet.md:88 doc/guide-container.md:4
#, fuzzy
msgid "# Containers"
msgstr "## 本書の表記について"

#. type: Plain text
#: doc/complement-cheatsheet.md:176
#, fuzzy
#| msgid "[The foreign function interface][ffi]"
msgid "# FFI (Foreign Function Interface)"
msgstr "[他言語間インターフェース (foreign function inferface)][ffi]"
47 changes: 47 additions & 0 deletions doc/po/ja/complement-lang-faq.md.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Japanese translations for Rust package
# Copyright (C) 2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: Rust 0.10-pre\n"
"POT-Creation-Date: 2014-01-13 12:01+0900\n"
"PO-Revision-Date: 2014-01-13 12:01+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. type: Plain text
#: doc/complement-lang-faq.md:83
#, fuzzy
#| msgid ""
#| "[bug-3319]: https://github.com/mozilla/rust/issues/3319 [wiki-start]: "
#| "https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust"
msgid ""
"[rustc]: https://github.com/mozilla/rust/tree/master/src/librustc [resolve]: "
"https://github.com/mozilla/rust/blob/master/src/librustc/middle/resolve.rs "
"[borrowck]: https://github.com/mozilla/rust/blob/master/src/librustc/middle/"
"borrowck/"
msgstr ""
"[bug-3319]: https://github.com/mozilla/rust/issues/3319\n"
"[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-"
"developing-Rust"

#. type: Plain text
#: doc/complement-lang-faq.md:110
#, fuzzy
#| msgid ""
#| "[bug-3319]: https://github.com/mozilla/rust/issues/3319 [wiki-start]: "
#| "https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust"
msgid ""
"[unwind]: https://github.com/mozilla/rust/issues/908 [libgcc]: https://"
"github.com/mozilla/rust/issues/1603"
msgstr ""
"[bug-3319]: https://github.com/mozilla/rust/issues/3319\n"
"[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-"
"developing-Rust"
24 changes: 24 additions & 0 deletions doc/po/ja/complement-project-faq.md.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Japanese translations for Rust package
# Copyright (C) 2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: Rust 0.10-pre\n"
"POT-Creation-Date: 2014-01-13 12:01+0900\n"
"PO-Revision-Date: 2014-01-13 12:01+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. type: Bullet: '* '
#: doc/complement-project-faq.md:36
#, fuzzy
#| msgid "## The standard library"
msgid "An evolving standard library."
msgstr "## 標準ライブラリ"
73 changes: 73 additions & 0 deletions doc/po/ja/guide-conditions.md.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Japanese translations for Rust package
# Copyright (C) 2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: Rust 0.10-pre\n"
"POT-Creation-Date: 2014-01-13 12:01+0900\n"
"PO-Revision-Date: 2014-01-13 12:01+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. type: Plain text
#: doc/guide-conditions.md:2
#, fuzzy
#| msgid "% The Rust Language Tutorial"
msgid "% The Rust Condition and Error-handling Guide"
msgstr "% Rust 言語チュートリアル"

#. type: Plain text
#: doc/guide-conditions.md:4 doc/guide-ffi.md:4 doc/guide-lifetimes.md:4
#: doc/guide-macros.md:4 doc/guide-rustpkg.md:4 doc/guide-tasks.md:4
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
msgid "# Introduction"
msgstr "# イントロダクション"

#. type: Bullet: ' - '
#: doc/guide-conditions.md:14
#, fuzzy
#| msgid "# Functions"
msgid "Options"
msgstr "# 関数"

#. type: Bullet: ' - '
#: doc/guide-conditions.md:14
#, fuzzy
#| msgid "## Conditionals"
msgid "Conditions"
msgstr "## 条件式"

#. type: Plain text
#: doc/guide-conditions.md:19
#, fuzzy
#| msgid "## Tuples"
msgid "# Example program"
msgstr "## タプル"

#. type: Plain text
#: doc/guide-conditions.md:112
#, fuzzy
#| msgid "# Functions"
msgid "# Options"
msgstr "# 関数"

#. type: Plain text
#: doc/guide-conditions.md:318
#, fuzzy
#| msgid "## Conditionals"
msgid "# Conditions"
msgstr "## 条件式"

#. type: Plain text
#: doc/guide-conditions.md:415
#, fuzzy
#| msgid "## Traits"
msgid "# Trapping a condition"
msgstr "## トレイト"
Loading

0 comments on commit d150f6b

Please sign in to comment.