wimi/test/mocks/chrome.i18n.ts
2023-09-28 18:12:05 -03:00

8 lines
259 B
TypeScript

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;
}