2fef91a548
Full parity with Astro site: content rows, post/tag routes, pagination, event badges + OSM map, comments, Live-Search via /api/search-index, CMS image proxy, RSS, sitemap. Deploy: Dockerfile + docker-compose.prod.yml + Gitea Actions workflow to build + push to git.pm86.de registry and ssh-deploy to Contabo.
26 lines
649 B
Svelte
26 lines
649 B
Svelte
<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}
|