Skip to content

feat(wiki): add --language option for multilingual wiki generation#196

Closed
jnMetaCode wants to merge 1 commit into
abhigyanpatwari:mainfrom
jnMetaCode:feat/wiki-language-option
Closed

feat(wiki): add --language option for multilingual wiki generation#196
jnMetaCode wants to merge 1 commit into
abhigyanpatwari:mainfrom
jnMetaCode:feat/wiki-language-option

Conversation

@jnMetaCode

Copy link
Copy Markdown

Summary

Closes #95

Adds a --language <lang> flag to the wiki command so users can generate documentation in their preferred language.

gitnexus wiki --language zh-CN    # Chinese
gitnexus wiki --language ja       # Japanese
gitnexus wiki --language ko       # Korean

How it works

When --language is set, a language instruction is appended to the LLM system prompts for module pages, parent pages, and the overview page. The grouping step is unaffected since it must output structured JSON.

Code identifiers, file paths, and Mermaid diagram labels stay in their original form — only the prose (headings, descriptions, explanations) is written in the target language.

Changes

  • cli/index.ts — register --language <lang> CLI option
  • cli/wiki.ts — pass language through WikiCommandOptionsWikiOptions
  • core/wiki/generator.tswithLanguage() helper appends language instruction to system prompts; applied to leaf, parent, and overview generation
  • README.md — document the new flag

Test plan

  • gitnexus wiki --help shows the new --language option
  • gitnexus wiki without --language works as before (no change to prompts)
  • gitnexus wiki --language zh-CN generates Chinese documentation with original code identifiers preserved

@vercel

vercel Bot commented Mar 6, 2026

Copy link
Copy Markdown

@jnMetaCode is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

Add a --language flag to the wiki command that instructs the LLM to
generate documentation in the specified language (e.g. zh-CN, ja, ko).

Code identifiers, file paths, and Mermaid labels stay in their original
form — only prose headings and descriptions are translated.

The grouping step is unaffected since it must output structured JSON.

Closes abhigyanpatwari#95

@reversTeam reversTeam left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clean and well-scoped PR, @jnMetaCode. This is a nice feature addition. Approving.

What looks good:

  • The withLanguage() helper is a simple, elegant approach — appending a language instruction to the system prompt keeps the change minimal and non-invasive.
  • Correctly applied to leaf modules, parent modules, and overview generation, but not to the grouping step (which needs structured JSON output). Good judgment call.
  • The instruction to keep code identifiers, file paths, and Mermaid node labels in their original form is important and well-worded.
  • CLI option, interface types, and README docs are all updated consistently.

One minor thought (non-blocking):

  • The language value is passed as a free-form string (e.g., zh-CN, ja). This is fine and flexible, but the LLM prompt says "Write ALL documentation output in zh-CN" — for some models, a human-readable language name ("Chinese", "Japanese") might produce better results than a locale code. You could consider a small mapping for common codes, but this is a nice-to-have and not a blocker.

Well done — this pairs nicely with the Chinese README PR (#197).

@magyargergo

Copy link
Copy Markdown
Collaborator

⚠️ Upcoming Prettier formatting — rebase instructions

PR #563 adds Prettier as the code formatter for the repo. When it merges, the bulk format commit will touch ~350 files (style-only: whitespace, quotes, trailing commas). Your branch will likely conflict.

After #563 merges, rebase your branch:

git fetch origin
git checkout <your-branch>
git rebase origin/main

# Conflicts will be formatting-only — accept your version:
git checkout --theirs .
git add .
git rebase --continue

# Then re-format your branch to match the new style:
npx prettier --write .
git add -A
git commit -m "style: apply prettier formatting"
git push --force-with-lease

New setup step: Run npm install at the repo root (not just in gitnexus/) to get prettier + activate the pre-commit hook. The hook auto-formats staged files on every commit going forward.

@magyargergo

Copy link
Copy Markdown
Collaborator

Please submit a new PR if this is still relevant

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.

can gitnexus wiki support language setup ?

3 participants