浏览代码

feat(i18n): 新增产品系列标题的多语言支持

本次提交主要进行了以下修改:
1. 在 `i18n/locales` 目录下的多语言文件中新增了 `seriesTitle` 的翻译,分别为英文、日文和中文,确保多语言环境下的系列标题显示一致。
2. 在 `pages/products/[id].vue` 中更新了产品展示逻辑,支持显示产品的系列信息,提升了用户体验。

这些改动旨在增强产品页面的可用性和多语言支持的完整性。
master
lizhuang 3 个月前
父节点
当前提交
e736fc1046
共有 4 个文件被更改,包括 22 次插入1 次删除
  1. 1
    0
      i18n/locales/en.ts
  2. 1
    0
      i18n/locales/ja.ts
  3. 1
    0
      i18n/locales/zh.ts
  4. 19
    1
      pages/products/[id].vue

+ 1
- 0
i18n/locales/en.ts 查看文件

usageTitle: "Usage", usageTitle: "Usage",
capacitiesTitle: "Capacities", capacitiesTitle: "Capacities",
relatedProducts: "Related Products", relatedProducts: "Related Products",
seriesTitle: "Series",
}, },
faq: { faq: {
title: "Frequently Asked Questions", title: "Frequently Asked Questions",

+ 1
- 0
i18n/locales/ja.ts 查看文件

usageTitle: "用途", usageTitle: "用途",
capacitiesTitle: "容量", capacitiesTitle: "容量",
relatedProducts: "関連製品", relatedProducts: "関連製品",
seriesTitle: "系列",
}, },
faq: { faq: {
title: "よくある質問", title: "よくある質問",

+ 1
- 0
i18n/locales/zh.ts 查看文件

usageTitle: "用途", usageTitle: "用途",
capacitiesTitle: "容量", capacitiesTitle: "容量",
relatedProducts: "相关产品", relatedProducts: "相关产品",
seriesTitle: "系列",
}, },
faq: { faq: {
title: "常见问题", title: "常见问题",

+ 19
- 1
pages/products/[id].vue 查看文件

<span class="text-[#71717A]">{{ <span class="text-[#71717A]">{{
t("products.categoryTitle") t("products.categoryTitle")
}}</span> }}</span>
<span class="text-white font-medium"
>{{ product.category
}}<template v-if="product.tag"> / {{
product.tag
}}</template></span
>
</div>
<div
v-if="product.tag"
class="flex justify-between items-center py-2 border-b border-zinc-800"
>
<span class="text-[#71717A]">{{
t("products.seriesTitle")
}}</span>
<span class="text-white font-medium">{{ <span class="text-white font-medium">{{
product.category
product.series?.join(" / ")
}}</span> }}</span>
</div> </div>
<div <div
gallery: string[]; gallery: string[];
body: string; body: string;
content?: any; content?: any;
tag?: string;
series?: string[];
meta?: { meta?: {
series?: string[]; series?: string[];
name?: string; name?: string;
gallery: Array.isArray(meta.gallery) ? meta.gallery : [], gallery: Array.isArray(meta.gallery) ? meta.gallery : [],
body: productContent.value.body || "", body: productContent.value.body || "",
content: productContent.value, content: productContent.value,
tag: meta.tag || "",
series: Array.isArray(meta.series) ? meta.series : [],
meta: { meta: {
series: Array.isArray(meta.series) ? meta.series : [], series: Array.isArray(meta.series) ? meta.series : [],
name: String(meta.name || ""), name: String(meta.name || ""),

正在加载...
取消
保存