Merge pull request #379 from devchat-ai/fix_lang_zh
Fix language handling for Simplified Chinese
This commit is contained in:
commit
71a244dd30
@ -8,7 +8,10 @@ regOutMessage({ command: 'ideLanguage', lang: "" }); // Placeholder for the lang
|
|||||||
// Implement the handler function to get the current IDE language setting
|
// Implement the handler function to get the current IDE language setting
|
||||||
export async function getIdeLanguage(panel: vscode.WebviewPanel | vscode.WebviewView): Promise<void> {
|
export async function getIdeLanguage(panel: vscode.WebviewPanel | vscode.WebviewView): Promise<void> {
|
||||||
// Get the current IDE language setting
|
// Get the current IDE language setting
|
||||||
const ideLanguage = vscode.env.language;
|
let ideLanguage = vscode.env.language;
|
||||||
|
if (ideLanguage.startsWith("zh-")) {
|
||||||
|
ideLanguage = "zh";
|
||||||
|
}
|
||||||
// 'en' stands for English, 'zh' stands for Simplified Chinese
|
// 'en' stands for English, 'zh' stands for Simplified Chinese
|
||||||
|
|
||||||
// Construct the message with the language information
|
// Construct the message with the language information
|
||||||
|
@ -33,7 +33,7 @@ const functionRegistry: any = {
|
|||||||
"/ide_language": {
|
"/ide_language": {
|
||||||
"keys": [],
|
"keys": [],
|
||||||
"handler": async () => {
|
"handler": async () => {
|
||||||
const language = vscode.env.language;
|
const language = vscode.env.language.startsWith("zh-") ? "zh" : "en";
|
||||||
// 'en' stands for English, 'zh' stands for Simplified Chinese
|
// 'en' stands for English, 'zh' stands for Simplified Chinese
|
||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user