Added Hebrew translation.

Switched to MessageBoxW in some places.
This commit is contained in:
Muzychenko Andrey 2021-10-31 13:18:21 +03:00
parent 1c1fbcb811
commit 1428fb3770
7 changed files with 23 additions and 12 deletions

View File

@ -49,7 +49,7 @@ int Sound::Init(HINSTANCE hInstance, int voices, void (* someFuncPtr)(int, MIXWA
{ {
/*FT does not have the file, defaults work OK*/ /*FT does not have the file, defaults work OK*/
if (!pb::FullTiltMode) if (!pb::FullTiltMode)
MessageBoxA(winmain::hwnd_frame, pinball::get_rc_string(42, 0), "", 0x2000u); MessageBoxW(winmain::hwnd_frame, pinball::get_rc_Wstring(42, 0), L"", 0x2000u);
} }
WndClass.style = 0; WndClass.style = 0;

View File

@ -185,7 +185,6 @@ INT_PTR high_score::HighScore(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
HWND parent; HWND parent;
int nIDDlgItem; int nIDDlgItem;
CHAR String1[256];
CHAR name[32]; CHAR name[32];
switch (msg) switch (msg)
@ -247,8 +246,8 @@ INT_PTR high_score::HighScore(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case DLG_HIGHSCORES_Cancel: case DLG_HIGHSCORES_Cancel:
break; break;
case DLG_HIGHSCORES_Clear: case DLG_HIGHSCORES_Clear:
lstrcpyA(String1, pinball::get_rc_string(41, 0)); if (MessageBoxW(hWnd, pinball::get_rc_Wstring(40, 0),
if (MessageBoxA(hWnd, pinball::get_rc_string(40, 0), String1, MB_DEFBUTTON2 | MB_OKCANCEL) == 1) pinball::get_rc_Wstring(41, 0), MB_DEFBUTTON2 | MB_OKCANCEL) == 1)
{ {
clear_table(dlg_hst); clear_table(dlg_hst);
if (dlg_enter_name) if (dlg_enter_name)

View File

@ -84,6 +84,7 @@ LanguageMenuEntry options::LanguageMenu[]
{L"Čeština", Languages::Czech}, {L"Čeština", Languages::Czech},
{L"Dansk", Languages::Danish}, {L"Dansk", Languages::Danish},
{L"Suomi", Languages::Finnish}, {L"Suomi", Languages::Finnish},
{L"עִברִית", Languages::Hebrew},
}; };
void options::ReadOptions() void options::ReadOptions()

View File

@ -18,6 +18,7 @@ enum class Languages
Czech = MAKELANGID(LANG_CZECH, SUBLANG_CZECH_CZECH_REPUBLIC), Czech = MAKELANGID(LANG_CZECH, SUBLANG_CZECH_CZECH_REPUBLIC),
Danish = MAKELANGID(LANG_DANISH, SUBLANG_DANISH_DENMARK), Danish = MAKELANGID(LANG_DANISH, SUBLANG_DANISH_DENMARK),
Finnish = MAKELANGID(LANG_FINNISH, SUBLANG_FINNISH_FINLAND), Finnish = MAKELANGID(LANG_FINNISH, SUBLANG_FINNISH_FINLAND),
Hebrew = MAKELANGID(LANG_HEBREW, SUBLANG_HEBREW_ISRAEL),
}; };
struct LanguageMenuEntry struct LanguageMenuEntry

View File

@ -242,7 +242,7 @@
#define DLG_HIGHSCORES_EditName5 605 #define DLG_HIGHSCORES_EditName5 605
#define Menu1_AlternativeRender 601 #define Menu1_AlternativeRender 601
#define Menu1_Language 700 #define Menu1_Language 700
#define Menu1_LanguageMax 714 #define Menu1_LanguageMax 715
// Next default values for new objects // Next default values for new objects
// //

View File

@ -165,8 +165,18 @@ int winmain::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
pinball::FindShiftKeys(); pinball::FindShiftKeys();
options::init_resolution(); options::init_resolution();
// Some languages use RTL layout
DWORD dwExStyle;
switch (options::Options.Language)
{
case Languages::Hebrew:
dwExStyle = WS_EX_LAYOUTRTL;
break;
default:
dwExStyle = 0;
}
auto windowName = pinball::get_rc_Wstring(38, 0); auto windowName = pinball::get_rc_Wstring(38, 0);
windowHandle = CreateWindowExW(0, windowClass, windowName, windowHandle = CreateWindowExW(dwExStyle, windowClass, windowName,
WndStyle, 0, 0, 640, 480, nullptr, nullptr, hInstance, nullptr); WndStyle, 0, 0, 640, 480, nullptr, nullptr, hInstance, nullptr);
hwnd_frame = windowHandle; hwnd_frame = windowHandle;
@ -600,9 +610,9 @@ LRESULT CALLBACK winmain::message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LP
iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd); iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd);
if (static_cast<int>(WinExec(cmdLine, 5u)) < 32) if (static_cast<int>(WinExec(cmdLine, 5u)) < 32)
{ {
auto caption = pinball::get_rc_string(170, 0); auto caption = pinball::get_rc_Wstring(170, 0);
auto text = pinball::get_rc_string(171, 0); auto text = pinball::get_rc_Wstring(171, 0);
MessageBoxA(hwnd_frame, text, caption, 0x2010u); MessageBoxW(hwnd_frame, text, caption, 0x2010u);
} }
memory::free(tmpBuf); memory::free(tmpBuf);
} }
@ -774,9 +784,9 @@ void winmain::memalloc_failure()
midi::music_stop(); midi::music_stop();
Sound::Close(); Sound::Close();
gdrv::uninit(); gdrv::uninit();
char* caption = pinball::get_rc_string(170, 0); auto caption = pinball::get_rc_Wstring(170, 0);
char* text = pinball::get_rc_string(179, 0); auto text = pinball::get_rc_Wstring(179, 0);
MessageBoxA(nullptr, text, caption, 0x2030u); MessageBoxW(nullptr, text, caption, 0x2030u);
_exit(1); _exit(1);
} }