From 3c2d52e060a59f5ef342678583efddfcf520f9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com> Date: Sun, 16 Jun 2024 15:21:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=BC=94=E7=A4=BAi18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locale/en.json | 6 +++--- src/locale/zh-Hans.json | 4 ++-- src/pages/about/i18n.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/locale/en.json b/src/locale/en.json index 040e03c..cd966f8 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -1,8 +1,8 @@ { "tabbar.home": "Home", "tabbar.about": "About", + "app.name": "En Title", "weight": "{heavy}KG", - "weight2": "{0}KG", - "introduction": "I am {name},height:{detail.height},weight:{detail.weight}", - "app.name": "En Title" + "detail": "{0}cm, {1}KG", + "introduction": "I am {name},height:{detail.height},weight:{detail.weight}" } diff --git a/src/locale/zh-Hans.json b/src/locale/zh-Hans.json index e4cea6c..7b3afa6 100644 --- a/src/locale/zh-Hans.json +++ b/src/locale/zh-Hans.json @@ -3,6 +3,6 @@ "tabbar.about": "关于", "app.name": "中文标题", "weight": "{heavy}公斤", - "introduction": "我是 {name},身高:{detail.height},体重:{detail.weight}", - "weight2": "{0}公斤" + "detail": "{0}cm, {1}公斤", + "introduction": "我是 {name},身高:{detail.height},体重:{detail.weight}" } diff --git a/src/pages/about/i18n.vue b/src/pages/about/i18n.vue index 9722fa3..132bd82 100644 --- a/src/pages/about/i18n.vue +++ b/src/pages/about/i18n.vue @@ -22,7 +22,7 @@ 多语言测试 {{ $t('app.name') }} {{ $t('weight', { heavy: 100 }) }} - {{ formatString(translate('weight2'), 100) }} + {{ formatString(translate('detail'), 175, 60) }} {{ formatI18n(translate('introduction'), user) }}