Skip to content

Commit ae95ea4

Browse files
feat: update shortcut translations and improve language support
- Updated translation files for multiple languages to include new entries for shortcut configurations. - Adjusted the model references in QML to use display properties for better user experience. - Ensured consistency in translation entries across various languages. Log: enhance shortcut language support and improve user interface in the configuration tool https://pms.uniontech.com/story-view-39439
1 parent 642672e commit ae95ea4

77 files changed

Lines changed: 11082 additions & 2196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Build-Depends:
2323
libkf6itemviews-dev | libkf5itemviews-dev,
2424
libxkbcommon-dev,
2525
libxkbfile-dev,
26+
libicu-dev,
2627
pkg-config,
2728
xkb-data,
2829
Standards-Version: 4.6.2

src/dcc-fcitx5configtool/qml/ShortcutsModule.qml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import org.deepin.dcc 1.0
99

1010
DccObject {
1111
readonly property var enumKeys: ["Ctrl+Shift", "Alt+Shift", "None"]
12+
readonly property var enumKeysI18n: ["Ctrl+Shift", "Alt+Shift", qsTr("None")]
1213
readonly property var triggerEnumKeys: ["Shift", "Ctrl+Space", "None"]
14+
readonly property var triggerEnumKeysI18n: ["Shift", "Ctrl+Space", qsTr("None")]
15+
1316
property var triggerKeys: dccData.fcitx5ConfigProxy.globalConfigOption(
1417
"Hotkey", "TriggerKeys")
1518
property int enumerateForwardKeys: calculateEnumerateForwardKeys(
@@ -144,6 +147,10 @@ DccObject {
144147
}
145148

146149
Component.onCompleted: {
150+
// 设置翻译后的显示数组
151+
enumKeysDisplay = ["Ctrl+Shift", "Alt+Shift", qsTr("None")]
152+
triggerEnumKeysDisplay = ["Shift", "Ctrl+Space", qsTr("None")]
153+
147154
dccData.fcitx5ConfigProxy.onRequestConfigFinished.connect(() => {
148155

149156
let fullTriggerKeys = dccData.fcitx5ConfigProxy.globalConfigOption("Hotkey", "TriggerKeys")
@@ -196,7 +203,7 @@ DccObject {
196203
page: D.ComboBox {
197204
id: comboBox
198205
flat: true
199-
model: enumKeys
206+
model: enumKeysI18n
200207
currentIndex: enumerateForwardKeys
201208

202209
onCurrentIndexChanged: {
@@ -226,7 +233,7 @@ DccObject {
226233
page: D.ComboBox {
227234
id: triggerComboBox
228235
flat: true
229-
model: triggerEnumKeys
236+
model: triggerEnumKeysI18n
230237
currentIndex: currentTriggerKeys
231238

232239
onCurrentIndexChanged: {

src/dcc-fcitx5configtool/translations/fcitx5configtool.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,27 +196,35 @@
196196
<context>
197197
<name>ShortcutsModule</name>
198198
<message>
199-
<location filename="../qml/ShortcutsModule.qml" line="116"/>
199+
<location filename="../qml/ShortcutsModule.qml" line="119"/>
200200
<source>Shortcuts</source>
201201
<translation type="unfinished"></translation>
202202
</message>
203203
<message>
204-
<location filename="../qml/ShortcutsModule.qml" line="131"/>
204+
<location filename="../qml/ShortcutsModule.qml" line="134"/>
205205
<source>Restore Defaults</source>
206206
<translation type="unfinished"></translation>
207207
</message>
208208
<message>
209-
<location filename="../qml/ShortcutsModule.qml" line="193"/>
209+
<location filename="../qml/ShortcutsModule.qml" line="200"/>
210210
<source>Scroll between input methods</source>
211211
<translation type="unfinished"></translation>
212212
</message>
213213
<message>
214-
<location filename="../qml/ShortcutsModule.qml" line="223"/>
214+
<location filename="../qml/ShortcutsModule.qml" line="12"/>
215+
<location filename="../qml/ShortcutsModule.qml" line="14"/>
216+
<location filename="../qml/ShortcutsModule.qml" line="151"/>
217+
<location filename="../qml/ShortcutsModule.qml" line="152"/>
218+
<source>None</source>
219+
<translation type="unfinished"></translation>
220+
</message>
221+
<message>
222+
<location filename="../qml/ShortcutsModule.qml" line="230"/>
215223
<source>Turn on or off input methods</source>
216224
<translation type="unfinished"></translation>
217225
</message>
218226
<message>
219-
<location filename="../qml/ShortcutsModule.qml" line="266"/>
227+
<location filename="../qml/ShortcutsModule.qml" line="273"/>
220228
<source>It turns on or off the currently used input method.If no input method is being used or the first input method is not the keyboard, it switches between the first input method and the currently used keyboard/input method.</source>
221229
<translation type="unfinished"></translation>
222230
</message>

0 commit comments

Comments
 (0)