28 lines
577 B
TypeScript
28 lines
577 B
TypeScript
|
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||
|
//
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
import en from "../lang/en.json";
|
||
|
|
||
|
function setupStubs() {
|
||
|
class StubGame {
|
||
|
constructor() {
|
||
|
this.i18n = {
|
||
|
localize: (key: string) => (key in en ? en[key as keyof typeof en] : key),
|
||
|
};
|
||
|
}
|
||
|
i18n: {
|
||
|
localize: (key: string) => string;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const game = new StubGame();
|
||
|
|
||
|
Object.defineProperties(globalThis, {
|
||
|
game: { value: game },
|
||
|
Game: { value: StubGame },
|
||
|
});
|
||
|
}
|
||
|
|
||
|
setupStubs();
|