Skip to content

docs(i18n): add Simplified Chinese datetime rule translations - #65

Merged
FROWNINGdev merged 2 commits into
FROWNINGdev:mainfrom
Justine0211:main
Aug 1, 2026
Merged

docs(i18n): add Simplified Chinese datetime rule translations#65
FROWNINGdev merged 2 commits into
FROWNINGdev:mainfrom
Justine0211:main

Conversation

@Justine0211

@Justine0211 Justine0211 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Added Simplified Chinese translations for the DOL021 and DOL022 datetime rules and linked them from the existing Chinese README. I am a native Simplified Chinese speaker and reviewed the wording for clarity and technical accuracy.

Type of change

  • Bug fix (non-breaking, restores expected behaviour)
  • Feature (non-breaking, adds a capability)
  • Breaking change (existing users have to update config or code)
  • Docs / README / comments only (no runtime effect)
  • Internal refactor (no behaviour change, no public API change)
  • Dependency bump
  • CI / build / tooling

Test plan

  • Compared all three fenced code blocks in each translated page with the English source; their contents are unchanged.
  • Verified that rule IDs, setting keys, warning text, and technical syntax remain unchanged.
  • Verified that the relative links in docs/i18n/README.zh.md point to the two new files.
  • No runtime test suite was run because this change only adds Markdown documentation.

Checklist

  • I ran the full test suite locally (cd cli && pytest -q for Python, npm test for TypeScript) and it is green
  • I added or updated tests that cover the change (bugfixes should get a regression test)
  • If the change is user-facing I updated the CHANGELOG under ## [Unreleased]
  • If the change touches the MCP tool contract (new tool, new arg, new error code) I updated the tool description in mcp_server.py and the relevant tests in test_mcp_server.py
  • If this is a breaking change I called it out under ## Summary above and suggested a migration path

Related issues / discussions

Refs #52

Summary by CodeRabbit

  • Documentation
    • Added Chinese documentation for rules DOL021 and DOL022.
    • Documented timezone-aware alternatives to datetime.now() and deprecated datetime.utcnow().
    • Added examples, QuickFix guidance, applicability details, and disablement instructions.
    • Updated the Chinese rule directory links to reference the new documentation.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Justine0211, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23c6d624-05fb-4240-9ff2-93b696692798

📥 Commits

Reviewing files that changed from the base of the PR and between 9d02216 and d52eefb.

📒 Files selected for processing (1)
  • docs/i18n/rules/zh/DOL021.md
📝 Walkthrough

Walkthrough

新增 DOL021 和 DOL022 中文规则文档,说明 Django 时区 API、datetime.now()datetime.utcnow() 的使用差异、替代方案和禁用方式。中文规则目录已更新对应链接。

Changes

日期时间规则中文文档

Layer / File(s) Summary
规则文档与目录链接
docs/i18n/rules/zh/DOL021.md, docs/i18n/rules/zh/DOL022.md, docs/i18n/README.zh.md
新增 DOL021 和 DOL022 中文规则说明,包含示例、QuickFix 和禁用配置。中文目录链接分别指向对应规则页面。

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of Simplified Chinese translations for the datetime rules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/i18n/rules/zh/DOL021.md`:
- Around line 5-7: 修正文档中关于 USE_TZ 和 timezone.now() 的描述:将默认值变更表述为 Django 5.0 起为
True,并说明 Django 4.0 仍为 False、项目模板中的 USE_TZ = True 只是便利配置;同时说明
django.utils.timezone.now() 在 USE_TZ=False 时返回系统本地时间的 naive datetime,在
USE_TZ=True 时返回带 UTC 时区的 aware datetime。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e4b132f-85d6-4626-9ed6-da18e049f717

📥 Commits

Reviewing files that changed from the base of the PR and between 100dd84 and 9d02216.

📒 Files selected for processing (3)
  • docs/i18n/README.zh.md
  • docs/i18n/rules/zh/DOL021.md
  • docs/i18n/rules/zh/DOL022.md

Comment thread docs/i18n/rules/zh/DOL021.md Outdated
FROWNINGdev added a commit that referenced this pull request Aug 1, 2026
Two factual errors, found by @Justine0211 while translating the page into
Simplified Chinese in #65. Both were wrong in a way that misleads exactly the
most common reader: someone on Django 4.x with USE_TZ unset.

1. The page said USE_TZ=True was "Django's default since 4.0". It was not.
   The framework default in django.conf.global_settings stayed False through
   4.2 and became True only in 5.0. What changed in 4.0 is that the
   startproject template writes USE_TZ = True into the settings file it
   generates — so a project created on 4.0+ is aware because the template
   opted it in, while a project upgraded to 4.x keeps False until someone
   sets it. The page now spells out that distinction instead of collapsing it.

2. The page said timezone.now() "returns an aware UTC datetime", full stop.
   It follows the setting: aware UTC under USE_TZ=True, naive local time under
   USE_TZ=False. Stated unconditionally it contradicted the same paragraph's
   own closing sentence about projects that run USE_TZ=False.

The same claim was duplicated in the rule source, so src/rules/datetime.ts is
corrected too, with a note not to reintroduce the short form.

Verified against the Django 4.0 and 5.0 release notes and the implementation
of django.utils.timezone.now(). No rule code, docsUrl or message string
changes: tsc clean, 111 JS tests, 466 Python tests + 41 subtests pass.
@FROWNINGdev

Copy link
Copy Markdown
Owner

Answered in #52: the factual error you found is real, and the English source is fixed on main in 024399b. Please resync that one paragraph against the updated docs/rules/DOL021.md and push to this branch — then this goes in. Everything else here checks out: code blocks byte-identical, rule IDs intact, README link correct, line endings matching the rest of docs/i18n/.

@FROWNINGdev
FROWNINGdev merged commit cf2e4e3 into FROWNINGdev:main Aug 1, 2026
18 checks passed
@FROWNINGdev

Copy link
Copy Markdown
Owner

Merged as cf2e4e3. Thank you — twice over.

The resync is exactly right: both halves of the distinction survived into Chinese (global_settings default False through 4.2 → True in 5.0, versus the startproject template writing USE_TZ = True since 4.0). I checked the code blocks again after your second commit — still byte-identical to the English, rule IDs intact.

You're credited in the CHANGELOG and the README roadmap for both things, and the correction is listed separately from the translation, because they're separate contributions and the correction is the larger one.

The delay before your checks ran wasn't you: GitHub holds workflow runs from first-time contributors until a maintainer approves them, and they sit as action_required rather than announcing themselves. I've approved them; from your next PR onward they'll start automatically.

docs/rules/ still has 17 untranslated pages if you want more, and no obligation at all if you don't — this was already a good day's work for the project.

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.

2 participants