Skip to content

Conversation

@p-r-a-v-i-n
Copy link
Contributor

According to DRF language-style the documentation should follow the american english style.

But I have found some British style words or inconsistent spellings like behaviour, customise, initialise, e-mail, Sub-classes in the docs. In this PR I have modified them to DRF style.

I have touched 26 files. and I can understand this is relatively large change. I'm not sure whether DRF team will like my approach or not. but if anything is there I'm happy to adjust.

Note: highlight.pack.js were intentionally not modified.

Copy link
Collaborator

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we configure codespell in any way to catch this in the future? We're already using it as pre-commit hook

@p-r-a-v-i-n
Copy link
Contributor Author

Thanks for review and suggestion @browniebroke !

Can we configure codespell in any way to catch this in the future?

That would be great if we configured. I have done small research and i found codespell project directly addresses the British-to-American spelling standardization . The maintainers merged a change to include a dedicated en_GB_to_en_US dictionary (related to codespell-project/codespell/pull/1480). This dictionary is specifically designed to flag common British spellings (like the ones I corrected: initialise, behaviour, etc.) as typos.
for maximum coverage we can also use this regex i found in the discussion.

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the standardize-american-english branch from f4e1eaf to f2f5d86 Compare October 24, 2025 05:05
@p-r-a-v-i-n
Copy link
Contributor Author

I tried locally
by adding args: ["--builtin", "clear,rare,en-GB_to_en-US"] in codespell section.

- repo: https://github.com/codespell-project/codespell
  # Configuration for codespell is in .codespellrc
  rev: v2.4.1
  hooks:
  - id: codespell
    args: ["--builtin", "clear,rare,en-GB_to_en-US"]
    exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js
    additional_dependencies:
      # python doesn't come with a toml parser prior to 3.11
      - "tomli; python_version < '3.11'"

I got following results:
codespell_error

I would love to work on the configuring codespell hook. Can i raise Seperate PR ? if yes, then which file to be ignored for now?

@browniebroke
Copy link
Collaborator

Can i raise Seperate PR ? if yes, then which file to be ignored for now?

Yes, sure. Fine by me

@browniebroke browniebroke changed the title Standardize spelling to American English Standardize spelling to American English in documentation Oct 24, 2025
browniebroke
browniebroke previously approved these changes Oct 24, 2025
@p-r-a-v-i-n
Copy link
Contributor Author

I got following results: codespell_error

@browniebroke If you go through the image, It detect other words too which i haven't detect in the PR. So Should i update those too ? So It will be in one go.
Also I want to mention that spelling errors were ignored in python code by codespell .
It detect those spelling errors only in the "comments" of python files and ".md" files.

@browniebroke
Copy link
Collaborator

It detect other words too which i haven't detect in the PR. So Should i update those too ? So It will be in one go.

If you want to, sure. Thinking about it again. Would be nice to update codespell config so it's all done in one go as well... This all feels very much related. Fixing the problem and setting us up for no further changes. Same spirit as updating tests as your fix a bug.

Also I want to mention that spelling errors were ignored in python code. It detect those spelling errors only in the "comments" of python files and ".md" files.

👍🏻 Noted

…tency

changes:
- Activates the `en-GB_to_en-US` built-in dictionary to flag British spellings
- Created codespell-ignore-words.txt file to ignore specific words
- include `code` and `names` for comprehensive typo checking in technical contexts.
- changed the 'lets' to 'let's'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants