wimi/test/mocks/chrome.i18n.ts

9 lines
259 B
TypeScript
Raw Normal View History

2023-09-28 23:10:15 +02:00
import { readFileSync } from "fs";
import path from "path";
export function getMessage(key: string) {
const buf = readFileSync(path.resolve("src/_locales/en/messages.json"));
const messages = JSON.parse(buf.toString());
return messages[key].message;
}