feat: 国际化支持,英文源串+中文翻译

全部44处qsTr源串改为英文,新建translations/jnetapplet_zh_CN.ts
中文翻译文件。CMake增加LinguistTools+qt_add_translation编译
.ts->.qm,init()按系统语言加载.qm并安装到qApp。

中文系统显示中文翻译,英文系统显示英文源串。
This commit is contained in:
2026-07-24 11:40:12 +08:00
parent 43fdcc8b0a
commit fba506d9d8
9 changed files with 318 additions and 48 deletions
+3 -3
View File
@@ -177,7 +177,7 @@ Window {
anchors.left: parent.left
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter
text: qsTr("流量波动图")
text: qsTr("Traffic Chart")
font.pixelSize: 15
font.weight: Font.Bold
color: root.textPrimary
@@ -421,7 +421,7 @@ Window {
ctx.font = "13px sans-serif"
ctx.textAlign = "center"
ctx.textBaseline = "middle"
ctx.fillText(qsTr("暂无历史数据"), pl + pw / 2, pt + ph / 2)
ctx.fillText(qsTr("No history data"), pl + pw / 2, pt + ph / 2)
return
}
@@ -578,7 +578,7 @@ Window {
Text {
anchors.centerIn: parent
text: root.hoverHint.length > 0
? root.hoverHint : qsTr("鼠标移到曲线上查看详情")
? root.hoverHint : qsTr("Hover over the curve for details")
font.pixelSize: 11
color: root.hoverHint.length > 0 ? root.textPrimary : root.textTertiary
}