diff --git a/apps/site/components/withMetaBar.tsx b/apps/site/components/withMetaBar.tsx index 612052305c51c..b06fd40704a47 100644 --- a/apps/site/components/withMetaBar.tsx +++ b/apps/site/components/withMetaBar.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useFormatter } from 'next-intl'; +import { useFormatter, useLocale, useTranslations } from 'next-intl'; import type { FC } from 'react'; import MetaBar from '@/components/Containers/MetaBar'; @@ -10,6 +10,8 @@ import WithAvatarGroup from '@/components/withAvatarGroup'; import { useClientContext } from '@/hooks/react-client'; import useMediaQuery from '@/hooks/react-client/useMediaQuery'; import { DEFAULT_DATE_FORMAT } from '@/next.calendar.constants.mjs'; +import { TRANSLATION_URL } from '@/next.constants.mjs'; +import { defaultLocale } from '@/next.locales.mjs'; import { getGitHubBlobUrl } from '@/util/gitHubUtils'; const WithMetaBar: FC = () => { @@ -22,6 +24,9 @@ const WithMetaBar: FC = () => { const usernames = frontmatter.authors?.split(',').map(author => author.trim()) ?? []; + const t = useTranslations(); + const locale = useLocale(); + // Since we cannot show the same number of avatars in Mobile / Tablet // resolution as we do on desktop and there is overflow, we are adjusting // the number of avatars manually for the resolutions below @@ -47,7 +52,15 @@ const WithMetaBar: FC = () => { 'components.metabar.contribute': ( <> - Edit this page + + {t('components.metabar.contributeText')} + ), }} diff --git a/apps/site/next.constants.mjs b/apps/site/next.constants.mjs index c1d75c04dd6f0..3df5797431b16 100644 --- a/apps/site/next.constants.mjs +++ b/apps/site/next.constants.mjs @@ -187,3 +187,9 @@ export const ORAMA_CLOUD_API_KEY = * Note: This has no NEXT_PUBLIC prefix as it should not be exposed to the Browser. */ export const GITHUB_API_KEY = process.env.NEXT_GITHUB_API_KEY || ''; + +/** + * The resource we point people to when discussing internationalization efforts. + */ +export const TRANSLATION_URL = + 'https://github.com/nodejs/nodejs.org/blob/main/TRANSLATION.md#how-to-translate';