← Back to PRs

#8544: feat(i18n): add Japanese translation support with glossary and language rules

by dai open 2026-02-04 04:32 View on GitHub →
docs scripts stale
This pull request adds a Japanese "Getting Started" guide and improves the internationalization (i18n) translation tooling by introducing language-specific translation rules and a Japanese glossary. The main focus is on making onboarding easier for Japanese users and enhancing translation quality and consistency for multiple languages. **Documentation additions:** * Added a comprehensive Japanese "Getting Started" guide (`docs/start/getting-started-ja.md`) covering onboarding, installation, authentication, channel setup, pairing, and troubleshooting for new users. * Introduced a Japanese glossary (`docs/.i18n/glossary.ja-JP.json`) to ensure consistent translation of key terms and technical vocabulary. **Translation tooling improvements:** * Refactored the translation prompt generation in `translator.go` to inject language-specific rules and labels, supporting both Simplified Chinese and Japanese, and allowing for easy extension to other languages. [[1]](diffhunk://#diff-7fcd44c67d7c70162a312bf67e9d956cd7b41b8dec85f60386fd17c7ce55c59aL246-R255) [[2]](diffhunk://#diff-7fcd44c67d7c70162a312bf67e9d956cd7b41b8dec85f60386fd17c7ce55c59aL268-R276) [[3]](diffhunk://#diff-7fcd44c67d7c70162a312bf67e9d956cd7b41b8dec85f60386fd17c7ce55c59aR302-R334) * Added new helper functions (`targetLanguageLabel`, `targetLanguageRules`) to automatically select appropriate translation instructions and labels based on the target language, improving translation accuracy and tone. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds Japanese docs/i18n assets (a Japanese Getting Started guide and a ja-JP glossary/TM file) and refactors the docs translation prompt generator to support language-specific labels/rules (zh-CN and ja-JP) via new helper functions in `scripts/docs-i18n/translator.go`. The change fits into the existing docs-i18n pipeline by extending the prompt guidance used by `scripts/docs-i18n` and adding new locale-specific assets under `docs/.i18n/` to improve translation consistency. <h3>Confidence Score: 3/5</h3> - Mostly safe to merge, but there is a prompt assembly bug that will reduce translation quality for all languages using this translator. - The code changes are localized to prompt construction, but the current `fmt.Sprintf` argument order appears incorrect, which will misplace glossary vs language-rule blocks in the system prompt. Docs additions look fine and low-risk otherwise. - scripts/docs-i18n/translator.go <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs