Skip to content

Commit 06031d3

Browse files
committed
fix(dialog): fixed launch settings countdown dialog not being translated
1 parent b41803c commit 06031d3

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

resource/startup_dialog.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ CAPTION "Startup Settings - Countdown"
1414
FONT 9, "Segoe UI"
1515
BEGIN
1616
/** Instructional text referencing countdown format compatibility */
17-
LTEXT "Set default countdown time at startup\nFormat is the same as countdown time settings", CLOCK_IDC_STATIC, 10, 10, 180, 30
17+
LTEXT "25=25 minutes\n25h=25 hours\n25s=25 seconds\n25 30=25 minutes 30 seconds\n25 30m=25 hours 30 minutes\n1 30 20=1 hour 30 minutes 20 seconds\n17 20t=Countdown to 17:20\n9 9 9t=Countdown to 9:09:09", CLOCK_IDC_STATIC, 10, 10, 180, 70
1818
/** Time input using same parser as main countdown dialog */
19-
EDITTEXT CLOCK_IDC_EDIT, 10, 55, 180, 20, ES_AUTOHSCROLL | ES_MULTILINE
20-
PUSHBUTTON "OK", CLOCK_IDC_BUTTON_OK, 140, 105, 50, 14
19+
EDITTEXT CLOCK_IDC_EDIT, 10, 85, 180, 20, ES_AUTOHSCROLL | ES_MULTILINE
20+
PUSHBUTTON "OK", CLOCK_IDC_BUTTON_OK, 140, 108, 50, 14
2121
END

src/dialog/dialog_language.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static DialogTitleEntry g_dialogTitles[] = {
5151
{CLOCK_IDD_SHORTCUT_DIALOG, L"Countdown Presets"},
5252
{CLOCK_IDD_WEBSITE_DIALOG, L"Open Website"},
5353
{CLOCK_IDD_DIALOG1, L"Set Countdown"},
54+
{CLOCK_IDD_STARTUP_DIALOG, L"Startup Settings"},
5455
{IDD_NO_UPDATE_DIALOG, L"Update Check"},
5556
{IDD_UPDATE_DIALOG, L"Update Available"}
5657
};
@@ -119,6 +120,7 @@ static SpecialControlEntry g_specialButtons[] = {
119120
{CLOCK_IDD_POMODORO_TIME_DIALOG, CLOCK_IDC_BUTTON_OK, L"OK", L"OK"},
120121
{CLOCK_IDD_WEBSITE_DIALOG, CLOCK_IDC_BUTTON_OK, L"OK", L"OK"},
121122
{CLOCK_IDD_SHORTCUT_DIALOG, CLOCK_IDC_BUTTON_OK, L"OK", L"OK"},
123+
{CLOCK_IDD_STARTUP_DIALOG, CLOCK_IDC_BUTTON_OK, L"OK", L"OK"},
122124
{CLOCK_IDD_DIALOG1, CLOCK_IDC_BUTTON_OK, L"OK", L"OK"}
123125
};
124126

@@ -141,6 +143,7 @@ static BOOL NeedsNewlineConversion(int dialogID, int controlID) {
141143
dialogID == CLOCK_IDD_POMODORO_TIME_DIALOG ||
142144
dialogID == CLOCK_IDD_WEBSITE_DIALOG ||
143145
dialogID == CLOCK_IDD_SHORTCUT_DIALOG ||
146+
dialogID == CLOCK_IDD_STARTUP_DIALOG ||
144147
dialogID == CLOCK_IDD_DIALOG1) &&
145148
controlID == CLOCK_IDC_STATIC;
146149
}
@@ -184,8 +187,12 @@ static BOOL IsLocalizableControlType(const wchar_t* className) {
184187
}
185188

186189
static const wchar_t* FindSpecialControlText(int dialogID, int controlID) {
190+
/* Startup dialog reuses countdown dialog's static text */
191+
int searchID = (dialogID == CLOCK_IDD_STARTUP_DIALOG && controlID == CLOCK_IDC_STATIC)
192+
? CLOCK_IDD_DIALOG1 : dialogID;
193+
187194
for (size_t i = 0; i < ARRAY_SIZE(g_specialControls); i++) {
188-
if (g_specialControls[i].dialogID == dialogID &&
195+
if (g_specialControls[i].dialogID == searchID &&
189196
g_specialControls[i].controlID == controlID) {
190197
const wchar_t* localizedText = GetLocalizedString(NULL, g_specialControls[i].textKey);
191198
return localizedText ? localizedText : g_specialControls[i].fallbackText;

0 commit comments

Comments
 (0)