feat: language support via locale config (#96)
Co-authored-by: hiroki osame <hiroki.osame@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4876e8d966
commit
58ce61eab8
@@ -36,6 +36,7 @@ export default async (
|
||||
|
||||
const config = await getConfig();
|
||||
const OPENAI_KEY = process.env.OPENAI_KEY ?? process.env.OPENAI_API_KEY ?? config.OPENAI_KEY;
|
||||
const locale = config.locale ?? 'en';
|
||||
if (!OPENAI_KEY) {
|
||||
throw new KnownError('Please set your OpenAI API key via `aicommits config set OPENAI_KEY=<your token>`');
|
||||
}
|
||||
@@ -44,6 +45,7 @@ export default async (
|
||||
s.start('The AI is analyzing your changes');
|
||||
const messages = await generateCommitMessage(
|
||||
OPENAI_KEY,
|
||||
locale,
|
||||
staged.diff,
|
||||
generate,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user