uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

uni.setLocale 后 uni.showModal 的按钮无效

Open gengengengengen opened this issue 2 months ago • 1 comments

发行方式

小程序

具体平台

小程序库 - 3.11.3

开发环境

Windows

项目创建方式

None

Vue 版本

vue3

依赖版本

uniapp - 3.0.0-4070520250711001

问题描述

Image

小程序端,i18n 本地化国际化多语言设置,调用 uni.setLocale 对 uni.showModal 的按钮无效。locale 目录下配置了 uni-app.en.json 和 uni-app.zh-Hans.json 再试也不行

{
  "common": {
    "uni.app.quit": "Press again to exit the app",
    "uni.async.error": "Connection timeout, tap screen to retry",
    "uni.showActionSheet.cancel": "Cancel",
    "uni.showToast.unpaired": "Please note that showToast and hideToast must be used in pairs",
    "uni.showLoading.unpaired": "Please note that showLoading and hideLoading must be used in pairs",
    "uni.showModal.cancel": "Cancel",
    "uni.showModal.confirm": "OK",
    ...
    "uni.button.feedback.send": "Send"
  },
  "ios": {},
  "android": {}
}

重现步骤

1.调用 uni.setLocale 设置为非中文 2.调用含确认按钮方式的 uni.showModal 3.发现 是/否 按钮未按预期变为非中文的区域文本

期望行为

本地化文本切换正常

实际行为

No response

截图或录屏

No response

gengengengengen avatar Dec 04 '25 04:12 gengengengengen

uniapp的相关依赖可以先升级到最新版本测试一下,如果还是不行的话,可以发个可复现的demo

chouchouji avatar Dec 04 '25 06:12 chouchouji