diff --git a/website/public/locales/en/common.json b/website/public/locales/en/common.json index f8e31c99..6298a32c 100644 --- a/website/public/locales/en/common.json +++ b/website/public/locales/en/common.json @@ -11,12 +11,12 @@ "legal": "Legal", "loading": "Loading...", "more_information": "More Information", + "no": "No", "privacy_policy": "Privacy Policy", "report_a_bug": "Report a Bug", "sign_in": "Sign In", "sign_out": "Sign Out", "terms_of_service": "Terms of Service", "title": "Open Assistant", - "yes": "Yes", - "no": "No" + "yes": "Yes" } diff --git a/website/public/locales/en/message.json b/website/public/locales/en/message.json index 45ea04a1..e16e3c0a 100644 --- a/website/public/locales/en/message.json +++ b/website/public/locales/en/message.json @@ -1,11 +1,13 @@ { - "reactions": "Reactions", "label_action": "Label", "label_title": "Label", - "submit_labels": "Submit", + "message": "Message", "open_new_tab_action": "Open in new tab", - "report_title": "Report", + "parent": "Parent", + "reactions": "Reactions", "report_action": "Report", "report_placeholder": "Why should this message be reviewed?", - "send_report": "Send" + "report_title": "Report", + "send_report": "Send", + "submit_labels": "Submit" } diff --git a/website/src/pages/messages/[id]/index.tsx b/website/src/pages/messages/[id]/index.tsx index 4513fc37..158d28e8 100644 --- a/website/src/pages/messages/[id]/index.tsx +++ b/website/src/pages/messages/[id]/index.tsx @@ -1,5 +1,6 @@ import { Box, Text, useColorModeValue } from "@chakra-ui/react"; import Head from "next/head"; +import { useTranslation } from "next-i18next"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { getDashboardLayout } from "src/components/Layout"; import { MessageLoading } from "src/components/Loading/MessageLoading"; @@ -10,6 +11,7 @@ import { Message } from "src/types/Conversation"; import useSWRImmutable from "swr/immutable"; const MessageDetail = ({ id }: { id: string }) => { + const { t } = useTranslation(["message", "common"]); const backgroundColor = useColorModeValue("white", "gray.800"); const { isLoading: isLoadingParent, data: parent } = useSWRImmutable(`/api/messages/${id}/parent`, get); @@ -20,7 +22,7 @@ const MessageDetail = ({ id }: { id: string }) => { return ( <> - Open Assistant + {t("common:title")} { <> - Parent + {t("parent")} @@ -54,7 +56,7 @@ MessageDetail.getLayout = (page) => getDashboardLayout(page); export const getServerSideProps = async ({ locale, query }) => ({ props: { id: query.id, - ...(await serverSideTranslations(locale, ["common"])), + ...(await serverSideTranslations(locale, ["common", "message"])), }, });