-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c48997a
commit 4ae7027
Showing
5 changed files
with
91 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import chalk from "chalk"; | ||
|
||
export default function displayOptions(options: string[]) { | ||
const message = options.map((m, i) => `${chalk.bold(chalk.yellow(i + 1))}. ${m}`).join("\n"); | ||
console.log(`Commit message options:\n${message}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { AvailableLanguages, LanguageLocales } from "./configure.js" | ||
|
||
type CliMessages = { | ||
prompts: { | ||
"enter-openai-key": string; | ||
}, | ||
errors: { | ||
"no-diff": string; | ||
} | ||
} | ||
|
||
type Messages = { | ||
[key in AvailableLanguages]: CliMessages | undefined; | ||
}; | ||
|
||
const Messages: Messages = { | ||
"en-us": { | ||
prompts: { | ||
"enter-openai-key": "Enter your OpenAI API key > ", | ||
}, | ||
errors: { | ||
"no-diff": "No changes to commit", | ||
} | ||
}, | ||
"en-au": undefined, | ||
"en-ca": undefined, | ||
"en-gb": undefined, | ||
"en-in": undefined, | ||
"en-ie": undefined, | ||
"en-jm": undefined, | ||
"en-nz": undefined, | ||
"en-ph": undefined, | ||
"en-sg": undefined, | ||
"en-za": undefined, | ||
"en-tt": undefined, | ||
"en-zw": undefined, | ||
"en-bz": undefined, | ||
"en-hk": undefined, | ||
"en-my": undefined, | ||
"en-pk": undefined, | ||
"en-ng": undefined, | ||
"en-gh": undefined, | ||
"en-ke": undefined, | ||
"en-ug": undefined, | ||
"en-tz": undefined, | ||
} | ||
|
||
const MessagesForCurrentLanguage = Messages[process.env.LANG as LanguageLocales] ?? Messages["en-us"] as CliMessages; | ||
|
||
export default MessagesForCurrentLanguage; |