UI: fix #1848, explicitly add element to help screen readers pronounce everything correctly

This commit is contained in:
Pieter Vander Vennet 2024-05-26 22:48:59 +02:00
parent cecfaebf5b
commit 9832aa45f0
6 changed files with 94 additions and 35 deletions

View file

@ -6,19 +6,25 @@
import WeblateLink from "./WeblateLink.svelte"
import { Store } from "../../Logic/UIEventSource"
import FromHtml from "./FromHtml.svelte"
import { Utils } from "../../Utils"
export let t: Translation
export let cls: string = ""
// Text for the current language
let txt: Store<string | undefined> = t?.current
let lang = t?.currentLang
$: {
txt = t?.current
lang = t?.currentLang
}
</script>
{#if $txt}
<span class={cls}>
<FromHtml src={$txt} />
<span lang={$lang}>
{@html Utils.purify($txt)}
</span>
<WeblateLink context={t?.context} />
</span>
{/if}