Update project configuration and enhance translation support. Added caching mechanism for CMS responses with a new script, updated .gitignore to include cache files, and introduced translation handling in various components. Enhanced package.json with new scripts for cache warming and deployment. Added new translation-related components and improved existing ones for better localization support.

This commit is contained in:
Peter Meier
2026-03-17 22:32:31 +01:00
parent 1f5454d04e
commit daa4ea17b1
46 changed files with 5207 additions and 781 deletions
+25
View File
@@ -0,0 +1,25 @@
<script lang="ts">
import { setContext } from "svelte";
import type { Snippet } from "svelte";
import type { Translations, TranslationReplacements } from "../lib/translations";
import { T_CONTEXT_KEY, replacePlaceholders } from "../lib/translations";
let {
translations = {},
children,
}: {
translations?: Translations;
children?: Snippet;
} = $props();
const t = (key: string, replacements?: TranslationReplacements): string => {
const raw = translations?.[key] ?? key;
return replacePlaceholders(raw, replacements);
};
setContext(T_CONTEXT_KEY, t);
</script>
{#if children}
{@render children()}
{/if}