Skip to content

Commit 7780957

Browse files
committed
Fix language passing
1 parent 41bd36c commit 7780957

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/core/Cline.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3692,12 +3692,13 @@ export class Cline extends EventEmitter<ClineEvents> {
36923692
customModePrompts,
36933693
experiments = {} as Record<ExperimentId, boolean>,
36943694
customInstructions: globalCustomInstructions,
3695+
language,
36953696
} = (await this.providerRef.deref()?.getState()) ?? {}
36963697
const currentMode = mode ?? defaultModeSlug
36973698
const modeDetails = await getFullModeDetails(currentMode, customModes, customModePrompts, {
36983699
cwd,
36993700
globalCustomInstructions,
3700-
language: formatLanguage(vscode.env.language),
3701+
language: language ?? formatLanguage(vscode.env.language),
37013702
})
37023703
details += `\n\n# Current Mode\n`
37033704
details += `<slug>${currentMode}</slug>\n`

src/core/prompts/system.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ async function generatePrompt(
4141
diffEnabled?: boolean,
4242
experiments?: Record<string, boolean>,
4343
enableMcpServerCreation?: boolean,
44+
language?: string,
4445
rooIgnoreInstructions?: string,
4546
): Promise<string> {
4647
if (!context) {
@@ -109,6 +110,7 @@ export const SYSTEM_PROMPT = async (
109110
diffEnabled?: boolean,
110111
experiments?: Record<string, boolean>,
111112
enableMcpServerCreation?: boolean,
113+
language?: string,
112114
rooIgnoreInstructions?: string,
113115
): Promise<string> => {
114116
if (!context) {
@@ -139,7 +141,7 @@ export const SYSTEM_PROMPT = async (
139141
globalCustomInstructions || "",
140142
cwd,
141143
mode,
142-
{ language: formatLanguage(vscode.env.language), rooIgnoreInstructions },
144+
{ language: language ?? formatLanguage(vscode.env.language), rooIgnoreInstructions },
143145
)
144146
// For file-based prompts, don't include the tool sections
145147
return `${roleDefinition}
@@ -166,6 +168,7 @@ ${customInstructions}`
166168
diffEnabled,
167169
experiments,
168170
enableMcpServerCreation,
171+
language,
169172
rooIgnoreInstructions,
170173
)
171174
}

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
25452545
writeDelayMs: stateValues.writeDelayMs ?? 1000,
25462546
terminalOutputLineLimit: stateValues.terminalOutputLineLimit ?? 500,
25472547
mode: stateValues.mode ?? defaultModeSlug,
2548-
language: stateValues.language || formatLanguage(vscode.env.language),
2548+
language: stateValues.language ?? formatLanguage(vscode.env.language),
25492549
mcpEnabled: stateValues.mcpEnabled ?? true,
25502550
enableMcpServerCreation: stateValues.enableMcpServerCreation ?? true,
25512551
alwaysApproveResubmit: stateValues.alwaysApproveResubmit ?? false,

0 commit comments

Comments
 (0)