界面:三维显示设置对话框的关闭按钮说中文(Qt 自带翻译没有被安装)
- What: `Scene3dSettingsDialog.retranslate()` 把 `QDialogButtonBox` 的 Close 按钮文字设为
`t("dialog.close")`;两个 locale 各加一个 close 键。
- Why: 应用没有安装 Qt 自带的翻译文件,于是按钮框在满屏中文里显示一个英文 Close;对话框是这个
面板唯一的出口按钮,不该是外来语。
- Verification: `.repro/locale_check.py` 0 缺失(新键双语齐备);对话框截图目视确认
(266x531,结尾按钮为「关闭」)。
- Not in this change: 不动其它对话框(它们用自己的按钮,本来就有中文文案)。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user