Skip to content

Code comments and docstrings in the French lectures: French or English? #88

Description

@mmcky

Open. Code comments and docstrings in the French lectures: translated or kept in English? Matt settles this with Emile, the edition's editor of record, as for other house-style questions; it sets the --localize value for the fresh drafts and whether a consistency pass is needed.

#82 settled on fresh drafts on 2026-10-06, so the ruling is needed before the first one; corrections in progress carry on and are aligned with it afterwards.

Emile, the edition's editor, asked on #84 (2026-10-02):

Hey Matt, I have a quick question on convention. I've noticed the chapters aren't fully consistent about whether comments and docstrings inside code cells get translated into French. about_py.md already has French comments like # Charger la bibliothèque, but some other chapters leave comments and docstrings in English. Should we translate explanatory comments and docstrings consistently going forward, while leaving code identifiers, API names, and executable output strings as-is? Want to make sure I'm applying the same rule across chapters rather than deciding it one by one.

How the edition got here

Options

  • A. Translate the explanatory text in code. # comments and docstrings in French; code identifiers, API names and the strings a program prints stay as they are. This is the rule the question proposes, and most lectures already follow it for comments.
  • B. Keep code cells as in the English. Comments and docstrings in English throughout; only the prose is translated.

What the ruling sets

Done when

  • the ruling is recorded in a comment on this issue, and the first line of this issue reads "Decided YYYY-MM-DD", with a link to that comment
  • the drafting settings follow it: the --localize value for any fresh draft and, if docstrings are to be translated, the engine rule that covers them

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions