feat: 补全i18n适配 #57

Manually merged
remilia merged 8 commits from feat/i18n into master 2025-11-04 14:37:27 +08:00
14 changed files with 130 additions and 45 deletions

View File

@ -8,15 +8,17 @@
</template>
<dl class="text-gray-600 space-y-1 mb-6">
<div>
<dt class="font-semibold inline">类型</dt>
<dt class="font-semibold inline">{{ $t('document-meta.type') }}</dt>
<dd class="inline">{{ file.type }}</dd>
</div>
<div>
<dt class="font-semibold inline">大小</dt>
<dt class="font-semibold inline">{{ $t('document-meta.size') }}</dt>
<dd class="inline">{{ formatFileSize(file.filesize) }}</dd>
</div>
<div>
<dt class="font-semibold inline">上传时间</dt>
<dt class="font-semibold inline">
{{ $t('document-meta.upload-at') }}
</dt>
<dd class="inline">
{{ new Date(file.uploaded_on).toLocaleDateString() }}
</dd>
@ -24,10 +26,12 @@
</dl>
<template #footer>
<div class="button-group">
<el-button type="primary" @click="handleDownload">下载</el-button>
<el-button v-if="file.previewable" @click="handlePreview"
>预览</el-button
>
<el-button type="primary" @click="handleDownload">{{
$t('document-action.download')
}}</el-button>
<el-button v-if="file.previewable" @click="handlePreview">{{
$t('document-action.preview')
}}</el-button>
</div>
</template>
</el-card>

View File

@ -1,8 +1,8 @@
<template>
<section class="homepage-section">
<h2>推荐产品</h2>
<h2>{{ $t('homepage.recommended-products') }}</h2>
<p>
探索我们的精选产品满足您的各种需求无论是创新技术还是经典设计我们都为您提供优质选择
{{ $t('homepage.recommended-products-desc') }}
</p>
<div v-if="!pending">
<el-carousel

View File

@ -1,7 +1,7 @@
<template>
<section class="homepage-section">
<h2>推荐解决方案</h2>
<p>了解我们的定制解决方案帮助您优化业务流程提高效率</p>
<h2>{{ $t('homepage.recommended-solutions') }}</h2>
<p>{{ $t('homepage.recommended-solutions-desc') }}</p>
<div v-if="!pending">
<el-carousel
class="recommend-carousel"

View File

@ -20,7 +20,7 @@
<el-row>
<NuxtLink class="card-link" :to="to">
<el-button class="card-button" round>
<span>了解更多 > </span>
<span>{{ $t('learn-more') }} > </span>
</el-button>
</NuxtLink>
</el-row>

View File

@ -21,10 +21,10 @@
const activeTab = ref(props.modelValue || '');
const options = [
{ label: '服务支持', value: '' },
{ label: '常见问题', value: 'faq' },
{ label: '文档资料', value: 'documents' },
{ label: '联系售后', value: 'contact-us' },
{ label: $t('navigation.support'), value: '' },
{ label: $t('navigation.faq'), value: 'faq' },
{ label: $t('navigation.documents'), value: 'documents' },
{ label: $t('navigation.contact-info'), value: 'contact-us' },
];
const handleSegmentedChange = (value: string) => {

View File

@ -10,10 +10,10 @@
<h3>{{ doc.title }}</h3>
<div class="document-content">
<span v-if="doc.size" class="document-meta"
>大小: {{ formatFileSize(doc.size) }}
>{{ $t('document-meta.size') }}: {{ formatFileSize(doc.size) }}
</span>
<span v-if="doc.filename" class="document-meta"
>格式:
>{{ $t('document-meta.format') }}:
{{ formatFileExtension(getFileExtension(doc.filename)) }}</span
>
</div>

View File

@ -21,7 +21,7 @@
:disabled="!fileMeta"
@click="openInNewTab"
>
在新标签打开
{{ $t('document-action.open-in-new-tab') }}
</button>
<button
class="px-3 py-1.5 rounded bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50"
@ -29,7 +29,7 @@
:disabled="!fileMeta"
@click="download"
>
下载
{{ $t('document-action.download') }}
</button>
</div>
</header>
@ -37,7 +37,7 @@
<div class="flex-1 overflow-hidden">
<!-- 加载状态 -->
<div v-if="pending" class="h-48 grid place-items-center border rounded">
正在加载...
{{ $t('loading') }}
</div>
<div
v-else-if="errorText"

View File

@ -89,11 +89,11 @@
>
<template #header>
<div class="drawer-header">
<h1>菜单</h1>
<h1>{{ $t('mobile-menu.title') }}</h1>
</div>
</template>
<div>
<h2>站点导航</h2>
<h2>{{ $t('mobile-menu.navigation') }}</h2>
<el-menu
:default-active="activeName"
class="mobile-menu"
@ -118,7 +118,7 @@
</el-menu-item>
</el-menu>
<h2>实用工具</h2>
<h2>{{ $t('mobile-menu.utilities') }}</h2>
<el-menu
:default-active="activeName"
class="mobile-menu"

View File

@ -2,10 +2,12 @@
<div class="question-category">
<el-row class="hide-on-mobile" :gutter="12">
<el-col :span="8">
<span class="select-label">产品分类</span>
<span class="select-label">{{
$t('product-filter.product-type')
}}</span>
<el-select
v-model="model.selectedType"
placeholder="选择产品类型"
:placeholder="$t('product-filter.select-product-type')"
clearable
>
<el-option
@ -18,10 +20,12 @@
</el-col>
<el-col :span="8">
<span class="select-label">产品系列</span>
<span class="select-label">{{
$t('product-filter.product-model')
}}</span>
<el-select
v-model="model.selectedProduct"
placeholder="选择系列产品"
:placeholder="$t('product-filter.select-product-model')"
clearable
>
<el-option
@ -34,10 +38,10 @@
</el-col>
<el-col :span="8">
<span class="select-label">关键词</span>
<span class="select-label">{{ $t('product-filter.keyword') }}</span>
<el-input
v-model="model.keyword"
placeholder="输入关键词..."
:placeholder="$t('product-filter.enter-keyword')"
clearable
:prefix-icon="Search"
/>
@ -45,10 +49,12 @@
</el-row>
<el-row class="display-on-mobile" :gutter="12">
<el-col :span="12">
<span class="select-label">产品分类</span>
<span class="select-label">{{
$t('product-filter.product-type')
}}</span>
<el-select
v-model="model.selectedType"
placeholder="选择产品类型"
:placeholder="$t('product-filter.select-product-type')"
clearable
>
<el-option
@ -61,10 +67,12 @@
</el-col>
<el-col :span="12">
<span class="select-label">产品系列</span>
<span class="select-label">{{
$t('product-filter.product-model')
}}</span>
<el-select
v-model="model.selectedProduct"
placeholder="选择系列产品"
:placeholder="$t('product-filter.select-product-model')"
clearable
>
<el-option
@ -77,10 +85,10 @@
</el-col>
</el-row>
<el-row class="display-on-mobile">
<span class="select-label">关键词</span>
<span class="select-label">{{ $t('product-filter.keyword') }}</span>
<el-input
v-model="model.keyword"
placeholder="输入关键词..."
:placeholder="$t('product-filter.enter-keyword')"
clearable
:prefix-icon="Search"
/>

View File

@ -7,7 +7,7 @@
<markdown-renderer :content="content.content || ''" />
</div>
<el-divider content-position="left">更多信息</el-divider>
<el-divider content-position="left">{{ $t('learn-more') }}</el-divider>
<div class="button-group">
<NuxtLink :to="$localePath('/support/contact-us')">
<el-card class="card-button">
@ -15,7 +15,7 @@
<ElIconService />
</el-icon>
<br />
联系信息
{{ $t('navigation.contact-info') }}
</el-card>
</NuxtLink>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div class="page-container">
<div class="page-header">
<h1 class="page-title">文件下载</h1>
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div v-if="!pending" class="page-content">

View File

@ -8,7 +8,7 @@
<div class="page-content">
<section style="margin-bottom: 2rem">
<p>
金申机械制造有限公司致力于为客户提供优质的产品与服务针对纸管机分纸机纸吸管等产品我们提供全方位的售后服务确保客户能够安心地使用我们的产品
{{ $t('support-page-desc') }}
</p>
</section>
<div class="card-group">
@ -35,19 +35,19 @@
const supportItems = [
{
title: $t('navigation.faq'),
description: '我们为用户整理了常见问题的答案,帮助您快速解决疑惑。',
description: $t('support-card-desc.faq'),
to: localePath('/support/faq'),
iconComponent: ElIconQuestionFilled,
},
{
title: $t('navigation.documents'),
description: '我们为用户整理了常见问题的答案,帮助您快速解决疑惑。',
description: $t('support-card-desc.documents'),
to: localePath('/support/documents'),
iconComponent: ElIconDocumentChecked,
},
{
title: $t('navigation.contact-info'),
description: '通过电话、邮箱联系我们,我们将现场为您服务。',
description: $t('support-card-desc.contact-info'),
to: localePath('/support/contact-us'),
iconComponent: ElIconService,
},

View File

@ -63,5 +63,42 @@
"loading": "Loading...",
"our-products": "Our Products",
"learn-our-solutions": "Learn Our Solutions",
"all": "All"
"all": "All",
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd is committed to providing high-quality products and services to our customers. For products such as paper tube machines, slitting machines, and paper straw equipment, we offer comprehensive after-sales support to ensure our customers can use our products with confidence.",
"support-card-desc": {
"faq": "We have compiled answers to frequently asked questions to help you quickly resolve any concerns.",
"documents": "We provide product manuals, technical specifications, and other documentation for easy reference.",
"contact-info": "Contact us by phone or email, and we will provide on-site support for you."
},
"product-filter": {
"product-type": "Product type",
"product-model": "Product model",
"keyword": "Keyword",
"select-product-type": "Select product type",
"select-product-model": "Select product model",
"enter-keyword": "Enter keyword"
},
"document-meta": {
"size": "Size",
"format": "Format",
"type": "Type",
"upload-at": "Upload at"
},
"document-action": {
"download": "Download",
"open-in-new-tab": "Open in New Tab",
"preview": "Preview"
},
"mobile-menu": {
"title": "Menu",
"navigation": "Navigation",
"utilities": "Utilities"
},
"homepage": {
"recommended-products": "Recommended Products",
"recommended-products-desc": "Explore our curated selection of products to meet your diverse needs. Whether it's innovative technology or classic designs, we offer quality choices for you.",
"recommended-solutions": "Recommended Solutions",
"recommended-solutions-desc": "Learn about our tailored solutions designed to help your business thrive in a competitive market."
}
}

View File

@ -63,5 +63,41 @@
"loading": "加载中...",
"our-products": "我们的产品",
"learn-our-solutions": "了解我们的解决方案",
"all": "全部"
"all": "全部",
"support-page-desc": "金申机械制造有限公司致力于为客户提供优质的产品与服务。针对纸管机、分纸机、纸吸管等产品,我们提供全方位的售后服务,确保客户能够安心地使用我们的产品。公司名可用占位符代替",
"support-card-desc": {
"faq": "我们为用户整理了常见问题的答案,帮助您快速解决疑惑。",
"documents": "提供产品手册、技术规格等文档资料,方便用户查阅。",
"contact-info": "通过电话、邮箱联系我们,我们将现场为您服务。"
},
"product-filter": {
"product-type": "产品类型",
"product-model": "产品系列",
"keyword": "关键词",
"select-product-type": "选择产品类型",
"select-product-model": "选择产品系列",
"enter-keyword": "输入关键词"
},
"document-meta": {
"size": "大小",
"format": "格式",
"type": "类型",
"upload-at": "上传时间"
},
"document-action": {
"download": "下载",
"open-in-new-tab": "在新标签页打开",
"preview": "预览"
},
"mobile-menu": {
"title": "菜单",
"navigation": "站内导航",
"utilities": "实用工具"
},
"homepage": {
"recommended-products": "推荐产品",
"recommended-products-desc": "探索我们的精选产品,满足您的各种需求。无论是创新技术还是经典设计,我们都为您提供优质选择。",
"recommended-solutions": "推荐解决方案",
"recommended-solutions-desc": "了解我们的定制解决方案,帮助您优化业务流程,提高效率。"
}
}