mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-29 16:30:24 +08:00
Merge pull request #973 from rjmacarthy/fix/locales-messages
website: Fix locale issue on messages/id page
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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<Message>(`/api/messages/${id}/parent`, get);
|
||||
@@ -20,7 +22,7 @@ const MessageDetail = ({ id }: { id: string }) => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Open Assistant</title>
|
||||
<title>{t("common:title")}</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world."
|
||||
@@ -32,7 +34,7 @@ const MessageDetail = ({ id }: { id: string }) => {
|
||||
<>
|
||||
<Box pb="4">
|
||||
<Text fontWeight="bold" fontSize="xl" pb="2">
|
||||
Parent
|
||||
{t("parent")}
|
||||
</Text>
|
||||
<Box bg={backgroundColor} padding="4" borderRadius="xl" boxShadow="base" width="fit-content">
|
||||
<MessageTableEntry enabled message={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"])),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user