From f86ebbca67f1330409ea32a73bd5ebdc2f88dc47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 13 Nov 2023 13:03:57 -0500 Subject: [PATCH] Make 'Home' translatable (#46054) Co-authored-by: Kevin Heis --- data/ui.yml | 1 + src/frame/components/sidebar/AllProductsLink.tsx | 4 +++- tests/fixtures/data/ui.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/ui.yml b/data/ui.yml index e8d24a0a00..64fdc15639 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -16,6 +16,7 @@ header: ghes_release_notes_upgrade_patch_and_release: 📣 This is not the latest patch release of this release series, and this is not the latest release of Enterprise Server. sign_up_cta: Sign up menu: Menu + go_home: Home picker: language_picker_label: Language product_picker_default_text: All products diff --git a/src/frame/components/sidebar/AllProductsLink.tsx b/src/frame/components/sidebar/AllProductsLink.tsx index b537402242..e0fb7373c8 100644 --- a/src/frame/components/sidebar/AllProductsLink.tsx +++ b/src/frame/components/sidebar/AllProductsLink.tsx @@ -2,10 +2,12 @@ import { useRouter } from 'next/router' import { ArrowLeftIcon } from '@primer/octicons-react' import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion' import { Link } from 'src/frame/components/Link' +import { useTranslation } from 'src/languages/components/useTranslation' export const AllProductsLink = () => { const router = useRouter() const { currentVersion } = useVersion() + const { t } = useTranslation('header') const currentVersionPathSegment = currentVersion === DEFAULT_VERSION ? '' : `/${currentVersion}` return ( @@ -15,7 +17,7 @@ export const AllProductsLink = () => { className="f6 pl-2 pr-5 ml-n1 pb-1 Link--primary color-fg-default" > - Home + {t('go_home')} ) diff --git a/tests/fixtures/data/ui.yml b/tests/fixtures/data/ui.yml index e8d24a0a00..64fdc15639 100644 --- a/tests/fixtures/data/ui.yml +++ b/tests/fixtures/data/ui.yml @@ -16,6 +16,7 @@ header: ghes_release_notes_upgrade_patch_and_release: 📣 This is not the latest patch release of this release series, and this is not the latest release of Enterprise Server. sign_up_cta: Sign up menu: Menu + go_home: Home picker: language_picker_label: Language product_picker_default_text: All products