Skip to content

Commit

Permalink
L10N: Localized remaining user-facing texts in GUI and Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrsatrio committed Nov 11, 2023
1 parent b5b0b21 commit fc17455
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 20 deletions.
19 changes: 14 additions & 5 deletions ExplorerPatcher/updates.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ BOOL IsUpdateAvailableHelper(
}
CloseHandle(hMyToken);
}
int lnSID = (wszSID ? wcslen(wszSID) : 0);
size_t lnSID = (wszSID ? wcslen(wszSID) : 0);
DWORD bIsBuiltInAdministratorInApprovalMode = FALSE;
BOOL bIsBuiltInAdministratorAccount =
IsUserAnAdmin() &&
Expand All @@ -545,7 +545,16 @@ BOOL IsUpdateAvailableHelper(
);

WCHAR wszMsg[500];
swprintf_s(wszMsg, 500, L"Would you like to install an update for " _T(PRODUCT_NAME) L"?\n\nDownloaded from:\n%s", wszURL2);
wszMsg[0] = 0;

WCHAR wszMsgFormat[500];
HMODULE hEPGui = LoadGuiModule();
if (LoadStringW(hEPGui, IDS_UPDATES_PROMPT, wszMsgFormat, ARRAYSIZE(wszMsgFormat)))
{
swprintf_s(wszMsg, ARRAYSIZE(wszMsg), wszMsgFormat, wszURL2);
}
FreeLibrary(hEPGui);

if (MessageBoxW(
FindWindowW(L"ExplorerPatcher_GUI_" _T(EP_CLSID), NULL),
wszMsg,
Expand Down Expand Up @@ -576,7 +585,7 @@ BOOL IsUpdateAvailableHelper(
{
bIsUpdateAvailable = TRUE;
#ifdef UPDATES_VERBOSE_OUTPUT
printf("[Updates] Update successful, File Explorer will probably restart momentarly.\n");
printf("[Updates] Update successful, File Explorer will probably restart momentarily.\n");
#endif
}
else
Expand Down Expand Up @@ -1073,8 +1082,8 @@ BOOL InstallUpdatesIfAvailable(
swprintf_s(buf, TOAST_BUFSIZ, text, _T(UPDATES_RELEASE_INFO_URL), L"short", title, body);

String2IXMLDocument(
text,
wcslen(text),
buf,
wcslen(buf),
&inputXml,
NULL
);
Expand Down
29 changes: 17 additions & 12 deletions ep_gui/GUI.c
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,10 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
GUI_Build(0, hwnd, pt);
fclose(AuditFile);
AuditFile = NULL;
MessageBoxW(hwnd, L"Settings have been exported successfully.", GUI_title, MB_ICONINFORMATION);
wchar_t mbText[128];
mbText[0] = 0;
LoadStringW(hModule, IDS_ABOUT_EXPORT_SUCCESS, mbText, ARRAYSIZE(mbText));
MessageBoxW(hwnd, mbText, GUI_title, MB_ICONINFORMATION);
}
}
}
Expand Down Expand Up @@ -2114,14 +2117,10 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
}
else if (!strncmp(line + 1, "clear_data_weather", 18))
{
if (MessageBoxW(
hwnd,
L"Are you sure you want to permanently clear the weather widget's local data?\n\n"
L"This will reset the internal components to their default state, but will preserve "
L"your preferences. This may fix the widget not loading the data properly, or "
L"having layout issues etc.",
_T(PRODUCT_NAME),
MB_ICONQUESTION | MB_YESNO) == IDYES)
wchar_t mbText[512];
mbText[0] = 0;
LoadStringW(hModule, IDS_WEATHER_CLEAR_PROMPT, mbText, ARRAYSIZE(mbText));
if (MessageBoxW(hwnd, mbText, _T(PRODUCT_NAME), MB_ICONQUESTION | MB_YESNO) == IDYES)
{
DWORD dwData = 0, dwVal = 0, dwSize = sizeof(DWORD);
GUI_Internal_RegQueryValueExW(NULL, L"Virtualized_" _T(EP_CLSID) L"_PeopleBand", NULL, NULL, &dwData, &dwSize);
Expand All @@ -2133,21 +2132,27 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
PleaseWaitCallbackData = &res;
PleaseWaitCallbackFunc = GUI_Internal_DeleteWeatherFolder;
PleaseWaitHook = SetWindowsHookExW(WH_CALLWNDPROC, PleaseWait_HookProc, NULL, GetCurrentThreadId());
MessageBoxW(hwnd, L"Please wait...", _T(PRODUCT_NAME), 0);
mbText[0] = 0;
LoadStringW(hModule, IDS_WEATHER_CLEAR_WAIT, mbText, ARRAYSIZE(mbText));
MessageBoxW(hwnd, mbText, _T(PRODUCT_NAME), 0);
}
else
{
res = GUI_DeleteWeatherFolder();
}
if (res == IDOK)
{
MessageBoxW(hwnd, L"Weather widget data cleared successfully.", _T(PRODUCT_NAME), MB_ICONINFORMATION);
mbText[0] = 0;
LoadStringW(hModule, IDS_WEATHER_CLEAR_SUCCESS, mbText, ARRAYSIZE(mbText));
MessageBoxW(hwnd, mbText, _T(PRODUCT_NAME), MB_ICONINFORMATION);
}
else
{
if (res == IDABORT)
{
MessageBoxW(hwnd, L"An error has occured while clearing the data.", _T(PRODUCT_NAME), MB_ICONERROR);
mbText[0] = 0;
LoadStringW(hModule, IDS_WEATHER_CLEAR_FAILED, mbText, ARRAYSIZE(mbText));
MessageBoxW(hwnd, mbText, _T(PRODUCT_NAME), MB_ICONERROR);
}
}
if (dwData)
Expand Down
7 changes: 6 additions & 1 deletion ep_gui/resources/EPSettingsResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
#define IDS_WEATHER_LASTUPDATE 1553
#define IDS_WEATHER_UPDATE 1554
#define IDS_WEATHER_CLEAR 1555
#define IDS_WEATHER_CLEAR_PROMPT 1556
#define IDS_WEATHER_CLEAR_WAIT 1557
#define IDS_WEATHER_CLEAR_SUCCESS 1558
#define IDS_WEATHER_CLEAR_FAILED 1559

#define IDS_SP 1601
#define IDS_SP_HIDEICON 1602
Expand Down Expand Up @@ -379,6 +383,7 @@
#define IDS_ABOUT_SETTINGS 2011
#define IDS_ABOUT_IMPORT 2012
#define IDS_ABOUT_EXPORT 2013
#define IDS_ABOUT_RESET 2014
#define IDS_ABOUT_EXPORT_SUCCESS 2014
#define IDS_ABOUT_RESET 2015

#define IDS_FOOTER_RESTART 2101
1 change: 1 addition & 0 deletions ep_gui/resources/EPSharedResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define IDS_UPDATES_DLFAILED_T 311
#define IDS_UPDATES_DLFAILED_B 312
#define IDS_UPDATES_INSTALLEDVER 313
#define IDS_UPDATES_PROMPT 314

// 351-400

Expand Down
6 changes: 6 additions & 0 deletions ep_gui/resources/lang/ep_gui.en-US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BEGIN
IDS_UPDATES_DLFAILED_T "Update failed"
IDS_UPDATES_DLFAILED_B "The request was declined or an error has occured when attempting to install this update."
IDS_UPDATES_INSTALLEDVER "Installed version: %d.%d.%d.%d"
IDS_UPDATES_PROMPT "Would you like to install an update for ExplorerPatcher?\n\nDownloaded from:\n%s"

IDS_SYM_DL_T "Downloading symbols for OS build %s, please wait…"
IDS_SYM_DL_B "This may take several minutes. For now, ExplorerPatcher may have limited and/or broken functionality. Click here to learn more about symbols."
Expand Down Expand Up @@ -308,6 +309,10 @@ BEGIN
IDS_WEATHER_LASTUPDATE "Last updated on: %s, %s."
IDS_WEATHER_UPDATE "Update weather now"
IDS_WEATHER_CLEAR "Clear weather widget local data"
IDS_WEATHER_CLEAR_PROMPT "Are you sure you want to permanently clear the weather widget's local data?\n\nThis will reset the internal components to their default state, but will preserve your preferences. This may fix the widget not loading the data properly, or having layout issues etc."
IDS_WEATHER_CLEAR_WAIT "Please wait…"
IDS_WEATHER_CLEAR_SUCCESS "Weather widget data cleared successfully."
IDS_WEATHER_CLEAR_FAILED "An error has occured while clearing the data."

IDS_SP "Spotlight"

Expand Down Expand Up @@ -422,6 +427,7 @@ BEGIN
IDS_ABOUT_SETTINGS "Learn more managing these settings"
IDS_ABOUT_IMPORT "Import settings"
IDS_ABOUT_EXPORT "Export current settings"
IDS_ABOUT_EXPORT_SUCCESS "Settings have been exported successfully."
IDS_ABOUT_RESET "Restore default settings"

IDS_FOOTER_RESTART "Restart File Explorer"
Expand Down
2 changes: 1 addition & 1 deletion ep_gui/resources/settings.reg
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
;import
;u %R:2013%
;export
;u %R:2014%
;u %R:2015%
;reset


Expand Down
2 changes: 1 addition & 1 deletion ep_gui/resources/settings10.reg
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
;import
;u %R:2013%
;export
;u %R:2014%
;u %R:2015%
;reset


Expand Down

0 comments on commit fc17455

Please sign in to comment.