chore(web): migration svelte 5 syntax (#13883)
This commit is contained in:
@@ -3,12 +3,18 @@
|
||||
import type { InterpolationValues } from '$lib/components/i18n/format-message.svelte';
|
||||
import type { Translations } from 'svelte-i18n';
|
||||
|
||||
export let key: Translations;
|
||||
export let values: InterpolationValues = {};
|
||||
interface Props {
|
||||
key: Translations;
|
||||
values?: InterpolationValues;
|
||||
}
|
||||
|
||||
let { key, values = {} }: Props = $props();
|
||||
</script>
|
||||
|
||||
<FormatMessage {key} {values} let:message let:tag>
|
||||
{#if tag === 'b'}
|
||||
<b>{message}</b>
|
||||
{/if}
|
||||
<FormatMessage {key} {values}>
|
||||
{#snippet children({ message, tag })}
|
||||
{#if tag === 'b'}
|
||||
<b>{message}</b>
|
||||
{/if}
|
||||
{/snippet}
|
||||
</FormatMessage>
|
||||
|
||||
Reference in New Issue
Block a user