From 270e656882c5608060093c485c12fffcd14aa03f Mon Sep 17 00:00:00 2001 From: Xavier FACQ Date: Tue, 12 Sep 2023 10:53:13 +0200 Subject: [PATCH] [AsciidocTemplate] warning boxes need to be translated --- locales/fr/asciidoc.json | 4 ++++ src/templates/asciidocTemplate.tsx | 27 ++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 locales/fr/asciidoc.json diff --git a/locales/fr/asciidoc.json b/locales/fr/asciidoc.json new file mode 100644 index 0000000000..b6acd846cb --- /dev/null +++ b/locales/fr/asciidoc.json @@ -0,0 +1,4 @@ +{ + "asciidoc.template.warn.default.locale": "Cette page est la version en anglais car elle n'existe pas dans votre langue. Aidez-nous à la traduire en français. Consultez notre guide de traduction pour plus d'informations.", + "asciidoc.template.warn.outdated": "Cette page est la version en anglais car elle n'existe pas dans votre langue. Aidez-nous à traduire la dernière version en anglais. Consultez notre guide de traduction pour plus d'informations." +} \ No newline at end of file diff --git a/src/templates/asciidocTemplate.tsx b/src/templates/asciidocTemplate.tsx index ba79c63214..f6a22a08e7 100644 --- a/src/templates/asciidocTemplate.tsx +++ b/src/templates/asciidocTemplate.tsx @@ -9,6 +9,8 @@ import EditLink from '../components/EditLink' import AuthorsList from '../components/AuthorList' import InstallTabs from '../components/InstallTabs' import Seo from '../components/Seo' +import { Trans } from 'gatsby-plugin-react-i18next'; +import LinkText from '../components/LinkText' import '@fortawesome/fontawesome-free/css/all.min.css' import '@fortawesome/fontawesome-free/css/v4-shims.min.css' @@ -26,7 +28,7 @@ const AsciidocTemplate = ({ data, pageContext }) => { const { defaultGitSHA, locale, language } = pageContext const displayDefaultLocaleWarning = locale !== language; // because the version in the 'language' doesn't exist - const displayOutdatedWarning = basedOnSha && defaultGitSHA !== basedOnSha; + const displayOutdatedWarning = defaultGitSHA && basedOnSha && defaultGitSHA !== basedOnSha; return ( @@ -40,17 +42,28 @@ const AsciidocTemplate = ({ data, pageContext }) => { {displayDefaultLocaleWarning && (
- This page is the the English version because it is not available in your language. - Please help us by translating this page to match the latest version of the English page. - See our translation guide for more information. + , + translationGuideLink: + }} + />
)} {displayOutdatedWarning && (
- This localized page is based on a previous version of the English page and might be inaccurate. - Please help us by updating this page to match the latest version of the English page. - See our translation guide for more information. + , + lastEnglishVersionLink: , + translationGuideLink: + }} + />
)} {slug === '/installation/' && (