in src/provider/configurationProvider.ts [15:36]
export async function registerConfiguration(context: vscode.ExtensionContext) {
// 初始化语言环境
initializeLanguage();
// 监听配置项变化
context.subscriptions.push(
vscode.workspace.onDidChangeConfiguration((event) => {
if (event.affectsConfiguration(`${myPlugin}.${mySettings.displayLanguage}`)) {
initializeLanguage();
vscode.commands.executeCommand("alicloud.api.restart");
}
}),
);
// 提供切换语言的命令
context.subscriptions.push(
vscode.commands.registerCommand("alicloud.api.changeLanguage", () => {
// const newLanguage = currentLanguage === "en" ? "zh" : "en";
// config.update(mySettings.displayLanguage, newLanguage, vscode.ConfigurationTarget.Global);
}),
);
}