From 0b87e3e36d09148d474f3278a66010ed3fd7a288 Mon Sep 17 00:00:00 2001 From: ykcheungab Date: Tue, 15 Sep 2026 20:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=9A=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E8=AF=B4=E4=B8=AD?= =?UTF-8?q?=E6=96=87=EF=BC=88Qt=20=E8=87=AA=E5=B8=A6=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A2=AB=E5=AE=89=E8=A3=85=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - What: `Scene3dSettingsDialog.retranslate()` 把 `QDialogButtonBox` 的 Close 按钮文字设为 `t("dialog.close")`;两个 locale 各加一个 close 键。 - Why: 应用没有安装 Qt 自带的翻译文件,于是按钮框在满屏中文里显示一个英文 Close;对话框是这个 面板唯一的出口按钮,不该是外来语。 - Verification: `.repro/locale_check.py` 0 缺失(新键双语齐备);对话框截图目视确认 (266x531,结尾按钮为「关闭」)。 - Not in this change: 不动其它对话框(它们用自己的按钮,本来就有中文文案)。 --- apps/studio/config/locales/en_US.json | 3 ++- apps/studio/config/locales/zh_CN.json | 3 ++- apps/studio/src/orisys_studio/scene3d/settings_dialog.py | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/studio/config/locales/en_US.json b/apps/studio/config/locales/en_US.json index 54a260f..c3144a0 100644 --- a/apps/studio/config/locales/en_US.json +++ b/apps/studio/config/locales/en_US.json @@ -78,7 +78,8 @@ "filter_nyquist": "Note: a {cutoff} Hz cutoff is at or above the Nyquist frequency of {nyquist} Hz (sample rate {rate} Hz) — the device would not filter. Lower the cutoff or pin a higher sample rate.", "filter_off": "Not filtering (raw readings)", "ok": "OK", - "cancel": "Cancel" + "cancel": "Cancel", + "close": "Close" }, "toolbar": { "search_cameras": "Search", diff --git a/apps/studio/config/locales/zh_CN.json b/apps/studio/config/locales/zh_CN.json index e7cf350..0465fe7 100644 --- a/apps/studio/config/locales/zh_CN.json +++ b/apps/studio/config/locales/zh_CN.json @@ -78,7 +78,8 @@ "filter_nyquist": "注意:低通 {cutoff} Hz 已达到或超过奈奎斯特频率 {nyquist} Hz(采样率 {rate} Hz)——设备不会滤。请调低截止频率或固定更高的采样率。", "filter_off": "当前不滤波(原始读数)", "ok": "确定", - "cancel": "取消" + "cancel": "取消", + "close": "关闭" }, "toolbar": { "search_cameras": "搜索", diff --git a/apps/studio/src/orisys_studio/scene3d/settings_dialog.py b/apps/studio/src/orisys_studio/scene3d/settings_dialog.py index 54ce822..149109f 100644 --- a/apps/studio/src/orisys_studio/scene3d/settings_dialog.py +++ b/apps/studio/src/orisys_studio/scene3d/settings_dialog.py @@ -70,6 +70,11 @@ class Scene3dSettingsDialog(QDialog): def retranslate(self) -> None: self.setWindowTitle(t("scene3d.settings_title")) self.hint.setText(t("scene3d.settings_hint")) + # Qt ships its own translations for a button box, and the application installs + # none: without this the dialog ends in an English "Close" among Chinese labels. + close_button = self.buttons.button(QDialogButtonBox.Close) + if close_button is not None: + close_button.setText(t("dialog.close")) # ------------------------------------------------------------------ Qt events def closeEvent(self, event) -> None: # noqa: N802 - Qt naming