remove bloat fonts, get rid of svelte-i18n

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-07-24 06:15:19 +03:00
parent bf95c575eb
commit e3692f90b1
53 changed files with 1965 additions and 2616 deletions

View File

@@ -0,0 +1,22 @@
import { color } from "../lib/util.js";
export async function load({ cookies, request }) {
// attempt get the preferred locale from cookies
let locale = cookies.get("locale");
/* if that doesn't work, try the accept-language header, and update the
* cookies respectively */
if (!locale) {
locale = request.headers.get("accept-language")?.split(",")[0];
cookies.set("locale", locale, { path: "/" });
}
return {
// the locale we detected
locale: locale,
/* color is randomly picked on the server and passed via data to the client
* so both the client and the server will have the same color */
color: color(),
};
}