Add a preferred language dropdown

This commit is contained in:
Matt Rubens
2024-12-21 10:10:05 -05:00
parent 6ad6949265
commit 8b4c52fb51
11 changed files with 275 additions and 7 deletions

View File

@@ -772,9 +772,17 @@ async function loadRuleFiles(cwd: string): Promise<string> {
return combinedRules
}
export async function addCustomInstructions(customInstructions: string, cwd: string): Promise<string> {
export async function addCustomInstructions(customInstructions: string, cwd: string, preferredLanguage?: string): Promise<string> {
const ruleFileContent = await loadRuleFiles(cwd)
const allInstructions = [customInstructions.trim()]
const allInstructions = []
if (preferredLanguage) {
allInstructions.push(`You should always speak and think in the ${preferredLanguage} language.`)
}
if (customInstructions.trim()) {
allInstructions.push(customInstructions.trim())
}
if (ruleFileContent && ruleFileContent.trim()) {
allInstructions.push(ruleFileContent.trim())