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 Scan2>", - "mint stored": "This post has been minted to NFT by you, view it on <2>xChar2> or <6>Crossbell Scan6>" + "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-chain1> and <3>open-source3> 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>文章与页面2>。", + "pages description": "页面是静态的,不受日期影响。它们更像是你网站上的永久元素,比如“关于我们”、“联系我们”等。<2>文章与页面2>。", + "pages add": "创建页面后,你可以将其<2>添加到你网站的导航菜单中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>这里2>的说明查找你的 Measurement ID。", + "Save": "保存", + "Tips": "提示", + "social tips": { + "p1": "这些社交平台将显示在你的 xLog 的右下角。", + "p2": "我们支持<2>这些平台2>,自动显示其标志和链接。对于其他平台,将显示默认标志。如果你有其他需求,请随时向我们提交问题或PR,以支持更多的平台。", + "p3": "你还可以在 <2>xSync2> 上连接到 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 ? ( <>
-
-
- After you create a page, you can{" "}
-