Skip to content

Conversation

@jcppkkk
Copy link
Contributor

@jcppkkk jcppkkk commented Oct 30, 2025

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 jcppkkk force-pushed the fix/commitlint-i18n-translation branch from 4d11e61 to 4320ceb Compare October 31, 2025 02:11
…unction

Add a translation parameter to the GEN_COMMITLINT_CONSISTENCY_PROMPT function to
support localization of commit messages. This change enhances the flexibility of
the commitlint integration by allowing prompts to be generated in different languages,
improving usability for non-English speakers.
@jcppkkk jcppkkk force-pushed the fix/commitlint-i18n-translation branch from 4320ceb to 0727329 Compare October 31, 2025 03:28
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.

1 participant