diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-17 21:33:08 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-17 21:33:08 +0200 |
commit | 976e2fc3e25bfd08c755aa222a45c42a53b0b8e0 (patch) | |
tree | e73b304827d149770a94b533569b08aa35ac4cad /test-client/main.ts | |
parent | 666adbf669afc06d87aa28f1a8ca120c5612d3a4 (diff) | |
download | hurrycurry-976e2fc3e25bfd08c755aa222a45c42a53b0b8e0.tar hurrycurry-976e2fc3e25bfd08c755aa222a45c42a53b0b8e0.tar.bz2 hurrycurry-976e2fc3e25bfd08c755aa222a45c42a53b0b8e0.tar.zst |
tc: localization
Diffstat (limited to 'test-client/main.ts')
-rw-r--r-- | test-client/main.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test-client/main.ts b/test-client/main.ts index 875e420d..f48aef17 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -17,6 +17,7 @@ */ /// <reference lib="dom" /> +import { init_locale } from "./locale.ts"; import { MovementBase, collide_player_player, update_movement } from "./movement.ts"; import { Gamedata, ItemIndex, ItemLocation, Message, MessageTimeout, PacketC, PacketS, PlayerID, TileIndex } from "./protocol.ts"; import { V2, lerp_exp_v2_mut, normalize, lerp_exp } from "./util.ts"; @@ -35,7 +36,8 @@ const HANDLED_KEYS = [KEY_BOOST, KEY_CHAT, KEY_CLOSE, KEY_DOWN, KEY_UP, KEY_LEFT export let ctx: CanvasRenderingContext2D; export let canvas: HTMLCanvasElement; let ws: WebSocket; -document.addEventListener("DOMContentLoaded", () => { +document.addEventListener("DOMContentLoaded", async () => { + await init_locale(navigator.language.split("-")[0] ?? "en") const ws_uri = window.location.protocol.endsWith("s:") ? `wss://${window.location.host}/` : `ws://${window.location.hostname}:27032/` |