docs
docs copied to clipboard
Add textlint to enforce writing guide
Description (required)
This PR adds and configures textlint to enforce the Astro Japanese writing guide for our documentation. It introduces a new prh.yml file with terminology rules (e.g., 標準表記の統一やコロン「:」の検出) and updates the .textlintrc.ja.json configuration to load those rules. contributors will receive automated feedback on terminology usage and formatting consistency in Japanese docs, reducing manual proofreading errors and ensuring a unified style.
📁 Directory Structure
.
├── .textlintrc.ja.json ← (new) Textlint config for Japanese rules
├── package.json ← (modified) adds `lint:ja` script, textlint dependencies
└── src
└── content
└── docs
└── ja
└── … ← (existing) Japanese‐language MDX/MD files
Related issues & labels (optional)
- Closes: https://github.com/withastro/docs/discussions/11665
- Previous PR: https://github.com/withastro/docs/pull/11691
- Suggested label:
i18n
Deploy Preview for astro-docs-2 ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | ed7d2434a372fd16e39e02d6b15efe85c42eb418 |
| Latest deploy log | https://app.netlify.com/projects/astro-docs-2/deploys/6892315e6fae9d0008b71708 |
| Deploy Preview | https://deploy-preview-11812--astro-docs-2.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Hi @jp-knj - I'm noticing that there are conflicts here that will need to be resolved.
Also, the open discussion seems to be ongoing, so I'm not sure what the status of this is, and what we need to go further with this. How will we know that we want this? Maybe the first step is at least to resolve the conflicts here?
Thank you for noticing the conflicts. I’ve pushed a commit that should resolve them, but Not completely sure everything is in order.
When you have a moment, could you take a quick look and let me know if there’s anything else we need before merging?
I really appreciate your time, and I’m happy to make any updates. Thanks again!
Thanks @jp-knj ! Admittedly, I haven't been keeping up too much with the conversation in the Discussion #11665 as it seems Chris had some questions/comments. I think the next step is checking in with him there to make sure all his concerns are addressed!
The core docs team discussed this a little more this week, and it seems like there is not much disagreement from current ja translators.
I would love if some of our contributors like @morinokami and @kyosuke were able to share opinons, either here or in the linked GitHub Discussion, just to make sure there's nothing we're not thinking about.
But I think the core team's position is that if there are no objections from Japanese contributors, we are willing to at least try this and see how it goes!
Thanks for the follow-up and for including me in the discussion!
I’m supportive of introducing textlint for the Japanese docs. I think it’s a great step toward improving overall quality and easing the burden on translation reviewers.
I’m not too familiar with how it’s used for other languages, but applying it just to Japanese docs, as suggested in the PR, sounds very reasonable to me.
+1 for introducing textlint.
From a reviewer's point of view, it would help streamline the review process by reducing the need to comment on writing style or punctuation choices. Just like English has style debates such as whether to use the Oxford comma, Japanese also has various style preferences. Some of these are mentioned in the Japanese style guide, but not everyone reads or follows them. By introducing textlint, we can automatically catch deviations from the style guide, which reduces the burden on reviewers and gives contributors more confidence when writing. (In general, many Japanese contributors tend to feel more comfortable when the rules are clearly defined, I think)
Also, textlint was created by azu, a well-known developer in the Japanese JS community. The tool is widely used among Japanese developers. For example, one of my colleagues, who helps maintain the official Japanese translation for Vue and Vite docs, told me he also uses textlint. I think this shows the tool is reliable and well-suited for our needs.
The main concern might be deciding which rules to enable. Reaching agreement on that will take some discussion, possibly on GitHub or Discord. If we skip that step, there is a risk that the tool gets added but ends up being unused. But if we take the time to agree on which rules to use, I believe the benefits will be worth it.
@yanthomasdev I'm late, add new lint japanese documentation ci 👍🏿
Lunaria Status Overview
🌑 This pull request will not trigger status changes.
Learn more
Lunaria automatically ignores changes on specific PRs by adding a ignored keyword in its title. Found: i18nIgnore.
You can change this by either removing the keyword above from the PR's title, or modifying the ignoreKeywords property in your Lunaria configuration file.
Tracked Files
[!NOTE]
The notes below indicate what would happen if the pull request is merged when triggering status changes. Since a ignored keyword was found in the PR's title, the status changes indicated below won't be applied.
| File | Note |
|---|---|
| ja/basics/astro-components.mdx | Localization changed, will be marked as complete. 🔄️ |
Warnings reference
| Icon | Description |
|---|---|
| 🔄️ | The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied. |
We have errors 🎉
I see that the CI message only shows this:
Error: textlint found issues in Japanese documentation. Please run 'pnpm run lint:ja' locally to see details.
Can we have it log things directly in CI? Seems annoying to not display the details directly.
Thanks, update them to show the details on CI
https://github.com/withastro/docs/actions/runs/16610388038/job/46992130126?pr=11812
Perfect — thank you! Now just to fix those two issue I guess 🚀