Skip to content

Add textlint to enforce writing guide [i18nIgnore] #11812

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jp-knj
Copy link
Contributor

@jp-knj jp-knj commented May 31, 2025

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)

Copy link

netlify bot commented May 31, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 76ab7f9
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/68896679db0b02000894102c
😎 Deploy Preview https://deploy-preview-11812--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jp-knj jp-knj marked this pull request as ready for review May 31, 2025 08:53
@sarah11918
Copy link
Member

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?

@sarah11918 sarah11918 added the consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. label Jul 7, 2025
@jp-knj jp-knj force-pushed the add-textlint-config branch 5 times, most recently from e3c353d to fd4bfa7 Compare July 7, 2025 13:58
@jp-knj jp-knj force-pushed the add-textlint-config branch from 05c53a8 to 5fd62c5 Compare July 7, 2025 14:02
@jp-knj
Copy link
Contributor Author

jp-knj commented Jul 7, 2025

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!

@sarah11918
Copy link
Member

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!

@sarah11918
Copy link
Member

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!

@@ -18,6 +18,7 @@
"lint:linkcheck:nobuild": "tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/lint-linkcheck.ts",
"lint:slugcheck": "node ./scripts/lint-slugcheck.mjs",
"lint:eslint": "eslint .",
"lint:ja": "textlint --cache --config .textlintrc.ja.json src/content/docs/ja/**/*.{md,mdx}",
Copy link
Member

Choose a reason for hiding this comment

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

We’d probably want to run this on PRs where ja docs are modified, so we pick up any issues in CI and avoid merging files with errors.

@kyosuke
Copy link
Contributor

kyosuke commented Jul 25, 2025

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.

@morinokami
Copy link
Contributor

+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.

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

Thanks @jp-knj, could you address Chris's comment and add a CI job that runs textlint for JP files?

@jp-knj jp-knj force-pushed the add-textlint-config branch from c6c7ee7 to 3f4a811 Compare July 29, 2025 10:46
@jp-knj
Copy link
Contributor Author

jp-knj commented Jul 29, 2025

@yanthomasdev
I'm late, add new lint japanese documentation ci 👍🏿

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jul 29, 2025
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jul 29, 2025

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.

@delucis
Copy link
Member

delucis commented Jul 29, 2025

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.

@yanthomasdev yanthomasdev changed the title Add textlint to enforce writing guide Add textlint to enforce writing guide [i18nIgnore] Jul 29, 2025
@jp-knj jp-knj force-pushed the add-textlint-config branch 2 times, most recently from b49fbeb to bb725c3 Compare July 30, 2025 00:23
@jp-knj jp-knj force-pushed the add-textlint-config branch from bb725c3 to 76ab7f9 Compare July 30, 2025 00:25
@jp-knj
Copy link
Contributor Author

jp-knj commented Jul 30, 2025

Thanks, update them to show the details on CI

https://github.com/withastro/docs/actions/runs/16610388038/job/46992130126?pr=11812

@delucis
Copy link
Member

delucis commented Jul 30, 2025

Perfect — thank you! Now just to fix those two issue I guess 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants