mapcomplete/src/UI/Base/Tr.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
567 B
Svelte
Raw Normal View History

2023-03-29 17:21:20 +02:00
<script lang="ts">
/**
* Properly renders a translation
*/
import { Translation } from "../i18n/Translation"
import WeblateLink from "./WeblateLink.svelte"
import { Store } from "../../Logic/UIEventSource"
import FromHtml from "./FromHtml.svelte"
2023-03-29 17:21:20 +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>
{#if $txt}
<span class={cls}>
2023-12-21 01:46:18 +01:00
<FromHtml src={$txt} />
<WeblateLink context={t?.context} />
2023-04-07 02:45:34 +02:00
</span>
{/if}