Skip to content

Fix a typo and make a minor improvement #3

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

Open
wants to merge 206 commits into
base: ja
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
443fc03
Remove awkward match in if_let
gepbird Jul 5, 2023
5b1e946
Revert "Remove awkward match in if_let"
gepbird Jul 5, 2023
7442728
Remove unnecessary block in awkward match
gepbird Jul 5, 2023
7e68ba5
Edit grammatical mistake
progalgo Mar 24, 2024
7e4b2ce
Fix an external link to absolute
dalance May 7, 2024
7133f4c
Fix some broken links in ja.po
dalance May 14, 2024
50b7013
Merge pull request #1842 from dalance/fix_link
marioidival May 14, 2024
c84e386
Merge pull request #1844 from dalance/fix_broken_links
marioidival May 14, 2024
d748b47
Add explicit section link
dalance May 17, 2024
6b9f38b
Update mdbook version in CI
dalance May 17, 2024
b8052df
Adjust translation build on CI
dalance May 17, 2024
b03d0d3
Merge pull request #1848 from dalance/update_mdbook
marioidival May 18, 2024
1ca1352
Merge pull request #1849 from dalance/update_translation_build
marioidival May 18, 2024
3d902f8
Merge pull request #1847 from dalance/explicit_section_name
marioidival May 18, 2024
65f37d5
Update ja.po
dalance May 19, 2024
0d22813
Merge pull request #1850 from dalance/update_ja
marioidival May 19, 2024
0a2ab00
Clarify interchangability for From and Into
xpcoffee May 19, 2024
2caac6e
Fix import
xpcoffee May 19, 2024
2048289
Merge pull request #1851 from xpcoffee/clarify-from-into
marioidival May 20, 2024
a813cde
Update paragraph in src/fn/diverging.md
ruanswanepoel May 23, 2024
0fc15da
Fix minor typo in from_into.md
mckzm May 26, 2024
fe5aa22
Add precision on From/Into asymmetry to from_into.md
mckzm May 26, 2024
98b1928
Merge pull request #1855 from mckzm/src/conversion-/from_into.md-into…
marioidival May 27, 2024
dc164e0
Fix CI failure
dalance May 27, 2024
7eb2f5a
Merge pull request #1856 from dalance/fix_ci_failure
marioidival May 27, 2024
cfc5719
Update mdbook-i18n-helpers to 0.3.3
dalance May 27, 2024
4840dca
Merge pull request #1857 from dalance/update_mdbook_i18n
marioidival May 28, 2024
1d5fd89
changed incorrect variable name
931573 May 30, 2024
ccbd7b2
changed comment
931573 May 31, 2024
69cfca0
Update instruction to add language entry of TRANSLATING.md
dalance Jun 6, 2024
f62bf53
Merge pull request #1858 from 931573/master
marioidival Jun 6, 2024
d45c1d3
Merge pull request #1860 from dalance/update_translating
marioidival Jun 6, 2024
120b5ff
Fix typo
Makonede Jun 9, 2024
6b93dff
Merge pull request #1861 from Makonede/patch-1
marioidival Jun 12, 2024
80facb3
Update ja.po and mdbook-i18n-helpers
dalance Jun 17, 2024
b1d97bd
Merge pull request #1863 from dalance/update_ja
marioidival Jun 17, 2024
48ddc5a
Merge pull request #1854 from mckzm/src/conversion-/from_into.md-fix_…
marioidival Jun 30, 2024
d7fe070
Merge pull request #1853 from ruanswanepoel/patch-1
marioidival Jun 30, 2024
e6d32ac
Merge pull request #1830 from progalgo/patch-1
marioidival Jun 30, 2024
658c6c2
Merge pull request #1725 from gepbird/remove-awkward-match
marioidival Jun 30, 2024
01b3ebd
Update option_result.md
stefnotch Jul 11, 2024
89aecb6
Merge pull request #1864 from stefnotch/patch-1
marioidival Jul 11, 2024
39bf14f
Add an example of implementing the FromStr trait for Circles.
leon-matthews Jul 13, 2024
76ea853
Merge pull request #1865 from leon-matthews/fromstr-example
marioidival Jul 16, 2024
e25486f
Remove the link to Japanese translation
dalance Jul 26, 2024
e691ace
Merge pull request #1868 from dalance/update_readme
marioidival Jul 26, 2024
5ad879d
Update lifetime_bounds.md
samliok Aug 5, 2024
8f94061
Merge pull request #1869 from samliok/patch-1
marioidival Aug 6, 2024
1d24c69
Initial setup zh translation
Binlogo Aug 17, 2024
edb8c57
Translate: `src/SUMMARY.md` part
Binlogo Aug 17, 2024
26e21c4
Translate: `src/index.md` part
Binlogo Aug 17, 2024
98c95ab
Translate: `src/hello.md`
Binlogo Aug 17, 2024
e9f39d8
Translate(zh): src/hello/comment.md
Binlogo Aug 17, 2024
799660d
Translate(zh): src/hello/print.md
Binlogo Aug 18, 2024
5fc0d83
Translate(zh): src/hello/print/print_debug.md
Binlogo Aug 18, 2024
aec12e5
Translate(zh): src/hello/print/print_display.md
Binlogo Aug 18, 2024
b74bad7
Translate(zh): src/hello/print/*.md
Binlogo Aug 18, 2024
77397be
Translate(zh): `src/primitives/*.md`
Binlogo Aug 18, 2024
dd6c166
Translate(zh): `src/custom_types/structs.md`
Binlogo Aug 18, 2024
baef7a0
Translate(zh): src/custom_types/enum.md
Binlogo Aug 18, 2024
485add2
Translate(zh): `src/custom_types/enum/*.md`
Binlogo Aug 18, 2024
db8de94
Translate(zh): `src/variable_bindings/*.md`
Binlogo Aug 18, 2024
6b58e52
Translation:(zh): `src/types/*.md`
Binlogo Aug 18, 2024
6267553
Translate(zh): `src/conversion/*.md`
Binlogo Aug 18, 2024
7fe6da6
Translate(zh): `src/flow_control/*.md` - 1/n
Binlogo Aug 19, 2024
39b796b
Translate(zh): `src/flow_control/match/destructuring/*.md`
Binlogo Aug 19, 2024
5cd0fff
Translate(zh): `src/flow_control/match/*.md`
Binlogo Aug 19, 2024
e598673
Translate(zh): `src/flow_control/*.md` end
Binlogo Aug 20, 2024
863e9b5
Translate(zh): `src/fn/*/*.md`
Binlogo Aug 21, 2024
95c93b9
Translate(zh): `src/mod/**/*.md`
Binlogo Aug 21, 2024
5d50f5a
Translate(zh): `src/crates/**/*.rs`
Binlogo Aug 21, 2024
203cee6
Translate(zh): `src/cargo/deps&conventions.md`
Binlogo Aug 21, 2024
79ec054
Translate(zh): `src/cargo/*/*.md`
Binlogo Aug 22, 2024
c7dbcd8
Translate(zh): `src/attribute/**/*.md`
Binlogo Aug 22, 2024
c64dc27
Translate(zh): `src/generics/*` - 1/n
Binlogo Aug 23, 2024
e99dffb
Translate(zh): `src/generics/*`
Binlogo Aug 24, 2024
da409ca
Translate(zh): `src/scope/*`
Binlogo Aug 24, 2024
d632011
Translate(zh): `src/trait`
Binlogo Aug 25, 2024
afc67da
update primitives.md with example of array and tuple
psyklopp Aug 25, 2024
f848229
update primitives.md with example of array and tuple
psyklopp Aug 25, 2024
3c3d699
Translate(zh): `src/error/*`
Binlogo Aug 25, 2024
b54bf04
Translate(zh): `src/std/*`
Binlogo Aug 25, 2024
7bf3ae8
Fix README.md - add workflow status badge
psyklopp Aug 25, 2024
859786c
Merge pull request #1878 from psyklopp/master
marioidival Aug 26, 2024
e6dfc62
Translate(zh): `src/std/*` - continue
Binlogo Aug 27, 2024
3a9cbdb
Translate(zh): `src/std/*` - end
Binlogo Aug 28, 2024
0ad8199
Translate(zh): `src/std_misc/*` begin
Binlogo Aug 28, 2024
ec3c99c
Translate(zh): `src/std_misc/*` continue
Binlogo Aug 29, 2024
054864d
Translate(zh): `src/std_misc/*` continue
Binlogo Aug 30, 2024
e106989
Translate(zh): `src/std_misc/*` end
Binlogo Aug 31, 2024
974ec30
Translate(zh): `src/testing/*`
Binlogo Aug 31, 2024
f38015d
Translate(zh): finish 🎉
Binlogo Aug 31, 2024
901c3bb
Add TRANSLATING_ZH.md
Binlogo Aug 31, 2024
8a8b0c0
Translate(zh): update "See also"
Binlogo Aug 31, 2024
9f8948e
Translate(zh): optimize index.md
Binlogo Aug 31, 2024
5ec8443
Translation(zh): optimize continue
Binlogo Aug 31, 2024
1fa384a
Translation(zh): optimize continue
Binlogo Aug 31, 2024
4e7e3d8
Fix typo in conversion/from_into
tniessen Sep 6, 2024
1d3572c
Corrected x values for example rectangle
cyrts Sep 7, 2024
70aa7ae
Merge pull request #1884 from cyrts/issue-1883
marioidival Sep 8, 2024
c79ec34
Merge pull request #1882 from tniessen/patch-1
marioidival Sep 8, 2024
12fdafb
Translation(zh): optimize continue (:3331)
Binlogo Sep 8, 2024
c18b7d9
Translation(zh): optimize continue (:3436)
Binlogo Sep 9, 2024
3314ea6
Fix ambiguous comment on primitives > Arrays and Slices
maple19out Sep 9, 2024
3a8664e
Translation(zh): optimize continue (:3628)
Binlogo Sep 10, 2024
2ebc28a
Translation(zh): optimize continue (:4994)
Binlogo Sep 10, 2024
a96c788
Translation(zh): optimize continue (:5194)
Binlogo Sep 11, 2024
79b6a28
Translation(zh): optimize continue (:6751)
Binlogo Sep 11, 2024
1c2dd10
Translation(zh): optimize continue (:8826)
Binlogo Sep 11, 2024
dd361e2
Translation(zh): optimize continue (:9216)
Binlogo Sep 13, 2024
789576c
Translation(zh): optimize continue (:9811)
Binlogo Sep 15, 2024
76a4821
Translation(zh): optimize continue (:12478)
Binlogo Sep 15, 2024
7cfc730
Translation(zh): optimize end
Binlogo Sep 16, 2024
7fa8a2c
Prepare to add translation Chinese(zh) into official repository
Binlogo Sep 20, 2024
a138631
Merge branch 'rust-lang:master' into zh
Binlogo Sep 20, 2024
ebdc1a3
Translate(zh): fix broken link issues
Binlogo Sep 21, 2024
1d06bc7
docs(zh): fix known issues
YangFong Sep 23, 2024
c7305e6
Update iter.md
Flamenco Sep 29, 2024
00be0f9
Add .vscode/ to .gitignore
ShapelessCat Sep 29, 2024
0e22153
Improve docs
ShapelessCat Sep 29, 2024
6e0146a
Merge pull request #1886 from rust-lang-cn/zh
marioidival Sep 30, 2024
4dafcae
Merge pull request #1887 from Flamenco/patch-1
marioidival Sep 30, 2024
8bede1b
Merge pull request #1888 from ShapelessCat/minor-improvements
marioidival Sep 30, 2024
04fb7f3
`read_lines`: Use `. filter_map(Result::ok)` instead of `.flatten()`.
lgarron Oct 17, 2024
682eed9
Merge pull request #2 from rust-lang-cn/fix/doc
Binlogo Oct 17, 2024
6a65177
Fix typo in generics/new_types
breitwan Oct 25, 2024
69c0e9b
Merge pull request #1890 from lgarron/patch-1
marioidival Oct 26, 2024
2892dfa
Merge pull request #1891 from rust-lang-cn/zh
marioidival Oct 26, 2024
54cc32a
Merge pull request #1892 from breitwan/typo-fix
marioidival Oct 26, 2024
4e3881e
Merge pull request #1885 from maple19out/master
marioidival Oct 26, 2024
8bb30b9
fix(doc): correct small errors in pipes.md
bepri Oct 30, 2024
9db7860
Merge pull request #1894 from bepri/patch-1
marioidival Oct 31, 2024
9bc6832
Upgrade actions/upload-artifact action
jdno Nov 6, 2024
90a8b26
Merge pull request #1896 from jdno/upgrade-action
marioidival Nov 7, 2024
1174efc
Update mdbook theme for newer version
ehuss Nov 7, 2024
e1d1f2c
Merge pull request #1897 from ehuss/fix-theme
marioidival Nov 8, 2024
ecd5114
Fix #1900
zanedp Dec 5, 2024
7640633
Merge pull request #1901 from zanedp/patch-1
marioidival Dec 7, 2024
d2f9fb1
Mention that you're not allowed to partially move Drop types
josephcsible Dec 16, 2024
0933975
Merge pull request #1902 from josephcsible/partial-move-drop
marioidival Dec 18, 2024
7f722c8
Fix typo in static_lifetime.md
hkBst Jan 3, 2025
28b7ec6
Merge pull request #1905 from hkBst/patch-1
marioidival Jan 3, 2025
8e69e36
Fix function name in new_types.md in Japanese
yadokani389 Jan 10, 2025
054259e
Merge pull request #1907 from yadokani389/patch-1
marioidival Jan 13, 2025
658835d
add po/es.po
miguelraz Jan 31, 2025
564e2db
add es to rbe.yml and Spanish button
miguelraz Jan 31, 2025
5bda671
es translation :900
miguelraz Jan 31, 2025
ecc1d51
en to es in index.hbs
miguelraz Jan 31, 2025
7bede22
es translation to 1000
miguelraz Feb 1, 2025
877d151
es translation to 1200
miguelraz Feb 1, 2025
ca21cdb
es translation to 1500
miguelraz Feb 1, 2025
3d4b4e4
es/po.es to :1700
miguelraz Feb 1, 2025
9af042c
es translation to 2100
miguelraz Feb 1, 2025
e56a47b
fix transposed . after ending quotes
miguelraz Feb 1, 2025
021ecec
unbork failing tests
miguelraz Feb 1, 2025
7aacc6b
fix broken macro link
miguelraz Feb 1, 2025
7437669
Merge pull request #1910 from miguelraz/spanish-translation
marioidival Feb 2, 2025
bd234ec
es translation to 2162
miguelraz Feb 3, 2025
d03043f
es translation to :2600
miguelraz Feb 3, 2025
fc2c7e7
correct syntax errors
miguelraz Feb 3, 2025
612b4fd
es translation to 1:3100
miguelraz Feb 3, 2025
a349a04
Merge pull request #1911 from miguelraz/master
marioidival Feb 4, 2025
1fe268a
Add more examples @ drop.md
wowinter13 Feb 5, 2025
66543bb
Merge pull request #1912 from wowinter13/improve-drop-docs
marioidival Feb 6, 2025
64b9734
Update mdbook to 0.4.46
ehuss Mar 9, 2025
6f69823
Merge pull request #1914 from ehuss/update-mdbook
marioidival Mar 9, 2025
f7ce2ac
Grammar
RhysFonville Mar 26, 2025
d5f826a
Merge pull request #1916 from RhysFonville/patch-1
marioidival Mar 29, 2025
efbe25b
Update book.toml rename `author` field to `authors`
szabgab Mar 30, 2025
46a68fe
add example to comment.md
KennedyRichard Apr 6, 2025
e6c8e5d
Rename count to index for clarity
wazawoo Apr 7, 2025
0d7964d
Merge pull request #1920 from wazawoo/improve-clarity-on-testcase-list
marioidival Apr 7, 2025
3914d41
docs: mark illustrative 'static lifetime example with `ignore`
santoshxshrestha Apr 22, 2025
fbbf20a
Merge pull request #1923 from santoshxshrestha/patch-1
marioidival Apr 22, 2025
76cac7d
Non-tail recursive call note in testcase_linked_list
ViggoC Apr 27, 2025
53b14f4
Merge pull request #1924 from ViggoC/patch-1
marioidival Apr 29, 2025
af68928
The example is not meant to be compiled. Changed the code block ann…
santoshxshrestha Apr 29, 2025
8a8918c
Merge pull request #1926 from santoshxshrestha/patch-1
marioidival Apr 30, 2025
e6fe4b5
Fix typo in Japanese translation
zyoshoka May 11, 2025
a31d217
fix(docs): standardize on `no_run` attribute for documentation examples
santoshxshrestha May 12, 2025
c83a739
Merge pull request #1928 from zyoshoka/fix-typo-assoc-items-ja
marioidival May 13, 2025
c9d151f
Merge pull request #1929 from santoshxshrestha/patch-1
marioidival May 13, 2025
4623b5f
The example is not meant to be compiled with out passing arguments.
santoshxshrestha May 14, 2025
7898fcf
added a shorthand for the #[should_panic(expected = "msg")
santoshxshrestha May 14, 2025
4458911
Merge pull request #1931 from santoshxshrestha/patch-2
marioidival May 29, 2025
4e4a37e
Merge pull request #1930 from santoshxshrestha/patch-1
marioidival May 29, 2025
dfce4ad
Merge pull request #1919 from KennedyRichard/patch-1
marioidival May 29, 2025
21f4e32
Merge pull request #1917 from szabgab/patch-1
marioidival May 29, 2025
8a63d8b
fix(#1656): update doc tests to use `playground` as the crate name
mautamu May 30, 2025
d5ea5c6
ci: use latest mdbook
ryzhak Jun 5, 2025
17fb2b8
Merge pull request #1934 from mautamu/fix-1904
marioidival Jun 10, 2025
885cd01
Merge pull request #1935 from ryzhak/fix/1933
marioidival Jun 10, 2025
3c216f6
introduce new @media query to set a higher content width on ultra wid…
Christoph-Harms Jun 11, 2025
e579162
refactor: replace "18/9" by "2", because math
Christoph-Harms Jun 11, 2025
44afaef
doc: add doc comment
Christoph-Harms Jun 11, 2025
9baa9e8
Merge pull request #1937 from Christoph-Harms/fix/1936
marioidival Jun 11, 2025
95d44ec
Revert "introduce new @media query to set a higher content width on u…
Christoph-Harms Jun 17, 2025
05c7d8b
Merge pull request #1939 from Christoph-Harms/revert-1937-fix/1936
marioidival Jun 18, 2025
07cddd6
allow easy fixes
tshepang Jun 20, 2025
288b4e4
Merge pull request #1941 from tshepang/patch-2
marioidival Jun 25, 2025
ea92ad0
Update Chinese translations and metadata in `zh.po` file
Binlogo Jul 3, 2025
05c06d7
Update Chinese translations in `zh.po` file
Binlogo Jul 3, 2025
2dec150
Update README.md to include link for Chinese translation guide
Binlogo Jul 3, 2025
5633506
Add tracking translation progress section in TRANSLATING.md
Binlogo Jul 3, 2025
e386be5
Merge pull request #1943 from rust-lang-cn/zh
marioidival Jul 4, 2025
561cdb8
Fix typo in Japanese translation
noritada Jul 9, 2025
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
27 changes: 12 additions & 15 deletions .github/workflows/rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]

env:
# Update the language picker in index.hbs to link new languages.
LANGUAGES: ja
LANGUAGES: ja zh es

jobs:
test:
Expand All @@ -27,12 +27,12 @@ jobs:
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.51/mdbook-v0.4.51-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> ${GITHUB_PATH}

- name: Install mdbook-i18n-helpers
run: |
cargo install mdbook-i18n-helpers --locked --version 0.3.1
cargo install mdbook-i18n-helpers --locked --version 0.3.4

- name: Report versions
run: |
Expand All @@ -55,27 +55,24 @@ jobs:
- name: Build all translations
run: |
for po_lang in ${{ env.LANGUAGES }}; do
POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/')
if [[ $POT_CREATION_DATE == "" ]]; then
POT_CREATION_DATE=now
fi

echo "::group::Building $po_lang translation as of $POT_CREATION_DATE"
rm -r src/
git restore --source "$(git rev-list -n 1 --before "$POT_CREATION_DATE" @)" src/

echo "::group::Building $po_lang translation"
# Set language and adjust site URL. Clear the redirects
# since they are in sync with the source files, not the
# translation.
MDBOOK_BOOK__LANGUAGE=$po_lang \
MDBOOK_OUTPUT__HTML__SITE_URL=/rust-by-example/$po_lang/ \
MDBOOK_OUTPUT__HTML__REDIRECT='{}' \
mdbook build -d book/$po_lang
echo "::endgroup::"
done

- name: Check all translations for broken links
run: |
for po_lang in ${{ env.LANGUAGES }}; do
MDBOOK_BOOK__LANGUAGE=$po_lang \
sh linkcheck.sh --all rust-by-example
done

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rust-by-example
path: book
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ book

po/messages.pot

.vscode/

# Auto-generated files from macOS
.DS_Store
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ abide by the [Rust code of conduct], which you can find at that link or in the

## License

RBE is dual licenced under the MIT and Apache 2.0 licenses, and so are all
RBE is dual licensed under the MIT and Apache 2.0 licenses, and so are all
contributions. Please see the [`LICENSE-MIT`] and [`LICENSE-APACHE`] files in
this directory for more details.

Expand Down Expand Up @@ -55,7 +55,7 @@ $ mdbook build

**The following warnings can be ignored safely.**

```
```text
[WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "gettext" preprocessor installed?
[WARN] (mdbook::preprocess::cmd): Command: mdbook-gettext
```
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Rust By Example

[![Build Status][travis-badge]][travis-repo]

[travis-badge]: https://travis-ci.com/rust-lang/rust-by-example.svg?branch=master
[travis-repo]: https://travis-ci.com/rust-lang/rust-by-example
[![Build Status](https://github.com/rust-lang/rust-by-example/actions/workflows/rbe.yml/badge.svg)](https://github.com/rust-lang/rust-by-example/actions)

Learn Rust with examples (Live code editor included)

Expand All @@ -29,7 +26,7 @@ read all content offline, however!

**The following warnings can be ignored safely.**

```
```text
[WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "gettext" preprocessor installed?
[WARN] (mdbook::preprocess::cmd): Command: mdbook-gettext
```
Expand Down Expand Up @@ -64,11 +61,13 @@ Please see the [TRANSLATING.md] file for more details.

[TRANSLATING_JA.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_JA.md

* Chinese/中文: [TRANSLATING_ZH.md]

[TRANSLATING_ZH.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_ZH.md

## Translations to other languages

* [Bulgarian](https://github.com/kberov/rust-by-example-bg)
* [Chinese](https://github.com/rust-lang-cn/rust-by-example-cn)
* [Japanese](https://github.com/rust-lang-ja/rust-by-example-ja)
* [French](https://github.com/Songbird0/FR_RBE)
* [Russian](https://github.com/ruRust/rust-by-example)
* [Vietnamese](https://github.com/EyesCrypto-Insights/rust-by-example-vn)
Expand Down
16 changes: 14 additions & 2 deletions TRANSLATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \
msginit -i po/messages.pot -l xx -o po/xx.po
```

#### Updating the exising translation resource
#### Updating the existing translation resource

```bash
msgmerge --update po/xx.po po/messages.pot
```

#### Tracking translation progress

```bash
msgfmt --statistics po/xx.po
```

### Editing translation resources

After generating a translation resource `po/xx.po`, you can write translation messages in `msgstr` entry of `po/xx.po`.
Expand All @@ -55,7 +61,7 @@ MDBOOK_BOOK__LANGUAGE=xx mdbook serve

### Add a language entry

Please add a language entry in `.github/workflows/rbe.yml` and `theme/index.hbs` like below:
Please add a language entry in `.github/workflows/rbe.yml`, `theme/index.hbs`, and `src/bootstrap/src/core/build_steps/doc.rs` in [rust-lang/rust](https://github.com/rust-lang/rust) like below:

* `rbe.yml`

Expand Down Expand Up @@ -83,3 +89,9 @@ env:
</button></li>
</ul>
```

* `src/bootstrap/src/core/build_steps/doc.rs` in [rust-lang/rust](https://github.com/rust-lang/rust)

```rust
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["xx", "yy", "zz"], submodule;
```
32 changes: 32 additions & 0 deletions TRANSLATING_ZH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Rust by Example 中文版翻译指南

Rust by Example 中文版的翻译在 https://github.com/rust-lang-cn/rust-by-example 仓库进行审核和校对。

如果您希望参与翻译,请按照以下流程操作:

1. 复刻(fork)https://github.com/rust-lang/rust-by-example 仓库。

2. 在 `po/zh.po` 文件中添加或修改译文。

3. 向 https://github.com/rust-lang-cn/rust-by-example 仓库的 `zh` 分支提交 PR(Pull Request)。
- 先在 rust-lang-cn 仓库进行审校,而非直接向原始仓库提交 PR,这样可以更方便进行译文讨论。
- 中文社区仓库的默认分支为 `zh`,因此正常创建 PR 时会自动指向该分支。

rust-lang-cn 翻译组成员的维护流程:

1. 审核并校对提交的 PR,先合并到 `zh` 分支。

2. 向 https://github.com/rust-lang/rust-by-example 原始仓库提交 PR。

## 翻译规范

### 总体原则

* 文风应保持正式、清晰、简洁
* 标点符号原则上使用全角(如括号"()"和冒号":"等)

### 术语翻译指南

* 对于已经广泛接受的技术术语,保留英文或使用通用的中文翻译
* 避免生硬的直译,优先考虑符合中文语境的自然表达
* 保持术语翻译的一致性,可参考 [Rust 语言术语中英文对照表](https://github.com/rust-lang-cn/english-chinese-glossary-of-rust/blob/master/rust-glossary.md)
5 changes: 4 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[book]
title = "Rust By Example"
description = "Rust by Example (RBE) is a collection of runnable examples that illustrate various Rust concepts and standard libraries."
author = "The Rust Community"
authors = ["The Rust Community"]

[output.html.playpen]
editable = true
Expand All @@ -13,9 +13,12 @@ enable = true

[output.html]
git-repository-url = "https://github.com/rust-lang/rust-by-example"
edit-url-template = "https://github.com/rust-lang/rust-by-example/edit/master/{path}"
hash-files = true
additional-css = [
"theme/css/language-picker.css",
]
additional-js = ["theme/js/language-picker.js"]

[rust]
edition = "2021"
Expand Down
Loading