Skip to content

feat: add chinese & hindi translations#771

Merged
quantizor merged 9 commits intomainfrom
i18n
Dec 25, 2025
Merged

feat: add chinese & hindi translations#771
quantizor merged 9 commits intomainfrom
i18n

Conversation

@quantizor
Copy link
Copy Markdown
Owner

No description provided.

- Add languages.ts registry for supported languages (en, zh)
- Add ui-strings.ts with multilingual UI labels and messages
- Create English baseline documentation in src/i18n/en/
- Add i18n validation script to ensure translation completeness
- Add Chinese i18n rules for translation guidelines
Complete Mandarin translations for all documentation:
- README.md with full API documentation and examples
- GFM spec (GitHub Flavored Markdown specification)
- CommonMark spec (Markdown specification)
- Interactive demo template

All natural language content translated to Simplified Chinese (普通话)
with technical terms including English equivalents on first use.
Add @lang zh JSDoc tags with Simplified Chinese translations to all exported:
- Functions (parser, compilers, utilities)
- Types and interfaces (Options, RenderOptions, AST nodes)
- React, HTML, Markdown, Native, Solid, and Vue components

Improves developer experience for Chinese-speaking developers with
bilingual inline documentation visible in IDEs and editors.
Add Modern Standard Hindi (हिन्दी) as third supported language:
- Complete translations of all documentation (README, specs, template)
- Hindi UI strings for interactive components
- Hindi i18n translation guidelines
- Update language registry and UI strings to include Hindi

Follows global speaker rankings (Ethnologue 2025) for language prioritization.
Improves accessibility for Hindi-speaking developers worldwide.
Add @lang hi JSDoc tags with Modern Standard Hindi translations to all exported:
- Core parser and compiler functions
- Type definitions and interfaces
- All renderer adapters (React, HTML, Markdown, Native, Solid, Vue)

Completes trilingual documentation (English, Chinese, Hindi) for all
public APIs, making the library more accessible to developers globally.
Add multilingual support to the demo site:
- Language dropdown in navigation for English, Chinese, Hindi
- Dynamic content loading based on selected language
- Internationalized UI strings for all controls and labels
- Responsive design with language-specific typography

Users can now view documentation and try the parser in their preferred
language, improving accessibility and user experience.
- Update AGENTS.md with i18n workflow and translation guidelines
- Add i18n contribution guidelines to CONTRIBUTING.md
- Update README.md with language support information
- Add i18n command documentation for cursor workflow
- Add parse.spec.ts test for i18n validation
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 25, 2025

🦋 Changeset detected

Latest commit: fd9c01f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
markdown-to-jsx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown

Copilot AI left a 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 comprehensive internationalization support with Chinese (zh) and Hindi (hi) translations to markdown-to-jsx. The implementation includes translated documentation, UI strings, code comments/JSDoc, and a language switcher for the demo site.

Key Changes:

  • New i18n infrastructure with language detection and switching
  • Complete translations of README, markdown specs, and demo templates in Chinese and Hindi
  • Bilingual JSDoc comments throughout the codebase
  • Language-aware demo site with persistent language selection

Reviewed changes

Copilot reviewed 53 out of 61 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/i18n/languages.ts Language registry with metadata (new)
src/i18n/ui-strings.ts UI string translations for en/zh/hi (new)
src/i18n/{lang}/README.md Translated documentation files (new)
src/i18n/{lang}/*.md Translated markdown specs and templates (new)
src/vue.tsx, src/react.tsx, src/solid.tsx, etc. Added bilingual JSDoc comments
src/site/presets.ts Updated to load language-specific presets
src/site/lava-lamp.tsx Improved error handling with try-catch blocks
site.tsx Major refactor for i18n support with language detection/switching
scripts/validate-i18n.ts Validation script for translation completeness (new)
package.json Added i18n validation scripts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lang: string
onChange: (lang: string) => void
}) {
const displayNames = React.useMemo(() => {
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

Unused variable displayNames.

Copilot uses AI. Check for mistakes.
@quantizor quantizor disabled auto-merge December 25, 2025 23:49
@quantizor quantizor merged commit fa21868 into main Dec 25, 2025
13 checks passed
@quantizor quantizor deleted the i18n branch December 25, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants