diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 62364975..34fbe517 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,7 +1,5 @@ { - "intlRelativeTime": "{{val, relativetime}}", + "intlDateTime": "{{val, datetime}}", "ago": "{{time}} ago", - "joined ago": "Joined {{time}} ago", - "like stored": "Your like has been stored on the blockchain, view it on <2>Crossbell Scan", - "mint stored": "This post has been minted to NFT by you, view it on <2>xChar or <6>Crossbell Scan" + "joined ago": "Joined {{time}} ago" } \ No newline at end of file diff --git a/public/locales/en/dashboard.json b/public/locales/en/dashboard.json index 9e26dfee..e13ef4d1 100644 --- a/public/locales/en/dashboard.json +++ b/public/locales/en/dashboard.json @@ -1 +1,3 @@ -{} \ No newline at end of file +{ + "link post-vs-page" : "https://wordpress.com/zh-cn/support/post-vs-page/" +} \ No newline at end of file diff --git a/public/locales/en/index.json b/public/locales/en/index.json index 8b9a530e..9e26dfee 100644 --- a/public/locales/en/index.json +++ b/public/locales/en/index.json @@ -1,5 +1 @@ -{ - "description": "xLog, <1>on-chain and <3>open-source blogging platform for everyone.", - "discover awesome": "Discover these awesome teams and geeks on xLog (sorted by update time)", - "Integration description": "xLog's open design allows it to integrate with many other open protocols and applications without friction." -} \ No newline at end of file +{} \ No newline at end of file diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index e3616379..5d645272 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -5,7 +5,7 @@ "Followings": "正在关注", "Follow": "关注", "Unfollow": "取消关注", - "intlRelativeTime": "{{val, relativetime}}", + "intlDateTime": "{{val, datetime}}", "post": "文章", "posts": "文章", "page": "页面", diff --git a/public/locales/zh/dashboard.json b/public/locales/zh/dashboard.json index 0eb141d7..da9d3a6d 100644 --- a/public/locales/zh/dashboard.json +++ b/public/locales/zh/dashboard.json @@ -3,6 +3,7 @@ "Posts": "文章", "Pages": "页面", "Notifications": "通知", + "Unread notifications": "未读通知", "Settings": "设置", "Site Stats": "站点统计", "Total Posts": "文章总数", @@ -17,7 +18,104 @@ "All Posts": "所有文章", "All Pages": "所有页面", "Published": "已发布", + "published": "已发布", "Draft": "草稿", + "draft": "草稿", "Scheduled": "定时发布", - "Others on Crossbell": "Crossbell上的其他内容" + "scheduled": "定时发布", + "published and local modified": "已发布并本地修改", + "Others on Crossbell": "Crossbell上的其他内容", + "link post-vs-page" : "https://wordpress.com/zh-cn/support/post-vs-page/", + "posts description": "文章是按时间倒序在你的网站上列出的条目。可以将它们看作是更新,以提供新内容给读者。<2>文章与页面。", + "pages description": "页面是静态的,不受日期影响。它们更像是你网站上的永久元素,比如“关于我们”、“联系我们”等。<2>文章与页面。", + "pages add": "创建页面后,你可以将其<2>添加到你网站的导航菜单中,以便访问者可以找到它。", + "New Post": "新建文章", + "New Page": "新建页面", + "Import": "导入", + "Import markdown file with front matter supported": "导入 Markdown 文件(支持 Front Matter)", + "View Site": "查看站点", + "hello" : { + "welcome" : "

你好,

欢迎使用xLog!

以下是一些有用的链接,帮助你开始使用 xLog:

", + "community": "

加入我们的社区,认识新朋友或共同建设xLog:

" + }, + "Edit": "编辑", + "Convert to Page": "转换为页面", + "Convert to Post": "转换为文章", + "Delete": "删除", + "Heading": "标题", + "Bold": "粗体", + "Italic": "斜体", + "Strikethrough": "删除线", + "Underline": "下划线", + "Quote": "引用", + "Inline Code": "行内代码", + "Code Block": "代码块", + "Unordered List": "无序列表", + "Ordered List": "有序列表", + "Link": "链接", + "Image": "图片", + "Upload Image": "上传图片", + "Tip: xLog Flavored Markdown": "提示:xLog 风格的 Markdown", + "Preview": "预览", + "Publish": "发布", + "Update": "更新", + "Unpublish": "取消发布", + "Publish at": "发布时间", + "This post will be accessible from this time": "此文章将从此时间开始可访问", + "This page will be accessible from this time": "此页面将从此时间开始可访问", + "Post slug": "文章短链接", + "Page slug": "页面短链接", + "This post will be accessible at": "此文章将可通过以下链接访问", + "This page will be accessible at": "此页面将可通过以下链接访问", + "Tags": "标签", + "Separate multiple tags with English commas": "多个标签请用英文逗号分隔", + "Excerpt": "摘要", + "Leave it blank to use auto-generated excerpt": "留空则使用自动生成的摘要", + "General": "常规", + "Social Platforms": "社交平台", + "Navigation": "导航", + "Domains": "域名", + "Custom CSS": "自定义 CSS", + "Operators": "影子授权", + "Export data": "导出数据", + "Site Settings": "站点设置", + "Icon": "图标", + "Banner": "横幅", + "Supports both pictures and videos.": "支持图片和视频。", + "Name": "名称", + "Description": "描述", + "Integrate Google Analytics": "将 Google Analytics 集成到你的站点中。你可以按照<2>这里的说明查找你的 Measurement ID。", + "Save": "保存", + "Tips": "提示", + "social tips": { + "p1": "这些社交平台将显示在你的 xLog 的右下角。", + "p2": "我们支持<2>这些平台,自动显示其标志和链接。对于其他平台,将显示默认标志。如果你有其他需求,请随时向我们提交问题或PR,以支持更多的平台。", + "p3": "你还可以在 <2>xSync 上连接到 Twitter、Telegram 频道、Medium、Substack 等平台,并自动同步内容。当你在那里设置同步后,它也会显示在这里。" + }, + "Platform": "平台", + "Identity": "身份", + "Remove": "移除", + "New Item": "新建项目", + "xLog provides some out-of-the-box built-in pages": "xLog 提供了一些开箱即用的内置页面", + "Home page": "首页", + "Archives page": "归档页面", + "Tag page": "标签页面", + "NFT Showcase page": "NFT 展示页面", + "Label": "标签", + "URL": "链接", + "subdomain": "子域名", + "Custom Domain": "自定义域名", + "Set the following record on your DNS provider to active your custom domain": "在你的 DNS 提供商上设置以下记录以激活自定义域名", + "Scope: These styles will be applied to your entire blog, including this dashboard.": "范围:这些样式将应用于你的整个博客,包括这个仪表盘。", + "Support": "支持", + "CSS variables: xLog provides some built-in CSS variables": "CSS 变量:xLog 提供了一些内置的 CSS 变量", + "Address": "地址", + "Character": "角色", + "New operator": "新建授权", + "Operator Address": "授权地址", + "Operator Character Check": "授权角色检查", + "Warning": "警告", + "Operators have permissions to enter your dashboard, change your settings(excluding xLog subdomain) and post, modify, delete contents on your site.": + "影子授权可以进入你的仪表盘,更改你的设置(不包括 xLog 子域名)并在你的站点上发布、修改、删除内容。", + "Add": "添加" } \ No newline at end of file diff --git a/public/locales/zh/index.json b/public/locales/zh/index.json index 6ca27858..5fe906f7 100644 --- a/public/locales/zh/index.json +++ b/public/locales/zh/index.json @@ -17,10 +17,10 @@ "Customizable description": "使用自己的域名,自定义网站风格,完全自由地打造你的网站。这是你的网站,没有任何限制。", "Open": "开放", "Open description": "采用标准的 Markdown 语法,并提供了导入和导出工具以及丰富的API,让迁入和迁出变得轻而易举。所有的代码都开源在 GitHub 上,所有的数据都透明地存储在区块链上。", - "discover awesome": "在 xLog 上发现这些超棒的团队和极客们(按更新时间排序)", + "Discover these awesome teams and geeks on xLog (sorted by update time)": "在 xLog 上发现这些超棒的团队和极客们(按更新时间排序)", "Follow All!": "关注所有!", "Show more": "显示更多", "Submit yours": "提交你的", - "Integration description": "xLog 的开放式设计使其能够与许多其他开放协议和应用程序无缝集成,没有任何限制。", + "xLog's open design allows it to integrate with many other open protocols and applications without friction.": "xLog 的开放式设计使其能够与许多其他开放协议和应用程序无缝集成,没有任何限制。", "Dashboard": "仪表盘" } \ No newline at end of file diff --git a/src/components/dashboard/DashboardLayout.tsx b/src/components/dashboard/DashboardLayout.tsx index d734d821..1e4bb2e3 100644 --- a/src/components/dashboard/DashboardLayout.tsx +++ b/src/components/dashboard/DashboardLayout.tsx @@ -40,7 +40,7 @@ export function DashboardLayout({ const connectModal = useConnectModal() const [ready, setReady] = React.useState(false) const [hasPermission, setHasPermission] = React.useState(false) - const { t } = useTranslation(["common", "dashboard"]) + const { t } = useTranslation("dashboard") useEffect(() => { if (ssrReady) { @@ -169,9 +169,7 @@ export function DashboardLayout({ onClick={link.onClick} > - {isOpen && ( - {t(link.text, { ns: "dashboard" })} - )} + {isOpen && {t(link.text)}} ) })} @@ -185,7 +183,7 @@ export function DashboardLayout({ className="space-x-2 border rounded-lg bg-slate-100 border-slate-200 text-slate-500 hover:text-accent flex w-full h-12 items-center justify-center transition-colors" > - {isOpen && View Site} + {isOpen && {t("View Site")}} diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index dd77ccb1..e1778813 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -25,7 +25,7 @@ import { nanoid } from "nanoid" import { renderPageContent } from "~/markdown" import { Tooltip } from "../ui/Tooltip" import { APP_NAME } from "~/lib/env" -import { useTranslation } from "next-i18next" +import { Trans, useTranslation } from "next-i18next" export const PagesManager: React.FC<{ isPost: boolean @@ -45,12 +45,12 @@ export const PagesManager: React.FC<{ const createOrUpdatePage = useCreateOrUpdatePage() const [convertToastId, setConvertToastId] = useState("") const [deleteToastId, setDeleteToastId] = useState("") - const { t } = useTranslation(["common", "site", "dashboard"]) + const { t } = useTranslation(["dashboard", "site"]) const date = useDate() useEffect(() => { if (deletePage.isSuccess) { - toast.success(t("Deleted!", { ns: "dashboard" }), { + toast.success(t("Deleted!"), { id: deleteToastId, }) } @@ -58,11 +58,11 @@ export const PagesManager: React.FC<{ useEffect(() => { if (createOrUpdatePage.isSuccess) { - toast.success(t("Converted!", { ns: "dashboard" }), { + toast.success(t("Converted!"), { id: convertToastId, }) } else if (createOrUpdatePage.isError) { - toast.error(t("Failed to convert.", { ns: "dashboard" }), { + toast.error(t("Failed to convert."), { id: convertToastId, }) } @@ -290,39 +290,42 @@ export const PagesManager: React.FC<{ const description = isPost ? ( <>

- - Post vs. Page - - . Posts are entries listed in reverse chronological order on your site. - Think of them as articles or updates that you share to offer up new - content to your readers. + + Posts are entries listed in reverse chronological order on your site. + Think of them as articles or updates that you share to offer up new + content to your readers.{" "} + + Post vs. Page + +

) : ( <>

- - Post vs. Page - - . Pages are static and are not affected by date. Think of them as more - permanent fixtures of your site — an About page, and a Contact page are - great examples of this. + + Pages are static and are not affected by date. Think of them as more + permanent fixtures of your site — an About page, and a Contact page + are great examples of this.{" "} + + Post vs. Page + +

- After you create a page, you can{" "} - - add it to your site's navigation menu - {" "} - so your visitors can find it. + + After you create a page, you can{" "} + + add it to your site's navigation menu + {" "} + so your visitors can find it. +

) @@ -333,9 +336,7 @@ export const PagesManager: React.FC<{
-

- {t(title, { ns: "dashboard" })} -

+

{t(title)}

@@ -406,7 +407,7 @@ export const PagesManager: React.FC<{ )}
- {getPageVisibility(page).toLowerCase()} + {t(getPageVisibility(page))} · @@ -448,7 +449,7 @@ export const PagesManager: React.FC<{ {item.icon} - {item.text} + {t(item.text)} ) diff --git a/src/components/dashboard/PublishButton.tsx b/src/components/dashboard/PublishButton.tsx index cdc0d1a1..e6f71604 100644 --- a/src/components/dashboard/PublishButton.tsx +++ b/src/components/dashboard/PublishButton.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react" import useOnClickOutside from "use-onclickoutside" import { Button, ButtonGroup } from "../ui/Button" +import { useTranslation } from "next-i18next" export const PublishButton: React.FC<{ save: (published: boolean) => void @@ -12,6 +13,7 @@ export const PublishButton: React.FC<{ const [showDropdown, setShowDropdown] = useState(false) const dropdownRef = useRef(null) const triggerRef = useRef(null) + const { t } = useTranslation("dashboard") useOnClickOutside(dropdownRef, (e) => { if (triggerRef.current?.contains(e.target as any)) return @@ -34,7 +36,7 @@ export const PublishButton: React.FC<{ isLoading={isSaving} isDisabled={isDisabled} > - {published ? "Update" : "Publish"} + {t(published ? "Update" : "Publish")} {published && ( )}
diff --git a/src/components/dashboard/SettingsLayout.tsx b/src/components/dashboard/SettingsLayout.tsx index bd5f5059..81d8bdb7 100644 --- a/src/components/dashboard/SettingsLayout.tsx +++ b/src/components/dashboard/SettingsLayout.tsx @@ -3,6 +3,7 @@ import React from "react" import { type TabItem, Tabs } from "../ui/Tabs" import { DashboardMain } from "./DashboardMain" +import { useTranslation } from "next-i18next" export const SettingsLayout: React.FC<{ title: string @@ -10,6 +11,7 @@ export const SettingsLayout: React.FC<{ type: "site" | "account" }> = ({ title, children, type }) => { const router = useRouter() + const { t } = useTranslation("dashboard") const subdomain = router.query.subdomain as string const tabItems: TabItem[] = ( @@ -42,7 +44,7 @@ export const SettingsLayout: React.FC<{
-

{title}

+

{t(title)}

diff --git a/src/components/ui/EditorToolbar.tsx b/src/components/ui/EditorToolbar.tsx index c9017053..b605a40a 100644 --- a/src/components/ui/EditorToolbar.tsx +++ b/src/components/ui/EditorToolbar.tsx @@ -3,6 +3,7 @@ import clsx from "clsx" import { Dispatch, FC, SetStateAction } from "react" import { ICommand } from "~/editor" import { Tooltip } from "./Tooltip" +import { useTranslation } from "next-i18next" export interface EditorToolbarProps { view?: EditorView @@ -15,12 +16,13 @@ enum ToolbarMode { } export const EditorToolbar: FC = ({ view, toolbars }) => { + const { t } = useTranslation("dashboard") const renderToolbar = (mode: ToolbarMode) => // eslint-disable-next-line react/display-name ({ name, icon, label, execute }: ICommand) => { return ( - +
@@ -421,7 +422,7 @@ export default function SubdomainEditor() { : "text-green-600", )} > - {visibility?.toLowerCase()} + {t(visibility as string)}
@@ -517,7 +520,7 @@ export default function SubdomainEditor() { name="slug" value={values.slug} placeholder={defaultSlug} - label={`${isPost ? "Post" : "Page"} slug`} + label={t(`${isPost ? "Post" : "Page"} slug`) || ""} id="slug" isBlock onChange={(e: ChangeEvent) => @@ -527,8 +530,11 @@ export default function SubdomainEditor() { <> {(values.slug || defaultSlug) && ( <> - This {isPost ? "post" : "page"} will be accessible - at{" "} + {t( + `This ${ + isPost ? "post" : "page" + } will be accessible at`, + )}{" "} ) => updateValue("tags", e.target.value) } - help='Separate multiple tags with English commas ","' + help={ + t("Separate multiple tags with English commas") + ` ","` + } />
) => { updateValue("excerpt", e.target.value) }} - help="Leave it blank to use auto-generated excerpt" + help={t("Leave it blank to use auto-generated excerpt")} />
diff --git a/src/pages/dashboard/[subdomain]/index.tsx b/src/pages/dashboard/[subdomain]/index.tsx index 35e3f63b..ba612e57 100644 --- a/src/pages/dashboard/[subdomain]/index.tsx +++ b/src/pages/dashboard/[subdomain]/index.tsx @@ -8,7 +8,7 @@ import { getSiteLink } from "~/lib/helpers" import type { ReactElement } from "react" import { useGetSite, useGetStat } from "~/queries/site" import { useDate } from "~/hooks/useDate" -import { useTranslation } from "next-i18next" +import { useTranslation, Trans } from "next-i18next" import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server" import { GetServerSideProps } from "next" import { serverSidePropsHandler } from "~/lib/server-side-props" @@ -81,9 +81,14 @@ export default function SubdomainIndex() {
))}
-

Hello there,

-

Welcome to use {APP_NAME}!

-

Here{`'`}re some useful links to get started:

+ , + }} + ns="dashboard" + />
  • @@ -115,7 +120,14 @@ export default function SubdomainIndex() { via RSS Reader
-

Join the community to meet friends or build {APP_NAME} together:

+ , + }} + ns="dashboard" + />
  • diff --git a/src/pages/dashboard/[subdomain]/settings/css.tsx b/src/pages/dashboard/[subdomain]/settings/css.tsx index 16e71723..4d4ec215 100644 --- a/src/pages/dashboard/[subdomain]/settings/css.tsx +++ b/src/pages/dashboard/[subdomain]/settings/css.tsx @@ -31,6 +31,7 @@ export default function SettingsCSSPage() { const updateSite = useUpdateSite() const site = useGetSite(subdomain) + const { t } = useTranslation("dashboard") const [css, setCss] = useState("") const handleSubmit = (e: any) => { @@ -66,38 +67,39 @@ export default function SettingsCSSPage() {
    -

    Scope

    +

    {t("Tips")}:

    - These styles will be applied to your entire blog, including this - dashboard. + {t( + "Scope: These styles will be applied to your entire blog, including this dashboard.", + )}

    - Support ipfs:// -

    -

    - Tips: you can override the built-in CSS variables + {t("Support")} ipfs://

    + {t("CSS variables: xLog provides some built-in CSS variables")} +

    +

    --theme-color: #4f46e5;

    -

    +

    --theme-color-emphasis: #4338ca;

    -

    +

    --header-height: auto;

    -

    +

    --banner-bg-color: #000;

    -

    +

    --font-fans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, @@ -108,7 +110,7 @@ export default function SettingsCSSPage() {

    - +
    diff --git a/src/pages/dashboard/[subdomain]/settings/domains.tsx b/src/pages/dashboard/[subdomain]/settings/domains.tsx index e2fdb192..1c363a83 100644 --- a/src/pages/dashboard/[subdomain]/settings/domains.tsx +++ b/src/pages/dashboard/[subdomain]/settings/domains.tsx @@ -37,6 +37,7 @@ export default function SettingsDomainsPage() { const updateSite = useUpdateSite() const site = useGetSite(subdomain) const userRole = useUserRole(subdomain) + const { t } = useTranslation("dashboard") const isEmailAccount = useAccountState( (s) => s.computed.account?.type === "email", @@ -98,7 +99,7 @@ export default function SettingsDomainsPage() {
    {customDomain && (

    - Set the following record on your DNS provider to active your - custom domain: + {t( + "Set the following record on your DNS provider to active your custom domain", + )} + :

    @@ -175,7 +178,7 @@ export default function SettingsDomainsPage() {
    diff --git a/src/pages/dashboard/[subdomain]/settings/general.tsx b/src/pages/dashboard/[subdomain]/settings/general.tsx index 3835f89d..97e2669e 100644 --- a/src/pages/dashboard/[subdomain]/settings/general.tsx +++ b/src/pages/dashboard/[subdomain]/settings/general.tsx @@ -11,7 +11,7 @@ import { UniLink } from "~/components/ui/UniLink" import { ImageUploader } from "~/components/ui/ImageUploader" import { toIPFS } from "~/lib/ipfs-parser" import type { ReactElement } from "react" -import { useTranslation } from "next-i18next" +import { useTranslation, Trans } from "next-i18next" import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server" import { GetServerSideProps } from "next" import { serverSidePropsHandler } from "~/lib/server-side-props" @@ -35,6 +35,7 @@ export default function SiteSettingsGeneralPage() { const updateSite = useUpdateSite() const site = useGetSite(subdomain) + const { t } = useTranslation("dashboard") const form = useForm({ defaultValues: { @@ -107,7 +108,7 @@ export default function SiteSettingsGeneralPage() {
    - Supports both pictures and videos. + {t("Supports both pictures and videos.")}
    - +
    - Integrate Google Analytics into your site. You can follow the - instructions{" "} - - here - {" "} - to find your Measurement ID. + + Integrate Google Analytics into your site. You can follow the + instructions{" "} + + here + {" "} + to find your Measurement ID. +

    } /> @@ -201,7 +209,7 @@ export default function SiteSettingsGeneralPage() { isLoading={updateSite.isLoading} isDisabled={iconUploading || bannerUploading} > - Save + {t("Save")}
    diff --git a/src/pages/dashboard/[subdomain]/settings/navigation.tsx b/src/pages/dashboard/[subdomain]/settings/navigation.tsx index d9425f40..3de6dbdd 100644 --- a/src/pages/dashboard/[subdomain]/settings/navigation.tsx +++ b/src/pages/dashboard/[subdomain]/settings/navigation.tsx @@ -37,6 +37,7 @@ const SortableNavigationItem: React.FC<{ updateItem: UpdateItem removeItem: RemoveItem }> = ({ item, updateItem, removeItem }) => { + const { t } = useTranslation("dashboard") return (
    @@ -53,7 +54,7 @@ const SortableNavigationItem: React.FC<{
    @@ -89,6 +90,7 @@ export default function SiteSettingsNavigationPage() { const updateSite = useUpdateSite() const site = useGetSite(subdomain) + const { t } = useTranslation("dashboard") const [items, setItems] = useState([]) @@ -147,23 +149,26 @@ export default function SiteSettingsNavigationPage() { return (
    -

    Tips: built-in pages

    +

    {t("Tips")}:

    - - Home page (use your own Label to replace the default Label): - {" "} + + {t("xLog provides some out-of-the-box built-in pages")}: + +

    +

    + - {t("Home page")}:{" "} /

    - Archives page:{" "} + - {t("Archives page")}:{" "} /archives

    - Tag page:{" "} + - {t("Tag page")}:{" "} /tag/[tag]

    - NFT Showcase page:{" "} + - {t("NFT Showcase page")}:{" "} /nft

    @@ -198,10 +203,10 @@ export default function SiteSettingsNavigationPage() { isLoading={updateSite.isLoading} isDisabled={!itemsModified} > - Save + {t("Save")}
    diff --git a/src/pages/dashboard/[subdomain]/settings/operator.tsx b/src/pages/dashboard/[subdomain]/settings/operator.tsx index ccc2dab9..570583ff 100644 --- a/src/pages/dashboard/[subdomain]/settings/operator.tsx +++ b/src/pages/dashboard/[subdomain]/settings/operator.tsx @@ -43,11 +43,14 @@ const SortableNavigationItem: React.FC<{ isLoading: boolean disabled?: boolean }> = ({ item, removeItem, isLoading, disabled }) => { + const { t } = useTranslation("dashboard") return (
    -
    Address: {item}
    -
    Character:
    +
    + {t("Address")}: {item} +
    +
    {t("Character")}:
    - Remove + {t("Remove")}
    @@ -85,6 +88,7 @@ export default function SettingsOperatorPage() { ) const upgradeAccountModal = useUpgradeAccountModal() const userRole = useUserRole(subdomain) + const { t } = useTranslation("dashboard") const [items, setItems] = useState([]) @@ -144,19 +148,21 @@ export default function SettingsOperatorPage() {
    - New operator + {t("New operator")}
    { setAddress(e.target.value) }} /> -
    Operator Character Check
    +
    + {t("Operator Character Check")} +
    - Save + {t("Save")}
    -

    ⚠️ Warning:

    +

    ⚠️ {t("Warning")}:

    {isEmailAccount && ( @@ -214,9 +220,9 @@ export default function SettingsOperatorPage() { )} {!isEmailAccount && userRole.data !== "operator" && ( - Operators have permissions to enter your dashboard, change your - settings(excluding xLog subdomain) and post contents on your - site. + {t( + "Operators have permissions to enter your dashboard, change your settings(excluding xLog subdomain) and post, modify, delete contents on your site.", + )} )} @@ -257,7 +263,7 @@ export default function SettingsOperatorPage() { onClick={newEmptyItem} isDisabled={isEmailAccount || userRole.data === "operator"} > - Add + {t("Add")}

    diff --git a/src/pages/dashboard/[subdomain]/settings/social-platforms.tsx b/src/pages/dashboard/[subdomain]/settings/social-platforms.tsx index 5c2289ea..4fa6468b 100644 --- a/src/pages/dashboard/[subdomain]/settings/social-platforms.tsx +++ b/src/pages/dashboard/[subdomain]/settings/social-platforms.tsx @@ -13,7 +13,7 @@ import { useGetSite, useUpdateSite } from "~/queries/site" import type { ReactElement } from "react" import { UniLink } from "~/components/ui/UniLink" import { Platform } from "~/components/site/Platform" -import { useTranslation } from "next-i18next" +import { useTranslation, Trans } from "next-i18next" import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server" import { GetServerSideProps } from "next" import { serverSidePropsHandler } from "~/lib/server-side-props" @@ -43,6 +43,7 @@ const SortableNavigationItem: React.FC<{ updateItem: UpdateItem removeItem: RemoveItem }> = ({ item, updateItem, removeItem }) => { + const { t } = useTranslation("dashboard") return (
    @@ -59,7 +60,7 @@ const SortableNavigationItem: React.FC<{
    @@ -96,6 +97,7 @@ export default function SiteSettingsNavigationPage() { const updateSite = useUpdateSite() const site = useGetSite(subdomain) + const { t } = useTranslation("dashboard") const [items, setItems] = useState([]) @@ -162,35 +164,36 @@ export default function SiteSettingsNavigationPage() { return (
    -

    Tips:

    +

    {t("Tips")}:

    +

    + {t("social tips.p1")} +

    - These social platforms will be displayed in the bottom right hand - corner of your xLog. + + We support{" "} + + these platforms + {" "} + with automatic display of logos and links, other platforms will + display a default logo. Please feel free to submit an issue or pr + to us to support more platforms. +

    - We support{" "} - - these platforms - {" "} - with automatic display of logos and links, other platforms will - display a default logo. Please feel free to submit an issue or pr to - us to support more platforms. - -

    -

    - - You can also connect to Twitter, Telegram Channel, Medium, Substack - and more and automatically sync content on{" "} - - xSync - - . When you have set up the sync there, it will also show here. + + You can also connect to Twitter, Telegram Channel, Medium, + Substack and more and automatically sync content on{" "} + + xSync + + . When you have set up the sync there, it will also show here. +

    @@ -225,10 +228,10 @@ export default function SiteSettingsNavigationPage() { isLoading={updateSite.isLoading} isDisabled={!itemsModified} > - Save + {t("Save")} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index faf10d2b..fe043629 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -315,7 +315,11 @@ export default function Home() {
    {t("Showcase")}
    -

    {t("discover awesome")}

    +

    + {t( + "Discover these awesome teams and geeks on xLog (sorted by update time)", + )} +