@@ -195,11 +196,9 @@
stroke-width="4"
/>
- 城市公园
- 滨江绿道
-
- 梧桐路
-
+ {t("城市公园")}
+ {t("滨江绿道")}
+ {t("梧桐路")}
@@ -221,13 +220,13 @@
/>
- 前方 300 米右转,驶入新的旅程
+ {t("前方 300 米")}{t("右转,驶入新的旅程")}
YOUR EVERYDAY SOUNDTRACK
-
让喜欢的音乐,
陪你多走一程。
-
- 在 CarPlay 中使用你的音乐 App。
默认由 Android
- 输出音频,也可切换到浏览器。
-
+
{t("让喜欢的音乐,")}
{t("陪你多走一程。")}
+
{t("在 CarPlay 中使用你的音乐 App。")}
{t("默认由 Android 输出音频,也可切换到浏览器。")}
- On the road示意歌单 · 不播放音频
+ On the road{t("示意歌单 · 不播放音频")}
@@ -301,24 +297,22 @@
/>
-
第一次配对,
下一次更从容。
-
- 用 WheelPlay 扫描车机网页二维码,
或在车机输入配对码。确认后,启动显示。
-
+
{t("第一次配对,")}
{t("下一次更从容。")}
+
{t("用 WheelPlay 扫描车机网页二维码,")}
{t("或在车机输入配对码。确认后,启动显示。")}
123456
{t("示例配对码 · 已记住的浏览器可恢复配对")}
-
浏览器显示与触控{t("浏览器显示与触控")}
NAVIGATION / PREVIEW
@@ -336,10 +330,7 @@
aria-hidden="true"
>
- 上方为交互示意,并非真实 CarPlay 截图或在线连接入口;实际界面由 iPhone
- 与所用 App 决定。
-
+ >{t("上方为交互示意,并非真实 CarPlay 截图或在线连接入口;实际界面由 iPhone 与所用 App 决定。")}
diff --git a/website/src/layouts/DocsLayout.astro b/website/src/layouts/DocsLayout.astro
index 2fb7e8a..9c5769d 100644
--- a/website/src/layouts/DocsLayout.astro
+++ b/website/src/layouts/DocsLayout.astro
@@ -4,6 +4,8 @@ import BaseLayout from "./BaseLayout.astro";
import SiteHeader from "../components/SiteHeader.astro";
import SiteFooter from "../components/SiteFooter.astro";
import "../styles/docs.css";
+import { useTranslations } from "../i18n";
+const { t, local } = useTranslations(Astro.url.pathname);
type Props = MarkdownLayoutProps<{
title: string;
@@ -13,8 +15,8 @@ type Props = MarkdownLayoutProps<{
const { frontmatter, headings } = Astro.props;
const sections = headings.filter(({ depth }) => depth === 2);
const pages = [
- { href: "/docs/", label: "使用指南" },
- { href: "/docs/faq/", label: "常见问题" },
+ { href: local("/docs/"), label: t("使用指南") },
+ { href: local("/docs/faq/"), label: t("常见问题") },
];
const currentPath = Astro.url.pathname.replace(/\/$/, "");
---
@@ -24,19 +26,19 @@ const currentPath = Astro.url.pathname.replace(/\/$/, "");
description={frontmatter.description}
socialDescription={frontmatter.description}
>
-
跳到主要内容
+
{t("跳到主要内容")}