瀏覽代碼

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

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

这些改动旨在增强产品页面的可用性和多语言支持的完整性。
master
lizhuang 1 月之前
父節點
當前提交
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 查看文件

@@ -153,6 +153,7 @@ export default {
usageTitle: "Usage",
capacitiesTitle: "Capacities",
relatedProducts: "Related Products",
seriesTitle: "Series",
},
faq: {
title: "Frequently Asked Questions",

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

@@ -144,6 +144,7 @@ export default {
usageTitle: "用途",
capacitiesTitle: "容量",
relatedProducts: "関連製品",
seriesTitle: "系列",
},
faq: {
title: "よくある質問",

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

@@ -142,6 +142,7 @@ export default {
usageTitle: "用途",
capacitiesTitle: "容量",
relatedProducts: "相关产品",
seriesTitle: "系列",
},
faq: {
title: "常见问题",

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

@@ -295,8 +295,22 @@
<span class="text-[#71717A]">{{
t("products.categoryTitle")
}}</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">{{
product.category
product.series?.join(" / ")
}}</span>
</div>
<div
@@ -453,6 +467,8 @@ interface Product {
gallery: string[];
body: string;
content?: any;
tag?: string;
series?: string[];
meta?: {
series?: string[];
name?: string;
@@ -533,6 +549,8 @@ const product = computed<Product | null>(() => {
gallery: Array.isArray(meta.gallery) ? meta.gallery : [],
body: productContent.value.body || "",
content: productContent.value,
tag: meta.tag || "",
series: Array.isArray(meta.series) ? meta.series : [],
meta: {
series: Array.isArray(meta.series) ? meta.series : [],
name: String(meta.name || ""),

Loading…
取消
儲存