mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-21 23:57:07 +02:00
web/updates: add alt text to navigation buttons
This commit is contained in:
parent
8b866ddf6f
commit
5fc893a273
4
web/i18n/en/updates.json
Normal file
4
web/i18n/en/updates.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"button.next": "go to older changelog ({{ value }})",
|
||||||
|
"button.previous": "go to newer changelog ({{ value }})"
|
||||||
|
}
|
@ -22,7 +22,9 @@ for (const [ path, loader ] of Object.entries(locFiles)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const defaultLocale = 'en';
|
const defaultLocale = 'en';
|
||||||
const config: Config = {
|
const config: Config<{
|
||||||
|
value?: string;
|
||||||
|
}> = {
|
||||||
fallbackLocale: defaultLocale,
|
fallbackLocale: defaultLocale,
|
||||||
translations: Object.keys(parsedLocfiles).reduce((obj, lang) => {
|
translations: Object.keys(parsedLocfiles).reduce((obj, lang) => {
|
||||||
return {
|
return {
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
wrapper.scrollTop += e.deltaY;
|
wrapper.scrollTop += e.deltaY;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
$: prev = versions[currentIndex - 1];
|
$: prev = versions[currentIndex - 1];
|
||||||
$: next = versions[currentIndex + 1];
|
$: next = versions[currentIndex + 1];
|
||||||
@ -80,20 +80,16 @@
|
|||||||
</title>
|
</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window on:keydown={handleKeydown} />
|
||||||
on:keydown={handleKeydown}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div
|
<div class="news" tabindex="-1" data-focus-ring-hidden on:wheel={handleScroll}>
|
||||||
class="news"
|
|
||||||
tabindex="-1"
|
|
||||||
data-focus-ring-hidden
|
|
||||||
on:wheel={handleScroll}
|
|
||||||
>
|
|
||||||
{#if changelog}
|
{#if changelog}
|
||||||
<div id="left-button" class="button-wrapper-desktop">
|
<div id="left-button" class="button-wrapper-desktop">
|
||||||
{#if prev}
|
{#if prev}
|
||||||
<button on:click={loadPrev}>
|
<button
|
||||||
|
on:click={loadPrev}
|
||||||
|
aria-label={$t("updates.button.previous", { value: prev })}
|
||||||
|
>
|
||||||
<IconArrowLeft />
|
<IconArrowLeft />
|
||||||
{prev || ""}
|
{prev || ""}
|
||||||
</button>
|
</button>
|
||||||
@ -114,7 +110,10 @@
|
|||||||
|
|
||||||
<div class="button-wrapper-mobile" class:only-right={!prev}>
|
<div class="button-wrapper-mobile" class:only-right={!prev}>
|
||||||
{#if prev}
|
{#if prev}
|
||||||
<button on:click={loadPrev}>
|
<button
|
||||||
|
on:click={loadPrev}
|
||||||
|
aria-label={$t("updates.button.previous", { value: prev })}
|
||||||
|
>
|
||||||
<IconArrowLeft />
|
<IconArrowLeft />
|
||||||
{prev || ""}
|
{prev || ""}
|
||||||
</button>
|
</button>
|
||||||
@ -124,6 +123,7 @@
|
|||||||
on:click={loadNext}
|
on:click={loadNext}
|
||||||
on:focus={preloadNext}
|
on:focus={preloadNext}
|
||||||
on:mousemove={preloadNext}
|
on:mousemove={preloadNext}
|
||||||
|
aria-label={$t("updates.button.next", { value: next })}
|
||||||
>
|
>
|
||||||
{next || ""}
|
{next || ""}
|
||||||
<IconArrowRight />
|
<IconArrowRight />
|
||||||
@ -137,6 +137,7 @@
|
|||||||
on:click={loadNext}
|
on:click={loadNext}
|
||||||
on:focus={preloadNext}
|
on:focus={preloadNext}
|
||||||
on:mousemove={preloadNext}
|
on:mousemove={preloadNext}
|
||||||
|
aria-label={$t("updates.button.next", { value: next })}
|
||||||
>
|
>
|
||||||
{next || ""}
|
{next || ""}
|
||||||
<IconArrowRight />
|
<IconArrowRight />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user