opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

fix(commitlint): Support i18n translations in consistency prompt generation

Open jcppkkk opened this issue 3 weeks ago • 0 comments
trafficstars

Problem

When generating .opencommit-commitlint configuration with OCO_LANGUAGE=zh_TW (or other non-English languages), the LLM was generating consistency examples in English instead of using the translated content from the corresponding i18n JSON files (e.g., zh_TW.json).

Solution

  1. Modified GEN_COMMITLINT_CONSISTENCY_PROMPT function to accept translation parameter
  2. Added explicit instructions and reference examples to guide LLM to use correct language

Changes

  • src/modules/commitlint/prompts.ts: Added translation parameter and reference examples
  • src/modules/commitlint/config.ts: Pass translation object to prompt generation

Testing

OCO_LANGUAGE=zh_TW OCO_PROMPT_MODULE=@commitlint oco commitlint force

jcppkkk avatar Oct 30 '25 03:10 jcppkkk