-
-
Notifications
You must be signed in to change notification settings - Fork 106
Add Chinese Docs translation #1315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for djlint failed.
|
|
The Language section has been supplemented. Language部分已补充。 |
|
Is anyone here ? |
|
Alright I think if no one care until next Monday, I will close this PR... |
|
Hey! Thanks for the PR! I will review it when I have free time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Chinese translation support for the djLint documentation website. The translation provides comprehensive Chinese documentation including getting started guides, configuration options, linter rules, formatter documentation, and language-specific guides for various template engines.
Key Changes
- Added complete Chinese translation for all documentation pages
- Integrated Chinese locale into the site's internationalization system
- Translated configuration options and UI elements
- Updated package dependencies
Reviewed Changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/src/zh/ | New directory containing complete Chinese translations for all documentation pages |
| docs/src/_data/locales.js | Added Chinese locale configuration |
| docs/src/_data/i18n/index.js | Added Chinese translations for UI strings and navigation |
| docs/src/_data/configuration.json | Added Chinese descriptions for configuration options |
| docs/package.json | Updated sass dependency version |
| docs/readme.md | Minor formatting change |
Comments suppressed due to low confidence (1)
docs/package.json:59
- The sass package version 1.58.3 appears to be older than the current version 1.60.0. This downgrade from ^1.60.0 to ^1.58.3 may introduce compatibility issues or remove bug fixes. Consider keeping the newer version unless there's a specific reason for the downgrade.
"sass": "^1.58.3",
|
Thanks for reviewing my PR. The mistakes pointed out by Copilot have been fixed. Apologies for the careless copy-paste errors in docs/language and the mistakes in docs/linter. |
|
Oh my god! what happened... |
|
It seems like docs/src/lib/...js was ignored by git, with "lib/" line297 in .gitignore. I refresh my git to change LF to CRLF and it remove this file from my git. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 20 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/src/zh/docs/linter.md
Outdated
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="{{ 'lang_code_url' | i18n }}/docs/configuration/">配置</a> 章节</div> |
docs/src/zh/docs/formatter.md
Outdated
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/zh/docs/configuration/">配置</a> 章节</div> |
docs/src/zh/docs/languages/twig.md
Outdated
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/zh/docs/configuration/">配置</a> 章节</div> |
docs/src/zh/docs/languages/jinja.md
Outdated
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="{{ lang_code_url }}/docs/configuration/">配置</a> 章节</div> |
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/zh/docs/configuration/">配置</a> 章节</div> |
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/zh/docs/configuration/">配置</a> 章节</div> |
docs/src/zh/docs/languages/golang.md
Outdated
| ``` | ||
|
|
||
| <div class="box notification is-info is-light"> | ||
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration link points to the English docs (/docs/configuration/). For the zh locale it should point to the localized page (e.g. /zh/docs/configuration/, or build it using lang_code_url).
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/docs/configuration/">配置</a> 章节</div> | |
| <span class="icon is-large"><i class="fas fa-2x fa-circle-arrow-right"></i></span><div class="my-auto ml-3 is-inline-block">详情请参考 <a href="/zh/docs/configuration/">配置</a> 章节</div> |
| "postcss-nested": "7.0.2", | ||
| "prismjs": "1.30.0", | ||
| "sass": "^1.60.0", | ||
| "sass": "^1.58.3", |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description is about adding Chinese docs, but this change downgrades the sass devDependency. If this is intentional, please explain why and update the repo’s lockfile(s) accordingly (e.g., docs/package-lock.json still references sass: ^1.60.0, which will be out of sync with package.json). If unintentional, revert this dependency change.
docs/src/_data/i18n/index.js
Outdated
| "en-US": "Add a badge to your projects", | ||
| ru: "Добавьте значок к своим проектам", | ||
| fr: "Ajoutez un badge à vos projets", | ||
| zh: "在你项目中添加一个badge - ", |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Chinese index_add_badge string has an extra trailing "-" which will render in the UI.
| zh: "在你项目中添加一个badge - ", | |
| zh: "在你项目中添加一个badge", |
docs/src/zh/docs/best-practices.md
Outdated
|
|
||
| {% endraw %} | ||
|
|
||
| 不推荐使用一下模式: |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: “不推荐使用一下模式” should be “不推荐使用以下模式”.
| 不推荐使用一下模式: | |
| 不推荐使用以下模式: |
|
Oh sorry, its midnight here. I'll update it soon. |
Pull Request Check List
Resolves: #issue-number-here
Added Chinese Docs translations.
Due to limited time and resources, the Language section has not yet been translated but will be supplemented later.
添加了中文文档翻译。
由于精力有限,Language部分尚未翻译,后续会补充。