Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Translation Box #160

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
]