2023-03-29 17:21:20 +02:00
|
|
|
<script lang="ts">
|
|
|
|
/**
|
|
|
|
* Properly renders a translation
|
|
|
|
*/
|
2023-06-14 20:39:36 +02:00
|
|
|
import { Translation } from "../i18n/Translation"
|
|
|
|
import WeblateLink from "./WeblateLink.svelte"
|
2023-12-12 19:18:50 +01:00
|
|
|
import { Store } from "../../Logic/UIEventSource"
|
2023-12-13 02:16:53 +01:00
|
|
|
import FromHtml from "./FromHtml.svelte"
|
2023-03-29 17:21:20 +02:00
|
|
|
|
2023-06-14 20:39:36 +02:00
|
|
|
export let t: Translation
|
2023-05-14 03:24:13 +02:00
|
|
|
export let cls: string = ""
|
2023-03-29 17:21:20 +02:00
|
|
|
// Text for the current language
|
2023-12-13 00:53:31 +01:00
|
|
|
let txt: Store<string | undefined> = t?.current
|
2023-12-30 15:24:30 +01:00
|
|
|
$: {
|
|
|
|
txt = t?.current
|
|
|
|
}
|
2023-03-29 17:21:20 +02:00
|
|
|
</script>
|
|
|
|
|
2023-12-13 02:16:53 +01:00
|
|
|
{#if $txt}
|
2023-05-30 23:45:30 +02:00
|
|
|
<span class={cls}>
|
2023-12-21 01:46:18 +01:00
|
|
|
<FromHtml src={$txt} />
|
2023-12-24 05:01:10 +01:00
|
|
|
<WeblateLink context={t?.context} />
|
2023-04-07 02:45:34 +02:00
|
|
|
</span>
|
|
|
|
{/if}
|