feat: add Russian localization and independent STT languages
This commit is contained in:
@@ -63,6 +63,7 @@ describe("desktop window chrome", () => {
|
||||
|
||||
it("preload exposes OS identity without exposing Node/Electron to the renderer", () => {
|
||||
let bridge: Record<string, unknown> = {};
|
||||
const sent: unknown[][] = [];
|
||||
const context = {
|
||||
process: { platform: "win32" },
|
||||
require: () => ({
|
||||
@@ -72,13 +73,15 @@ describe("desktop window chrome", () => {
|
||||
bridge = api;
|
||||
},
|
||||
},
|
||||
ipcRenderer: {},
|
||||
ipcRenderer: { send: (...args: unknown[]) => sent.push(args) },
|
||||
}),
|
||||
};
|
||||
runInNewContext(readFileSync(new URL("../electron/preload.cjs", import.meta.url), "utf8"), context);
|
||||
assert.equal(bridge.platform, "win32");
|
||||
(bridge.setLanguage as (language: string) => void)("ru");
|
||||
assert.deepEqual(sent, [["lh:language", "ru"]]);
|
||||
assert.deepEqual(Object.keys(bridge).sort(), [
|
||||
"chatgpt", "expandWindow", "getZoom", "installUpdate", "onUpdateStatus", "onZoom", "platform", "subscriptions",
|
||||
"chatgpt", "expandWindow", "getZoom", "installUpdate", "onUpdateStatus", "onZoom", "platform", "setLanguage", "subscriptions",
|
||||
]);
|
||||
assert.deepEqual(Object.keys(bridge.subscriptions as object).sort(), ["cancel", "consent", "disconnect", "login", "onChange", "open", "respond", "retry", "status"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user