1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 06:20:32 +02:00
Commit Graph

1341 Commits

Author SHA1 Message Date
Noam Zaks
ee48c4684a
Fix typo: include semi colon in code (#1335) 2023-10-10 08:15:21 +00:00
Martin Geisler
7bffb7f2c4
Update mutable-static-variables.md (#1331)
From a discussion in #1297.
2023-10-09 15:15:26 +02:00
Martin Geisler
65f6dbcd85
Fix and expand Bare-metal Rust entry in glossary (#1325)
The entry lacked the forced line-break of the other entries.
2023-10-09 11:29:14 +02:00
Qinglin
72e2c94398
zh-CN: translate android/interoperability.md (#1225)
Part of #324
2023-10-09 15:31:50 +08:00
Henri F
5ce24aa2de
zh-CN: Solutions Translations (#1321)
Professional translations for missing exercise solutions entries #324.
This is a new attempt, after fixing the original .po file (#1312).

The diff is large mostly because of the normalization.

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:29:28 +08:00
Henri F
6949e1b0b8
zh-CN: Day 3 Translations (#1320)
Professional translations for missing day 3 entries #324.
This is a new attempt, after fixing the original .po file (#1312).

The diff is large mostly because of the normalization.

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:21:19 +08:00
Henri F
78dfe60bb3
zh-CN: Day 2 Translations (#1319)
Professional translations for missing day 2 entries #324
This is a new attempt, after fixing the original .po file
(https://github.com/google/comprehensive-rust/pull/1312).
The diff is large mostly because of the normalization (line breaks,
etc.)

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:10:17 +08:00
Henri F
fdae99c3d2
zh-CN: Day 1 Translations (#1318)
Professional translations for missing day 1 entries #324
2023-10-09 13:58:57 +08:00
JWSong
8b5f3fd238
ko: fix typo (#1326)
fixed a typo
2023-10-08 11:42:41 +00:00
Martin Geisler
ac8e3ed14f
Mention POT-Creation-Date in instructions (#1314)
I don’t know if this is enough on its own? In principle, the new
publication system should work smoothly without people having to know
much about this header, so that’s why I only describe it briefly.

Followup to #1243.
2023-10-07 18:32:10 +02:00
Martin Geisler
1f022e318a
Add more coverage about the course (#1298)
There has now been three articles about the course.
2023-10-06 14:27:31 +02:00
Martin Geisler
a7f7afa4a2
Format the glossary using a Markdown list (#1307)
This format has two advantages:

- is easier to maintain in the Markdown file. Tables cannot be wrapped
in Markdown, which would severely limit what we can write for each term.
- it can be styled better. The layout now looks more like what you find
in a dictionary.

Before:


![image](https://github.com/google/comprehensive-rust/assets/89623/26bdc39e-4c1d-4f33-90d5-a1637712bcb8)

After:


![image](https://github.com/google/comprehensive-rust/assets/89623/38c1b329-4a80-4771-b415-425a537a0388)


Followup to #1277.
2023-10-06 14:26:52 +02:00
Hidenori Kobayashi
8ff97f1ee7
Remove HTML tag <abbr> (#1310)
The html tag seems to confuse the mdbook-i18n-helpers and make the
translation work hard (#1284).

This simply replaces them with a set of parenthesis.
2023-10-06 10:38:48 +01:00
Henri F
fa1f19e391
zh-CN: Restores lost translations (#1312)
Addresses issue #1311

zh-CN.po stats:
```
msgfmt -o /dev/null --statistics po/zh-CN.po
1258 translated messages, 178 fuzzy translations, 1038 untranslated messages.
```
2023-10-06 08:02:48 +00:00
Zhang SIQI
1a0c0d3fa6
Update CODEOWNERS (#1309)
@henrif75 I want to add myself as the Chinese version reviewer! 
Thank you
2023-10-06 09:56:26 +02:00
Martin Geisler
a38a33c8fb
Use AND between words in mdbook search (#1306)
The default is to use `OR`, which I find counter-intuitive: the more I
try to narrow down a search, the more hits I get. See the full
documentation for more options:


https://rust-lang.github.io/mdBook/format/configuration/renderers.html#outputhtmlsearch
2023-10-05 10:17:05 -04:00
Nick Radcliffe
c93a4bc20c
Remove unused import (use) (#1303)
This should be a clean pull request with just the required diff
2023-10-05 11:17:48 +02:00
Nick Radcliffe
2072ed022b
Fix typo (missing s on threads) (#1304)
Again, a clean pull request for this typo.
2023-10-05 09:17:17 +00:00
Martin Geisler
5760e99e22
Introduce a glossary (#1277)
The goal of this is twofold: give translators a place to document how
certain terms are translated as well as giving people a place to quickly
find a definition of a term. The slides might not always give a quick
definition the same way a glossary can.
2023-10-05 07:17:24 +02:00
Kanta Yamaoka (山岡幹太)
d59cb116b7
ja: Translate Chapter 24 (Generics) (#1283)
Hi JP translation folks (#652). Here's a MR for Generics chapter. Could
you take a look at it? Thank you!
2023-10-05 07:58:20 +09:00
Colin Finck
9d45db83b1
Add a "minimum wrong example" program in C (#1241)
This example shows what kind of bugs easily slip into C code and are
made impossible via Rust.

I have created this example for the motivation slides of my master
thesis. Since then, the university institute has used it in their
introduction to Rust.
I hereby make this part available to the Comprehensive Rust course and
relicense it under the terms of the Apache 2.0 license.

Thank you @mgeisler for your invitation to contribute to this course!

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-10-04 13:26:37 +00:00
Martin Geisler
8c2d8208b2
Link blog post from README.md (#1291)
I hope the blog post can help shed more light on why we wrote the course
and how it has been used at Google.

I'm not sure if "Press" is the best title, but I hope to link other
articles later from this section at a later point.
2023-10-04 13:01:02 +02:00
Martin Geisler
7395725edf
Avoid naming struct field like trait method (#1294)
The `name` struct field was confusing because it was named the same as
the trait method. The struct fields are now disjoint from the method
names — the fact that there are two separate name spaces is not the
point of these slides.

I also dropped the zero-sized type, this is also not the main focus
here.

I also compressed the code a bit to make the unimportant structs take
up less space.

Fixes #1292.
2023-10-04 09:52:15 +00:00
Nick Radcliffe
a883a569d0
Remove unused callback from GUI exercise (#1293)
Here's a possible update to the GUI/TUI exercise, taking out the
callback and explaining (slightly).

See what you think.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-10-03 14:07:33 +00:00
Nick Radcliffe
0f768df367
Minor rewording of safe-ffi-wrapper exercise. (#1286)
For readability.
2023-10-03 14:03:30 +00:00
Martin Geisler
9f079f173b
Update all Cargo.lock files (#1295)
This is the result of running `cargo update` in every directory.

It fixes a alert: https://github.com/advisories/GHSA-9mcr-873m-xcxp. We
don’t run any HTTP server directly, so this is not super important for
us. However, it will remove the alert from my dashboard.
2023-10-03 14:18:44 +02:00
Yuri Astrakhan
36449cb1b2
Add hash to rustdoc example (#1282)
Hashes are important (and somewhat confusing to novices) part of the
rustdoc.
2023-10-02 14:23:46 +02:00
Martin Geisler
1d658ead10
Update to mdbook-i18n-helpers 0.2.4 (#1263)
This is the newest release of mdbook-i18n-helpers, fully backwards
compatible with the old one.
2023-10-01 23:01:22 -07:00
Martin Geisler
42541fc401
Automatically format YAML, CSS, and JS files (#1272)
Initially, I also formatted the templates in `theme/`, but this triggers
https://github.com/prettier/prettier/issues/11834. So I exclude them for
now.

---------

Co-authored-by: Ming-Ying Chung <mych@chromium.org>
2023-10-02 14:48:00 +09:00
Alexey Sokolov
4e768e2e36
Fix several typos (#1251)
cc @Makarevich
2023-09-29 11:41:48 -07:00
Henri Fontana
86cde61f60
zh_CN: .po refresh and remaining course intro translations (#1242)
Normalizes .po file and add professional translation to missing entries
before day 1.
#324
2023-09-29 11:38:31 -07:00
Yarema Mazuryk
1a1a9c85db
continued translation - finished 1-200, continued with 201-400 (#1278)
part of #836
2023-09-29 12:25:52 +01:00
Yuri Astrakhan
c894ea3517
Add unittest example to rustdoc (#1276)
Fixes #1275

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-09-29 06:40:24 +00:00
Matthew
1c43db108b
Fix inconsistent filename styling (#1274)
Addresses https://github.com/google/comprehensive-rust/issues/625

Pages with inconsistent styling:
[Bare Metal Rust Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/bare-metal/solutions-afternoon.html)
[Concurrency Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/concurrency/solutions-afternoon.html)
[Microcontroller > Debugging
Page](https://google.github.io/comprehensive-rust/bare-metal/microcontrollers/debugging.html)
2023-09-29 08:38:42 +02:00
Martin Geisler
81e30daf66
Run dprint config update (#1273)
This updates the plugins to the latest version.
2023-09-28 22:52:00 +02:00
Dustin J. Mitchell
0e89050eb9
Actually print something in prime_squares example (#1271)
As suggested in #1268.
2023-09-28 11:09:40 +02:00
Martin Geisler
c74b2c8a04
da: Translate the welcome page (#1256) 2023-09-27 12:57:48 +00:00
Martin Geisler
d0e0e5c1af
Skip some untranslatable code blocks (#1258)
This builds on the work of @dyoo in
https://github.com/google/mdbook-i18n-helpers/pull/69: by adding a
special `<!-- mdbook-xgettext: skip -->` comment, we can skip the
following code block.

I also modified a few code blocks to remove translatable text: variable
names are not expected to be translated, so it’s fine to have a line
with `println!("foo: {foo}")` in the code block.

This PR removes 36 messages from the POT file. The number of lines drop
by 633 (3%).

Part of #1257.
2023-09-26 17:04:46 +02:00
Matthew
a492b2f1b2
Italic filenames formatted accordingly (#1259)
**Task** Addresses:
https://github.com/google/comprehensive-rust/issues/625
Certain pages in the mdbook that display filenames have inconsistent
styling.

The style we want to follow: [the interop
section](https://google.github.io/comprehensive-rust/android/interoperability/java.html)

The current problem: [the RTC
driver](https://google.github.io/comprehensive-rust/exercises/bare-metal/rtc.html)
excercise page.

--
@mgeisler I checked this feature by looking through every page


![work](https://github.com/google/comprehensive-rust/assets/38759997/8affd0c2-71f2-4708-88f6-f63cf3c24efa)
2023-09-26 15:15:41 +02:00
Andrew Walbran
864bb942c0
Clarify distinction between Drop trait and drop function. (#1255)
This clears up some misleading explanation from #246.
2023-09-26 11:59:16 +01:00
Martin Geisler
ea44e2547b
da: refresh translation (#1203)
Stats before:

    312 translated messages, 2155 untranslated messages.

and after:

    320 translated messages, 2136 untranslated messages.

Part of #286.
2023-09-26 09:20:32 +00:00
Frances Wingerter
758639174a
Add solution for Health Statistics exercise (#1172) 2023-09-26 09:29:00 +02:00
Hidenori Kobayashi
fc388570bf
ja: Translations - Chapter 40 (bare-metal no_std) (#1198)
Part of google#652.
2023-09-26 10:42:56 +09:00
Matthew
af9c940f09
Fix resolver setting (#1253)
Fixes: https://github.com/google/comprehensive-rust/issues/1249

Since `mdbook-exerciser` and `mdbook-course` are using Rust edition
2021, they naturally want to use the newer resolver (resolver = 2).
<img width="571" alt="Screen Shot 2023-09-25 at 9 57 32 AM"
src="https://github.com/google/comprehensive-rust/assets/38759997/50446a93-877d-408e-ab68-e88d8467f0e3">
2023-09-25 18:00:13 +02:00
Martin Geisler
b3bcaacb70
Set POT-Creation-Date field in PO files (#1252)
This updates each PO file to the date when it was last touched:

    for po_file in po/*.po; do
        POT_DATE=$(git log -1 --date=short --format=%ad $po_file)
sed -i -e 's/"POT-Creation-Date:.*"/"POT-Creation-Date:
'$POT_DATE'\\n"/' $po_file
    done

The dates will be updated with `msgmerge` in the future via
https://github.com/google/mdbook-i18n-helpers/pull/87.

The dates here can be adjusted by hand if needed — the starting point
here only serves as a rough anchor to let us freeze the translations
from further updates. So if you know that you ran `msgmerge` most
recently on a given date, please update the file to that date in a later
PR.
2023-09-25 16:38:03 +02:00
Kanta Yamaoka (山岡幹太)
b2f6c37635
ja: Translate Chapter 54, Control Flow (#1189)
Hi, JA project folks (#652), here's a MR for the chapter "Control Flow".
When you have some time, could you review the diff? Any feedback or
suggestions are greatly appreciated. Thank you in advance.
2023-09-25 22:55:43 +09:00
Martin Geisler
ca424b90e0
Revert "Update boot-library.md" (#1235)
Reverts google/comprehensive-rust#225. We normally include links at the
start of each exercise blocks — but we don't include links in the
individual exercises.

If we want to add such links, we should do it consistently across the
entire course.
2023-09-25 09:39:37 -04:00
Emma Li
0f48230b32
Update CODEOWNERS (#1250)
Update my username
2023-09-25 05:47:47 -07:00
Martin Geisler
ca966f304c
Sync src/ with date in PO file when publishing (#1243)
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still use up-to-date versions of all other files: this allows us to
fix things in the theme, for example. So the assumption here is that
never versions of our infrastructure remains compatible with old
versions of the Markdown files.

This approach has a problem: when files are moved, the English
translation will link to the new name. This name will not exist in the
old translations. We might be able to disable these links somehow.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
2023-09-25 09:52:39 +02:00
Daniel Fernández Núñez
9d21fe159a
Fix bad link in speaker notes Day 2 exercises (#1244) 2023-09-25 07:01:40 +00:00