docs(i18n): add Simplified Chinese datetime rule translations - #65
Conversation
|
Warning Review limit reached
Next review available in: 27 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough新增 DOL021 和 DOL022 中文规则文档,说明 Django 时区 API、 Changes日期时间规则中文文档
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
docs/i18n/README.zh.mddocs/i18n/rules/zh/DOL021.mddocs/i18n/rules/zh/DOL022.md
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.
|
Answered in #52: the factual error you found is real, and the English source is fixed on |
|
Merged as The resync is exactly right: both halves of the distinction survived into Chinese ( 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
|
Summary
Added Simplified Chinese translations for the
DOL021andDOL022datetime 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
Test plan
docs/i18n/README.zh.mdpoint to the two new files.Checklist
cd cli && pytest -qfor Python,npm testfor TypeScript) and it is green## [Unreleased]mcp_server.pyand the relevant tests intest_mcp_server.py## Summaryabove and suggested a migration pathRelated issues / discussions
Refs #52
Summary by CodeRabbit
datetime.now()and deprecateddatetime.utcnow().