mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[loc] fix various RTL issues
* MSG_002 doesn't display in RTL * Update Policy dialog loses RTL setting after the first paragraph * Some text displayed in native Windows message boxes is not using RTL (even as the Message Box itself will display the rest of the UI elements as RTL) * Detect if the relevant language pack is installed and use MessageBoxEx to display native message box buttons using the selected language. * All theses issues are part of #621 * Also remove trailing whitespaces
This commit is contained in:
parent
236bf77c24
commit
e1f8b276c8
12 changed files with 190 additions and 110 deletions
|
@ -66,7 +66,7 @@ extern "C" {
|
|||
#define isdigitU(c) isdigit((unsigned char)(c))
|
||||
#define isspaceU(c) isspace((unsigned char)(c))
|
||||
#define isxdigitU(c) isxdigit((unsigned char)(c))
|
||||
// NB: other issomething() calls are not implemented as they may require multibyte UTF-8 sequences to be converted
|
||||
// NB: other issomething() calls are not implemented as they may require multibyte UTF-8 sequences to be converted
|
||||
|
||||
#define sfree(p) do {if (p != NULL) {free((void*)(p)); p = NULL;}} while(0)
|
||||
#define wconvert(p) wchar_t* w ## p = utf8_to_wchar(p)
|
||||
|
@ -209,6 +209,20 @@ static __inline int MessageBoxU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __inline int MessageBoxExU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId)
|
||||
{
|
||||
int ret;
|
||||
DWORD err = ERROR_INVALID_DATA;
|
||||
wconvert(lpText);
|
||||
wconvert(lpCaption);
|
||||
ret = MessageBoxExW(hWnd, wlpText, wlpCaption, uType, wLanguageId);
|
||||
err = GetLastError();
|
||||
wfree(lpText);
|
||||
wfree(lpCaption);
|
||||
SetLastError(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline int DrawTextU(HDC hDC, LPCSTR lpText, int nCount, LPRECT lpRect, UINT uFormat)
|
||||
{
|
||||
int ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue