Skip to content

Commit 8520e3f

Browse files
committed
System: Work around lupdate bug causing hang
1 parent a49d0b6 commit 8520e3f

File tree

2 files changed

+38
-29
lines changed

2 files changed

+38
-29
lines changed

src/core/system.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,11 +1687,12 @@ bool System::CanPauseSystem(bool display_message)
16871687

16881688
if (display_message)
16891689
{
1690-
const float seconds = static_cast<float>(frames_until_pause_allowed) / System::GetVideoFrameRate();
1690+
const float time_until_pause_allowed = static_cast<float>(frames_until_pause_allowed) / System::GetVideoFrameRate();
1691+
const int seconds_until_pause_allowed = static_cast<int>(std::ceil(time_until_pause_allowed));
16911692
Host::AddIconOSDMessage("PauseCooldown", ICON_FA_CLOCK,
1692-
TRANSLATE_PLURAL_STR("Hotkeys", "You cannot pause until another %n second(s) have passed.",
1693-
"", static_cast<int>(std::ceil(seconds))),
1694-
std::max(seconds, Host::OSD_QUICK_DURATION));
1693+
TRANSLATE_PLURAL_STR("System", "You cannot pause until another %n second(s) have passed.",
1694+
"", seconds_until_pause_allowed),
1695+
std::max(time_until_pause_allowed, Host::OSD_QUICK_DURATION));
16951696
}
16961697

16971698
return false;

src/duckstation-qt/translations/duckstation-qt_en.ts

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<context>
1717
<name>Achievements</name>
1818
<message numerus="yes">
19-
<location filename="../../core/achievements.cpp" line="1360"/>
19+
<location filename="../../core/achievements.cpp" line="1387"/>
2020
<source>You have unlocked {} of %n achievements</source>
2121
<comment>Achievement popup</comment>
2222
<translation>
@@ -25,7 +25,7 @@
2525
</translation>
2626
</message>
2727
<message numerus="yes">
28-
<location filename="../../core/achievements.cpp" line="1363"/>
28+
<location filename="../../core/achievements.cpp" line="1390"/>
2929
<source>and earned {} of %n points</source>
3030
<comment>Achievement popup</comment>
3131
<translation>
@@ -34,7 +34,7 @@
3434
</translation>
3535
</message>
3636
<message numerus="yes">
37-
<location filename="../../core/achievements.cpp" line="1401"/>
37+
<location filename="../../core/achievements.cpp" line="1428"/>
3838
<source>%n achievements are not supported by DuckStation.</source>
3939
<comment>Achievement popup</comment>
4040
<translation>
@@ -43,8 +43,8 @@
4343
</translation>
4444
</message>
4545
<message numerus="yes">
46-
<location filename="../../core/achievements.cpp" line="1476"/>
47-
<location filename="../../core/achievements.cpp" line="1513"/>
46+
<location filename="../../core/achievements.cpp" line="1503"/>
47+
<location filename="../../core/achievements.cpp" line="1540"/>
4848
<source>%n achievements</source>
4949
<comment>Mastery popup</comment>
5050
<translation>
@@ -53,9 +53,9 @@
5353
</translation>
5454
</message>
5555
<message numerus="yes">
56-
<location filename="../../core/achievements.cpp" line="1478"/>
57-
<location filename="../../core/achievements.cpp" line="1515"/>
58-
<location filename="../../core/achievements.cpp" line="3083"/>
56+
<location filename="../../core/achievements.cpp" line="1505"/>
57+
<location filename="../../core/achievements.cpp" line="1542"/>
58+
<location filename="../../core/achievements.cpp" line="3218"/>
5959
<source>%n points</source>
6060
<comment>Achievement points</comment>
6161
<translation>
@@ -64,7 +64,7 @@
6464
</translation>
6565
</message>
6666
<message numerus="yes">
67-
<location filename="../../core/achievements.cpp" line="2669"/>
67+
<location filename="../../core/achievements.cpp" line="2670"/>
6868
<source>%n unlocks have not been confirmed by the server.</source>
6969
<comment>Pause Menu</comment>
7070
<translation>
@@ -73,7 +73,7 @@
7373
</translation>
7474
</message>
7575
<message numerus="yes">
76-
<location filename="../../core/achievements.cpp" line="2844"/>
76+
<location filename="../../core/achievements.cpp" line="2978"/>
7777
<source>You have unlocked all achievements and earned %n points!</source>
7878
<comment>Point count</comment>
7979
<translation>
@@ -82,7 +82,7 @@
8282
</translation>
8383
</message>
8484
<message numerus="yes">
85-
<location filename="../../core/achievements.cpp" line="2870"/>
85+
<location filename="../../core/achievements.cpp" line="3005"/>
8686
<source>%n achievements are not supported by DuckStation and cannot be unlocked.</source>
8787
<comment>Unsupported achievement count</comment>
8888
<translation>
@@ -91,7 +91,7 @@
9191
</translation>
9292
</message>
9393
<message numerus="yes">
94-
<location filename="../../core/achievements.cpp" line="3331"/>
94+
<location filename="../../core/achievements.cpp" line="3466"/>
9595
<source>This game has %n leaderboards.</source>
9696
<comment>Leaderboard count</comment>
9797
<translation>
@@ -103,7 +103,7 @@
103103
<context>
104104
<name>Cheats</name>
105105
<message numerus="yes">
106-
<location filename="../../core/cheats.cpp" line="1020"/>
106+
<location filename="../../core/cheats.cpp" line="1098"/>
107107
<source>%n game patches are active.</source>
108108
<comment>OSD Message</comment>
109109
<translation>
@@ -112,7 +112,7 @@
112112
</translation>
113113
</message>
114114
<message numerus="yes">
115-
<location filename="../../core/cheats.cpp" line="1027"/>
115+
<location filename="../../core/cheats.cpp" line="1105"/>
116116
<source>%n cheats are enabled. This may crash games.</source>
117117
<comment>OSD Message</comment>
118118
<translation>
@@ -121,7 +121,7 @@
121121
</translation>
122122
</message>
123123
<message numerus="yes">
124-
<location filename="../../core/cheats.cpp" line="1054"/>
124+
<location filename="../../core/cheats.cpp" line="1133"/>
125125
<source>%n cheats</source>
126126
<comment>Cheats blocked by hardcore mode</comment>
127127
<translation>
@@ -130,7 +130,7 @@
130130
</translation>
131131
</message>
132132
<message numerus="yes">
133-
<location filename="../../core/cheats.cpp" line="1056"/>
133+
<location filename="../../core/cheats.cpp" line="1135"/>
134134
<source>%n patches</source>
135135
<comment>Patches blocked by hardcore mode</comment>
136136
<translation>
@@ -142,7 +142,7 @@
142142
<context>
143143
<name>EmulationSettingsWidget</name>
144144
<message numerus="yes">
145-
<location filename="../emulationsettingswidget.cpp" line="255"/>
145+
<location filename="../emulationsettingswidget.cpp" line="261"/>
146146
<source>Rewind for %n frame(s), lasting %1 second(s) will require up to %2MB of RAM and %3MB of VRAM.</source>
147147
<translation>
148148
<numerusform>Rewind for %n frame, lasting %1 second(s) will require up to %2MB of RAM and %3MB of VRAM.</numerusform>
@@ -174,7 +174,7 @@
174174
<context>
175175
<name>GPU_HW</name>
176176
<message numerus="yes">
177-
<location filename="../../core/gpu_hw_texture_cache.cpp" line="3706"/>
177+
<location filename="../../core/gpu_hw_texture_cache.cpp" line="3711"/>
178178
<source>%n replacement textures found.</source>
179179
<comment>Replacement texture count</comment>
180180
<translation>
@@ -186,26 +186,23 @@
186186
<context>
187187
<name>GameList</name>
188188
<message numerus="yes">
189-
<location filename="../gamelistwidget.cpp" line="1699"/>
190-
<location filename="../../core/game_list.cpp" line="1609"/>
189+
<location filename="../../core/game_list.cpp" line="1639"/>
191190
<source>%n seconds</source>
192191
<translation>
193192
<numerusform>%n second</numerusform>
194193
<numerusform>%n seconds</numerusform>
195194
</translation>
196195
</message>
197196
<message numerus="yes">
198-
<location filename="../gamelistwidget.cpp" line="1701"/>
199-
<location filename="../../core/game_list.cpp" line="1605"/>
197+
<location filename="../../core/game_list.cpp" line="1635"/>
200198
<source>%n hours</source>
201199
<translation>
202200
<numerusform>%n hour</numerusform>
203201
<numerusform>%n hours</numerusform>
204202
</translation>
205203
</message>
206204
<message numerus="yes">
207-
<location filename="../gamelistwidget.cpp" line="1700"/>
208-
<location filename="../../core/game_list.cpp" line="1607"/>
205+
<location filename="../../core/game_list.cpp" line="1637"/>
209206
<source>%n minutes</source>
210207
<translation>
211208
<numerusform>%n minute</numerusform>
@@ -227,12 +224,23 @@
227224
<context>
228225
<name>MemoryCardEditorWindow</name>
229226
<message numerus="yes">
230-
<location filename="../memorycardeditorwindow.cpp" line="318"/>
227+
<location filename="../memorycardeditorwindow.cpp" line="471"/>
231228
<source>%n block(s) free%1</source>
232229
<translation>
233230
<numerusform>%n block free%1</numerusform>
234231
<numerusform>%n blocks free%1</numerusform>
235232
</translation>
236233
</message>
237234
</context>
235+
<context>
236+
<name>System</name>
237+
<message numerus="yes">
238+
<location filename="../../core/system.cpp" line="1693"/>
239+
<source>You cannot pause until another %n second(s) have passed.</source>
240+
<translation>
241+
<numerusform>You cannot pause until another %n second has passed.</numerusform>
242+
<numerusform>You cannot pause until another %n seconds have passed.</numerusform>
243+
</translation>
244+
</message>
245+
</context>
238246
</TS>

0 commit comments

Comments
 (0)