Skip to content

Commit 29e9d57

Browse files
dengzhongyuan365-devJohnson-zs
authored andcommitted
fix: Fixed the issue that the U disk format interface text is English after switching the language to Traditional Chinese
- Update translation generation script path in CMakeLists.txt - Add missing translations for device formatter Log: fix translation not working in device formatter Bug: https://pms.uniontech.com/bug-view-298081.html
1 parent 3cac731 commit 29e9d57

4 files changed

Lines changed: 50 additions & 44 deletions

File tree

translations/dde-device-formatter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@
113113
<context>
114114
<name>QObject</name>
115115
<message>
116-
<location filename="../main.cpp" line="61"/>
116+
<location filename="../main.cpp" line="68"/>
117117
<source>dde device formatter</source>
118-
<translation type="unfinished"></translation>
118+
<translation>dde device formatter</translation>
119119
</message>
120120
<message>
121-
<location filename="../main.cpp" line="78"/>
121+
<location filename="../main.cpp" line="84"/>
122122
<source>Device does not exist</source>
123123
<translation>Device does not exist</translation>
124124
</message>
125125
<message>
126-
<location filename="../main.cpp" line="87"/>
126+
<location filename="../main.cpp" line="93"/>
127127
<source>The device is read-only</source>
128128
<translation>The device is read-only</translation>
129129
</message>

translations/dde-device-formatter_zh_CN.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@
113113
<context>
114114
<name>QObject</name>
115115
<message>
116-
<location filename="../main.cpp" line="61"/>
116+
<location filename="../main.cpp" line="68"/>
117117
<source>dde device formatter</source>
118118
<translation>格式化工具</translation>
119119
</message>
120120
<message>
121-
<location filename="../main.cpp" line="78"/>
121+
<location filename="../main.cpp" line="84"/>
122122
<source>Device does not exist</source>
123123
<translation>设备不存在</translation>
124124
</message>
125125
<message>
126-
<location filename="../main.cpp" line="87"/>
126+
<location filename="../main.cpp" line="93"/>
127127
<source>The device is read-only</source>
128128
<translation>此设备为只读</translation>
129129
</message>
Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,139 @@
1-
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_TW" version="2.1">
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="zh_TW">
24
<context>
35
<name>FinishPage</name>
46
<message>
5-
<location filename="../view/finishpage.cpp" line="42"/>
7+
<location filename="../view/finishpage.cpp" line="22"/>
68
<source>Format successful</source>
79
<translation>格式化成功</translation>
810
</message>
911
</context>
1012
<context>
1113
<name>FormatingPage</name>
1214
<message>
13-
<location filename="../view/formatingpage.cpp" line="47"/>
15+
<location filename="../view/formatingpage.cpp" line="29"/>
1416
<source>Formatting the disk, please wait...</source>
1517
<translation>正在格式化,請稍候……</translation>
1618
</message>
1719
</context>
1820
<context>
1921
<name>MainPage</name>
2022
<message>
21-
<location filename="../view/mainpage.cpp" line="104"/>
23+
<location filename="../view/mainpage.cpp" line="99"/>
2224
<source>Type</source>
2325
<translation>類型</translation>
2426
</message>
2527
<message>
26-
<location filename="../view/mainpage.cpp" line="122"/>
28+
<location filename="../view/mainpage.cpp" line="117"/>
2729
<source>Label</source>
2830
<translation>標籤</translation>
2931
</message>
3032
<message>
31-
<location filename="../view/mainpage.cpp" line="131"/>
33+
<location filename="../view/mainpage.cpp" line="127"/>
3234
<source>Quick Format</source>
3335
<translation>快速格式化</translation>
3436
</message>
3537
<message>
36-
<location filename="../view/mainpage.cpp" line="148"/>
38+
<location filename="../view/mainpage.cpp" line="144"/>
3739
<source>Formatting will erase all data on the disk.</source>
3840
<translation>格式化會清空磁碟上所有資料。</translation>
3941
</message>
4042
</context>
4143
<context>
4244
<name>MainWindow</name>
4345
<message>
44-
<location filename="../view/mainwindow.cpp" line="88"/>
45-
<location filename="../view/mainwindow.cpp" line="106"/>
46+
<location filename="../view/mainwindow.cpp" line="68"/>
47+
<location filename="../view/mainwindow.cpp" line="86"/>
4648
<source>Format</source>
4749
<translation>格式化</translation>
4850
</message>
4951
<message>
50-
<location filename="../view/mainwindow.cpp" line="161"/>
52+
<location filename="../view/mainwindow.cpp" line="213"/>
5153
<source>Continue</source>
5254
<translation>繼續</translation>
5355
</message>
5456
<message>
55-
<location filename="../view/mainwindow.cpp" line="166"/>
57+
<location filename="../view/mainwindow.cpp" line="218"/>
5658
<source>Formatting...</source>
5759
<translation>正在格式化…</translation>
5860
</message>
5961
<message>
60-
<location filename="../view/mainwindow.cpp" line="191"/>
62+
<location filename="../view/mainwindow.cpp" line="244"/>
6163
<source>Done</source>
6264
<translation>完成</translation>
6365
</message>
6466
<message>
65-
<location filename="../view/mainwindow.cpp" line="197"/>
67+
<location filename="../view/mainwindow.cpp" line="254"/>
6668
<source>Quit</source>
6769
<translation>離開</translation>
6870
</message>
6971
<message>
70-
<location filename="../view/mainwindow.cpp" line="198"/>
71-
<source>Your disk is removed when formatting</source>
72-
<translation>磁碟機在格式化時被移除</translation>
72+
<location filename="../view/mainwindow.cpp" line="255"/>
73+
<source>Your disk has been removed</source>
74+
<translation>您的磁盤已被移除</translation>
7375
</message>
7476
<message>
75-
<location filename="../view/mainwindow.cpp" line="201"/>
77+
<location filename="../view/mainwindow.cpp" line="258"/>
7678
<source>Failed to format the device</source>
77-
<translation type="unfinished"/>
79+
<translation>格式化失敗</translation>
7880
</message>
7981
<message>
80-
<location filename="../view/mainwindow.cpp" line="202"/>
82+
<location filename="../view/mainwindow.cpp" line="259"/>
8183
<source>Reformat</source>
8284
<translation>重新格式化</translation>
8385
</message>
8486
</context>
8587
<context>
8688
<name>MessageDialog</name>
8789
<message>
88-
<location filename="../dialogs/messagedialog.cpp" line="43"/>
90+
<location filename="../dialogs/messagedialog.cpp" line="23"/>
8991
<source>OK</source>
9092
<translation>確定</translation>
9193
</message>
9294
</context>
9395
<context>
9496
<name>QCoreApplication</name>
9597
<message>
96-
<location filename="../utils/udisksutils.cpp" line="55"/>
98+
<location filename="../utils/udisksutils.cpp" line="38"/>
9799
<source>System Disk</source>
98-
<translation type="unfinished"/>
100+
<translation>系統盤</translation>
99101
</message>
100102
<message>
101-
<location filename="../utils/udisksutils.cpp" line="59"/>
103+
<location filename="../utils/udisksutils.cpp" line="42"/>
102104
<source>%1 Encrypted</source>
103-
<translation type="unfinished"/>
105+
<translation>%1 已加密</translation>
104106
</message>
105107
<message>
106-
<location filename="../utils/udisksutils.cpp" line="61"/>
108+
<location filename="../utils/udisksutils.cpp" line="44"/>
107109
<source>%1 Volume</source>
108-
<translation type="unfinished"/>
110+
<translation>%1 卷</translation>
109111
</message>
110112
</context>
111113
<context>
112114
<name>QObject</name>
113115
<message>
114-
<location filename="../main.cpp" line="112"/>
116+
<location filename="../main.cpp" line="68"/>
117+
<source>dde device formatter</source>
118+
<translation>格式化工具</translation>
119+
</message>
120+
<message>
121+
<location filename="../main.cpp" line="84"/>
115122
<source>Device does not exist</source>
116123
<translation>裝置不存在</translation>
117124
</message>
118125
<message>
119-
<location filename="../main.cpp" line="121"/>
126+
<location filename="../main.cpp" line="93"/>
120127
<source>The device is read-only</source>
121-
<translation type="unfinished"/>
122-
</message>
123-
<message>
124-
<source>Cannot format local device</source>
125-
<translation type="vanished">無法格式化本機裝置</translation>
128+
<translation>此設備爲只讀</translation>
126129
</message>
127130
</context>
128131
<context>
129132
<name>WarnPage</name>
130133
<message>
131-
<location filename="../view/warnpage.cpp" line="43"/>
134+
<location filename="../view/warnpage.cpp" line="23"/>
132135
<source>Formatting will erase all data on this disk, are you sure you want to continue? It cannot be restored.</source>
133136
<translation>格式化會清空磁碟上所有資料,確定繼續?該操作無法復原。</translation>
134137
</message>
135138
</context>
136-
</TS>
139+
</TS>

update_trabslations.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22
# this file is used to auto update ts file.
33

4-
lupdate -pro dde-device-formatter.pro -ts translations/dde-device-formatter.ts -no-obsolete
5-
lupdate -pro dde-device-formatter.pro -ts translations/dde-device-formatter_zh_CN.ts -no-obsolete
4+
# lupdate -pro dde-device-formatter.pro -ts translations/dde-device-formatter.ts -no-obsolete
5+
# lupdate -pro dde-device-formatter.pro -ts translations/dde-device-formatter_zh_CN.ts -no-obsolete
6+
lupdate ./ -ts -no-obsolete translations/dde-device-formatter.ts
7+
lupdate ./ -ts -no-obsolete translations/dde-device-formatter_zh_CN.ts
8+
lupdate ./ -ts -no-obsolete translations/dde-device-formatter_zh_TW.ts

0 commit comments

Comments
 (0)