Translated help page

This commit is contained in:
Donkie
2023-12-18 21:52:22 +01:00
parent bd956412d8
commit 4dcb965b87
2 changed files with 62 additions and 49 deletions

View File

@@ -239,7 +239,26 @@
"home": "Home" "home": "Home"
}, },
"help": { "help": {
"help": "Help" "help": "Help",
"resources": {
"filament": "Brands of filament. They have properties such as name, material, color, diameter, and more.",
"spool": "Individual physical spools of a specific filament.",
"vendor": "The companies that make the filament."
},
"description": [
"<title>Help</title>",
"<p>Here are some tips to get you started.</p>",
"<p>Spoolman holds 3 different types of data:</p><itemsHelp/>",
"<p>To enter a new spool into the database, you first need to create a <filamentCreateLink>Filament</filamentCreateLink>",
"object for it. Once that is done, you can then create a <spoolCreateLink>Spool</spoolCreateLink> object for that",
"individual spool. If you then purchase additional spools of the same filament, you can just create additional",
"Spool objects, and re-use the same Filament object.</p>",
"<p>You can optionally also create a <vendorCreateLink>Vendor</vendorCreateLink> object for the company that makes the",
"filament, if you want to track that information.</p>",
"<p>You can connect other 3D printer services to Spoolman, such as Moonraker, which can then automatically track",
"filament usage and update the Spool objects for you. See the <readmeLink>Spoolman README</readmeLink>",
"for how to do that.</p>"
]
}, },
"table": { "table": {
"actions": "Actions" "actions": "Actions"

View File

@@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { IResourceComponentsProps } from "@refinedev/core"; import { IResourceComponentsProps, useTranslate } from "@refinedev/core";
import dayjs from "dayjs"; import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"; import utc from "dayjs/plugin/utc";
import { Content } from "antd/es/layout/layout"; import { Content } from "antd/es/layout/layout";
@@ -7,6 +7,7 @@ import { List, theme } from "antd";
import Title from "antd/es/typography/Title"; import Title from "antd/es/typography/Title";
import { FileOutlined, HighlightOutlined, UserOutlined } from "@ant-design/icons"; import { FileOutlined, HighlightOutlined, UserOutlined } from "@ant-design/icons";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { Trans } from "react-i18next";
dayjs.extend(utc); dayjs.extend(utc);
@@ -14,7 +15,7 @@ const { useToken } = theme;
export const Help: React.FC<IResourceComponentsProps> = () => { export const Help: React.FC<IResourceComponentsProps> = () => {
const { token } = useToken(); const { token } = useToken();
// const t = useTranslate(); const t = useTranslate();
return ( return (
<Content <Content
@@ -31,53 +32,46 @@ export const Help: React.FC<IResourceComponentsProps> = () => {
lineHeight: 1.5, lineHeight: 1.5,
}} }}
> >
<Title>Help</Title> <Trans
<p>Here are some tips to get you started.</p> i18nKey={"help.description"}
<p>Spoolman holds 3 different types of data:</p> tOptions={{ joinArrays: "\n" }}
<List components={{
itemLayout="horizontal" p: <p />,
size="large" title: <Title />,
dataSource={[ filamentCreateLink: <Link to="/filament/create" />,
{ spoolCreateLink: <Link to="/spool/create" />,
title: "Filaments", vendorCreateLink: <Link to="/vendor/create" />,
description: "Brands of filament. They have properties such as name, material, color, diameter, and more.", readmeLink: <Link to="https://github.com/Donkie/Spoolman#integration-status" target="_blank" />,
icon: <HighlightOutlined />, itemsHelp: (
}, <List
{ itemLayout="horizontal"
title: "Spools", size="large"
description: "Individual physical spools of a specific filament.", dataSource={[
icon: <FileOutlined />, {
}, title: t("filament.filament"),
{ description: t("help.resources.filament"),
title: "Vendors", icon: <HighlightOutlined />,
description: "The companies that make the filament.", },
icon: <UserOutlined />, {
}, title: t("spool.spool"),
]} description: t("help.resources.spool"),
renderItem={(item) => ( icon: <FileOutlined />,
<List.Item> },
<List.Item.Meta avatar={item.icon} title={item.title} description={item.description} /> {
</List.Item> title: t("vendor.vendor"),
)} description: t("help.resources.vendor"),
icon: <UserOutlined />,
},
]}
renderItem={(item) => (
<List.Item>
<List.Item.Meta avatar={item.icon} title={item.title} description={item.description} />
</List.Item>
)}
/>
),
}}
/> />
<p>
To enter a new spool into the database, you first need to create a <Link to="/filament/create">Filament</Link>{" "}
object for it. Once that is done, you can then create a <Link to="/spool/create">Spool</Link> object for that
individual spool. If you then purchase additional spools of the same filament, you can just create additional
Spool objects, and re-use the same Filament object.
</p>
<p>
You can optionally also create a <Link to="/vendor/create">Vendor</Link> object for the company that makes the
filament, if you want to track that information.
</p>
<p>
You can connect other 3D printer services to Spoolman, such as Moonraker, which can then automatically track
filament usage and update the Spool objects for you. See the{" "}
<a href="https://github.com/Donkie/Spoolman#integration-status" target="_blank">
Spoolman README
</a>{" "}
for how to do that.
</p>
</Content> </Content>
); );
}; };