Skip to content

Infra/english 2025 listings sources#425

Open
LouGit wants to merge 46 commits into
Jimskapt:unproofreaded-french-translation-contributionsfrom
LouGit:infra/english-2025-listings-sources
Open

Infra/english 2025 listings sources#425
LouGit wants to merge 46 commits into
Jimskapt:unproofreaded-french-translation-contributionsfrom
LouGit:infra/english-2025-listings-sources

Conversation

@LouGit
Copy link
Copy Markdown

@LouGit LouGit commented Feb 9, 2026

TL;DR FR

  • Synchronisation des listings FR avec la version EN 2025
  • Travail majoritairement mécanique, outillé
  • Changements nombreux mais sémantiquement ciblés
  • Aucun changement de fond hors traduction / renommage

This PR is a sibling of #422
It replaces the erroneous #423

Alignment of French translation with reference English version, listings.

In other words, update the French parts in the code, source files, outputs from compiler, etc. where the English current version has changed since the last French translation.

This is going to be a quite long PR, since some changes are done automatically for all files (typically, change Cargo.toml files' content from edition = "2021" to edition = "2024").

Base branch: unproofreaded-french-translation-contributions
Purpose: upstream English sync (2025 edition)

LouGit added 30 commits January 27, 2026 18:46
… while updating the translation from the current English version, comment the files with a #
…a (authors, links), track current stable Rust release, explicitly mark outdated English text as historical
The foreword was substantially rewritten upstream.
The French translation now follows the current English version.
The obsolete commented English text was removed and replaced.
- Sync introduction with latest English version
- Account for new Chapter 17 (async/await and async concurrency)
- Update chapter numbering accordingly
- Minor formatting changes due to 80-column wrapping and emphasis
Source:
- Upstream: rust-lang/book (English)

Changes:
- Cosmetic only
Source:
- Upstream: rust-lang/book (English)

Changes:
- A few rephrasing
- Some cosmetics
- Paragraphs were swapped upstream, others were added

Notes:
- Large diffs are mostly due to 80-column wrapping
- Formatting-only changes unless explicitly mentioned
- Not all English (commented out) paragraphs were updated from upstream: only the ones with significant changes
Source:
- Upstream: rust-lang/book (English)

Changes:
- Updated content to match upstream revisions
- IDE tooling section updated (rust-analyzer, Appendix D)
- Section titles and anchors aligned with upstream
- Windows execution instructions corrected (.exe)

Notes:
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly* redundant, were deleted
Source:
- Upstream: rust-lang/book (English)

Changes:
- Updated French translation to match upstream content
- Applied typographical adjustments (italics for _dependencies_, _crates_, filenames, directories)
- Wrapped lines to ~80 columns where appropriate
- Updated Rust edition to 2024
- Removed strictly redundant commented-out code blocks

Notes:
- Large diffs mostly due to upstream rewrites and formatting changes
- English commented sections were selectively updated when meaningfully changed
- Examples and code blocks were cleaned to remove duplication
- Links to TOML and Cargo documentation added for clarity
This commit performs a full editorial and technical alignment of
ch02-00-guessing-game-tutorial.md with the current English upstream
(rust-lang/book).

Source:
- Upstream: rust-lang/book (English)

Changes:
- Synchronized explanations, wording, and punctuation with upstream
- Updated Markdown emphasis to match upstream conventions (* -> _)
- Aligned code explanations with current Rust semantics
  (ranges `..=`, shadowing, match arms, trait imports, etc.)
- Change in the {} behaviour
- Updated terminal outputs to reflect current Cargo output format
  (`Finished \`dev\` profile ...`)
- Fixed references to chapters, anchors, and documentation links
- Removed redundant duplicated code blocks when strictly identical
- Updated or added `manual-regeneration` hints where required for
  reproducibility
- a few rephrasing and punctuation, from upstream

Notes:
- The large diff is expected and mostly due to upstream rewrites,
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly*
  redundant, were deleted
- Cargo.toml updates were intentionally committed separately as part of an
  upcoming infrastructure synchronization pass
Source:
- Upstream: rust-lang/book (English)

Changes:
- Only minor changes

Notes:
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly* redundant, were deleted
Source:
- Upstream: rust-lang/book (English)

Changes:
- Rephrasing, some ideas are clarified and reformulated

Notes:
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly*
  redundant, were deleted
- A whole paragraph was deleted from upstream, it has been moved to a "garbage
  bin" at the bottom of the file, just in case it had been deleted by accident
  => TODO to be deleted at some point
…2-hello-world.md - upstream alignment: added "NOTE_FR_TRANSLATION_UPDATE" tag in already processed files, in order to tag in-text remarks being made while updating translation
Source:
- Upstream: rust-lang/book (English)

Changes:
- Most changes are cosmetic (* becoming _)
- A few significant changes: integer division, unit type
- Some sentences were suppressed, a few other added

Notes:
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly*
  redundant, were deleted
Source:
- Upstream: rust-lang/book (English)

Changes:
- Only minor changes

Notes:
- Large diffs are mostly due to upstream rewrites and 80-column wrapping
- English commented sections were selectively updated when meaningfully changed
- Duplicated code blocks (commented out and uncommented), when *strictly*
  redundant, were deleted
Source:
- rust-lang/book @ 39aecea

Notes:
- Blind resynchronization
- listings-sources is now a faithful copy of upstream listings
- Includes file additions, removals, and renumberings
- kept old README.md which concerns French translation and describes, precisely, what the 'listings-sources' directory is all about
- Files:  listings/ch02-guessing-game-tutorial/listing-02-01/*
          listings/ch02-guessing-game-tutorial/listing-02-02/*
          listings/ch02-guessing-game-tutorial/listing-02-03/*
          listings/ch02-guessing-game-tutorial/listing-02-04/*
- English source: 2025 edition
- Notes:
  - manual update edition to 2024 in Cargo.toml
  - manual update rand dependency from 0.8.3 to 0.8.5
  - in println! statements, change variable position inside curly brackets in string
  - in Cargo.lock: update checksum for rand crate, remove rand_hc package, add version, add zerocopy packages
  - update output.txt so as to match upstream English version

Also, debug and adjust utility script
LouGit added 16 commits February 6, 2026 12:25
- Files: ch02-guessing-game-tutorial/*
- English source: 2025 edition
- Notes:
  - change ranges: (1..101) to (1..=100)
  - changes in Cargo.lock with rand crate "0.8.3" to "0.8.5", checksums, and
    crate rand_hc suppressed
  - other crate changes: libc "0.2.68" to  "0.2.86"
  - in println! statements, change variable position inside curly brackets in
    string
  - in Cargo.lock: update checksum for rand crate, remove rand_hc package, add
    version, add zerocopy packages
  - some cosmetic changes of compiler's outputs
- Files: ch03-common-programming-concepts/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - some cosmetic changes of compiler's outputs
- Files: ch04-understanding-ownership/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - some cosmetic changes of compiler's outputs
  - some minor changes in punctuation within comments
  - some comments changes
- Files: ch05-using-structs-to-structure-related-data/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - changes in fields' orders
  - some cosmetic changes of compiler's outputs
- Files: ch06-enums-and-pattern-matching/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - some changes of compiler's outputs
- Files: ch07-managing-growing-projects/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - some changes of compiler's outputs
  - suppressed triple calls of function accueil::ajouter_a_la_liste_attente()
  - in Cargo.lock: update checksum for rand crate, remove rand_hc package
  - change libc crate version and checksum
  - some minor changes in punctuation within comments
- Files: ch08-common-collections/*
- English source: 2025 edition
- Notes:
  - the order of some paragraphs were changed, hence the numbering of listings
    too: big changes appearing in diff can be misleading, the changes are in
    fact not as large as they appear
      Note: I should have renamed the files so as to match the updated contents,
            but I was running the script rustbook_update_french_translation_listings.sh ,
            and it was much easier and safer to update the file contents from
            within vimdiff directly
  - in println! statements, change variable position inside curly brackets in
    string
  - same thing in format! statements
  - some changes of compiler's outputs
- Files: ch09-error-handling/*
- English source: 2025 edition
- Notes:
  - change ranges: (1..101) to (1..=100)
  - in println! statements, change variable position inside curly brackets in
    string
  - some changes of compiler's outputs
  - in Cargo.lock: update checksum for rand crate, remove rand_hc package
- Files: ch10-generic-types-traits-and-lifetimes/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - same thing in format! statements
  - changes of variables' references and indirections => TODO to be
    double-checked while revising text translation
      Example:
        listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/src/main.rs
           35 -    let mut le_plus_grand = liste_de_nombres[0];
           36 +    let mut le_plus_grand = &liste_de_nombres[0];
  - some changes of compiler's outputs
  - update upstream variables renamed
  - the order of some paragraphs were changed, hence the numbering of listings
    too: big changes appearing in diff can be misleading, the changes are in
    fact not as large as they appear
- Files: ch11-writing-automated-tests/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - same thing in format! statements
  - changes in asserting tests, using a variable
  - changes of some variables' types and names
  - some changes of compiler's outputs
- Files: ch12-an-io-project/*
- English source: 2025 edition
- Notes:
  - in println! statements, change variable position inside curly brackets in
    string
  - use dbg! instead of println!
  - change of some messages, upstream TODO double-check coherence with text
  - change of new() to build()
  - changes in asserting tests, using a variable
  - the order of some paragraphs were changed, hence the numbering of listings
    too: big changes appearing in diff can be misleading, the changes are in
    fact not as large as they appear
@LouGit
Copy link
Copy Markdown
Author

LouGit commented Feb 18, 2026

Oh bonté divine...

I finally figured out why the CI failed: it seems many files have been moved, subdirectories have been renamed, as order of paragraphs have sometimes moved in the upstream reference English version.

I think that, instead of trying to modify by hand (as I'm doing so far) the listings/* files and also the listings-sources/* files (otherwise, mdbook fails) so as to match the upstream reference version, it would probably be more efficient to just retrieve the English listings, and translate them again, based on the previous translation.

@Jimskapt , your opinion on this matter?

@Jimskapt
Copy link
Copy Markdown
Owner

Hi @LouGit, welcome to my (former) world 😆
I've done this work several times while finishing the translation spread over years, so I understand your pain.

If you really need a personal opinion, I will try to setup a optimized diff workflow to manually update things.
It will have multiple splitted views in a custom workspace in Visual Studio Code to lighten my mental load.
That make things a bit easier to see changes and stick to the text and context of the main page/content.

And if you need to build powerfull string process in a custom rust programs, I highly recommend you to take a look to the nom crate. I found it better than regex for large process (but it needs more boilerplate).

Cheer up and good luck ! 👋

@LouGit
Copy link
Copy Markdown
Author

LouGit commented Feb 26, 2026

Your (former) world is tough!

I have an allergy to VSCode, I had setup a pretty good toolchain using diff and vimdiff, see the scripts in the FRENCH/tools/ directory.

Some examples:
image
image
image
image

I'm not fluent enough in Rust yet to dare writing this kind of stuff in Rust instead of Bash...

By doing so, I've suffered quite a bit, especially with the source codes, with enormous diffs coming from the change in the order of paragraphs, leading to renaming scripts, and false diffs...
A nightmare.

Plus, a chapter has been added in the upstream English version, which will make things even harder...

Then, as you can see, I've discovered the marvellous world of PO, it's very efficient for maintainability. It is surprisingly simple, and efficient. Just a bunch of strings with their translation, then gettext and mdbook utilities manage all the rest.

See a result (in Russian) here:
https://rust-lang-translations.org/book/ru/

So I'm currently processing your translations to fit into this PO system, see the PR I just submitted.

@LouGit
Copy link
Copy Markdown
Author

LouGit commented Mar 23, 2026

I started putting all your translation work in PO, check here:
https://rust-lang-translations.org/book/fr/

It is MUCH easier to maintain, although it needs very strict string matching, but that's alright.

@WillScarlettOhara
Copy link
Copy Markdown

Bonjour, votre version à jour de la traduction devrait être aussi affichée dans le readme de ce repo.
Je suis bien content d'avoir fouillé dans les PR pour la trouver.

La version française en ligne proposée est tellement datée par rapport à la version anglaise que même si je suis plus à l'aise à lire en Français, j'avais commencé à lire la version anglaise.
De la même façon, la branche principale avec le dernier commit il y a 4 ans décourage un peu. Je pense que ce serait mieux que la branche https://github.com/Jimskapt/rust-book-fr/tree/unproofreaded-french-translation-contributions soit la branche principale et qu'il y soit ajouté tous les annexes.

Merci pour le travail.

@LouGit
Copy link
Copy Markdown
Author

LouGit commented Mar 30, 2026

Bonjour, votre version à jour de la traduction devrait être aussi affichée dans le readme de ce repo. Je suis bien content d'avoir fouillé dans les PR pour la trouver.

C''est peut-être un petit peu prématuré... Pour l'instant, je suis en train de tout mettre à jour, mais c'est assez fastidieux. J'ai mis au point quelques outils pour accélérer les choses.

La version française en ligne proposée est tellement datée par rapport à la version anglaise que même si je suis plus à l'aise à lire en Français, j'avais commencé à lire la version anglaise.

Je ne me suis rendu compte que cette version était fort ancienne... que après avoir fini de lire ce Bouquin!

De la même façon, la branche principale avec le dernier commit il y a 4 ans décourage un peu.

Oui, c'est impossible (enfin, quasiment) de raccrocher les wagons, avec tant de retard. Le système PO gettext est très flexible (en même temps qu'il est très rigide).

Je pense que ce serait mieux que la branche https://github.com/Jimskapt/rust-book-fr/tree/unproofreaded-french-translation-contributions soit la branche principale et qu'il y soit ajouté tous les annexes.

Il serait, à mon sens, plus adéquat de tout mettre dans la branche principale master, avec les annexes, oui.

Après, c'est une question de politique: continue-t-on à maintenir ce repositoire (sincèrement, j'ai essayé, je me suis cassé les dents) ou bien le fige-t-on, et met-on les efforts dans https://rust-lang-translations.org/book/fr/ (c'est là ce que je suis en train de faire; l'outil est perfectible, mais @dalance prend les PR, donc on arrive à améliorer l'outil) avec met-on une référence dans le README?

@Jimskapt , un avis sur la question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants