fix(界面文案): 前端两棵树加 userNotice 闸——非中文提示语一律换成中文句

后端仍有出口把底层异常原文写进 error_message / fileError / 匹配原因 / 响应 message,逐条翻译
跟不上新增;用户 2026-10-09 要求整个项目的提示语都用中文,所以把规矩做进界面出口。

规则:原文含中文照原样透出;整条无中文换成中文兜底句;**含中文但冒号后是纯英文尾巴的剥掉尾巴**
("转换结果打包失败: No space left on device" 只留主干)。被隐去的原文进 console 供核对日志。

闸口:用户端 http.ts 的 extractErrorMessage 五条返回路径与 unwrapJavaResponse、后台 envelope 的
textOf/errorTextOf、13 处任务卡 `错误:${item.error}`、2 处 fileError 兜底句、发布页文件错误与
匹配原因函数、dispatch-guard 的解析失败原因清单、22 处 ElMessage.error(result.error) 型展示、
后台看板与数字人详情页两处模板。

尺子:frontend-vue/tests/user-notice-chinese-only-guard.test.ts、admin-frontend-vue/tests/user-notice-chinese-only.test.ts
(分母硬钉+内存造违例自证+摘壳写法仍计入分母);source-pin 台账只登记本轮新增那一个文件,
别人的在飞格子没重算。node --test 用户端 782/782、后台 1782/1782,两棵树 vue-tsc 均 rc=0。
This commit is contained in:
2026-10-09 19:34:54 +08:00
parent 2a4d15b801
commit 282ad7be9f
34 changed files with 396 additions and 78 deletions
@@ -174,6 +174,7 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, triggerRef, watch } from 'vue'
import { userNotice } from '@/shared/utils/user-notice'
import { ElMessage, ElMessageBox } from 'element-plus'
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
@@ -445,7 +446,7 @@ function toPublishTaskView(detail: PublishTaskDetailVo): TaskItemView {
const percent = Number.isFinite(rawPercent) ? Math.max(0, Math.min(100, Math.round(rawPercent))) : 0
const errorMessage = task?.errorMessage || ''
const extraLines: string[] = []
if (errorMessage) extraLines.push(`错误:${errorMessage}`)
if (errorMessage) extraLines.push(`错误:${userNotice(errorMessage)}`)
return {
key: `publish-${task?.id ?? 'unknown'}`,
title: `上架任务 #${task?.id ?? '-'}`,
@@ -1008,11 +1009,13 @@ function statusClass(status?: string | null) {
function matchText(file: PublishFileItem) {
if (isMatchedFile(file)) return file.shopId ? `已匹配 ${file.shopId}` : '已匹配'
return file.matchMessage || file.matchStatus || '未匹配'
const rawMatch = file.matchMessage || file.matchStatus
return rawMatch ? userNotice(rawMatch, '未匹配') : '未匹配'
}
function fileErrorText(file: PublishFileItem) {
return file.errorMessage || file.error || ''
const rawError = file.errorMessage || file.error
return rawError ? userNotice(rawError) : ''
}
function shouldShowFileProgress(file: PublishFileItem) {