Skip to content

Commit

Permalink
Merge pull request #160 from w3c/disclaimer-box
Browse files Browse the repository at this point in the history
Improve Translation Box
  • Loading branch information
iadawn authored Jun 20, 2024
2 parents bc2d8fd + a5a3f42 commit 3041b5c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
32 changes: 24 additions & 8 deletions src/components/ui/Page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
<h1>{title}</h1>
{#if currentLocale.status === "draft"}
<section id="translation-info" class="doc-note-translation" lang="en">
<h2 class="visuallyhidden">About this translation</h2>
<p>This volunteer translation is a <strong>draft</strong>. It contains English wording that will be translated soon.</p>
<p>See <a href="{`${$basepath}/acknowledgements`}">Acknowledgements</a> for all translators and contributors.</p>
<h2 class="visuallyhidden">{TRANSLATED.TRANSLATION_ABOUT}</h2>
<p>{@html TRANSLATED.TRANSLATION_DRAFT}</p>
{#if currentLocale.wcagStatus === "unofficial"}
<p>{@html TRANSLATED.TRANSLATION_UNOFFICIAL}</p>
{/if}
<p>{@html TRANSLATED.TRANSLATION_ACK}</p>
</section>
{/if}
<slot />
Expand All @@ -27,9 +30,12 @@
<h1>{title}</h1>
{#if currentLocale.status === "draft"}
<section id="translation-info" class="doc-note-translation" lang="en">
<h2 class="visuallyhidden">About this translation</h2>
<p>This volunteer translation is a <strong>draft</strong>. It contains English wording that will be translated soon.</p>
<p>See <a href="{`${$basepath}/acknowledgements`}">Acknowledgements</a> for all translators and contributors.</p>
<h2 class="visuallyhidden">{TRANSLATED.TRANSLATION_ABOUT}</h2>
<p>{@html TRANSLATED.TRANSLATION_DRAFT}</p>
{#if currentLocale.wcagStatus === "unofficial"}
<p>{@html TRANSLATED.TRANSLATION_UNOFFICIAL}</p>
{/if}
<p>{@html TRANSLATED.TRANSLATION_ACK}</p>
</section>
{/if}
<slot />
Expand All @@ -54,15 +60,15 @@
</style>

<script>
import { onMount } from "svelte";
import { onMount, getContext } from "svelte";
import { useLocation } from 'svelte-navigator';
import { honourFragmentIdLinks } from '@app/scripts/honourFragmentIdLinks.js';
import { locale } from 'svelte-i18n';
import locales from '@app/locales/index.json';
$: currentLocale = locales.find((l) => l.lang === $locale);
import { routes, basepath, yourReportPanelOpen } from '@app/stores/appStore.js';
import { routes, yourReportPanelOpen } from '@app/stores/appStore.js';
import YourReport from '@app/components/ui/YourReport.svelte';
Expand All @@ -80,4 +86,14 @@
});
export let title;
const { translate } = getContext('app');
$: TRANSLATED = {
TRANSLATION_ABOUT: $translate('UI.COMMON.TRANSLATION_ABOUT'),
TRANSLATION_DRAFT: $translate('UI.COMMON.TRANSLATION_DRAFT'),
TRANSLATION_ACK: $translate('UI.COMMON.TRANSLATION_ACK'),
TRANSLATION_UNOFFICIAL: $translate('UI.COMMON.TRANSLATION_UNOFFICIAL'),
};
</script>
6 changes: 5 additions & 1 deletion src/locales/en/UI/COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
"DELETE": "Delete",
"FOR": "for",
"EXPAND_ALL": "Expand All Sections",
"COLLAPSE_ALL": "Collapse All Sections"
"COLLAPSE_ALL": "Collapse All Sections",
"TRANSLATION_ABOUT": "About this translation",
"TRANSLATION_DRAFT": "This volunteer translation is a <strong>draft</strong>. It contains English wording that will be translated soon.",
"TRANSLATION_ACK": "See <a href='https://www.w3.org/WAI/eval/report-tool/acknowledgements'>Acknowledgements</a> for all translators and contributors.",
"TRANSLATION_UNOFFICIAL": "This translation of WCAG 2 guidelines and success criteria is <strong>unofficial</strong> and might not accurately reflect the intentions of the <a href='https://www.w3.org/WAI/standards-guidelines/wcag/#versions'>English originals</a>."
}
6 changes: 5 additions & 1 deletion src/locales/fr/UI/COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
"DELETE": "Supprimer",
"FOR": "pour",
"EXPAND_ALL": "Afficher toutes les sections",
"COLLAPSE_ALL": "Masquer toutes les sections"
"COLLAPSE_ALL": "Masquer toutes les sections",
"TRANSLATION_ABOUT": "À propos de cette traduction",
"TRANSLATION_DRAFT": "Cette traduction faite par des volontaires est au statut de <strong>brouillon</strong>. Elle contient des termes en anglais qui seront traduits prochainement.",
"TRANSLATION_ACK": "Consultez la liste des traducteurs et contributeurs dans la page <a href='https://www.w3.org/WAI/eval/report-tool/acknowledgements'>Remerciements</a>.",
"TRANSLATION_UNOFFICIAL": "Cette traduction des règles et des critères de succès des WCAG 2 est <strong>non-officielle</strong> et pourrait ne pas réfleter les intentions des <a href='https://www.w3.org/WAI/standards-guidelines/wcag/#versions'>originaux en anglais</a>."
}
3 changes: 2 additions & 1 deletion src/locales/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{
"lang": "pl",
"title": "Polski",
"status": "draft"
"status": "draft",
"wcagStatus": "unofficial"
}
]

0 comments on commit 3041b5c

Please sign in to comment.