From a88d62e07d745a64a34ea0d2d2c59d7679691d8f Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 13 Mar 2025 17:21:29 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90(frontend)=20make=20Docs=20title=20?= =?UTF-8?q?translatable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The title of the docs page was not translatable. We now use the `t` function to translate the title. --- src/frontend/apps/impress/src/pages/docs/[id]/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx index f9304cca..71eed626 100644 --- a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx +++ b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx @@ -3,6 +3,7 @@ import { useQueryClient } from '@tanstack/react-query'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { Box, Text, TextErrors } from '@/components'; import { DocEditor } from '@/docs/doc-editor'; @@ -64,14 +65,15 @@ const DocPage = ({ id }: DocProps) => { const queryClient = useQueryClient(); const { replace } = useRouter(); useCollaboration(doc?.id, doc?.content); + const { t } = useTranslation(); useEffect(() => { if (doc?.title) { setTimeout(() => { - document.title = `${doc.title} - Docs`; + document.title = `${doc.title} - ${t('Docs')}`; }, 100); } - }, [doc?.title]); + }, [doc?.title, t]); useEffect(() => { if (!docQuery || isFetching) {