Multiple language-related updates

Add the possibility to change runtime language, via --lang parameter. Also specify the verbose language code in the Hungarian translation.
This commit is contained in:
Laci bá
2021-11-09 18:53:15 +01:00
parent 9903f0cec1
commit 9914ad520c
5 changed files with 40 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
//
#ifdef _WIN32
LANGUAGE 0x0E,0x01
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
#pragma code_page(65001)
#endif //_WIN32

View File

@@ -1163,6 +1163,23 @@ plat_vid_reload_options(void)
vid_apis[vid_api].reload();
}
/* Sets up the program language before initialization. */
int
plat_set_language(char* langcode)
{
int len = mbstoc16s(NULL, langcode, 0) + 1;
wchar_t *temp = malloc(len * sizeof(wchar_t));
mbstoc16s(temp, langcode, len);
LCID lcid = LocaleNameToLCID((LPWSTR)temp, 0);
free(temp);
if (lcid)
return (SetThreadUILanguage(lcid) == lcid);
else
return 0;
}
void
take_screenshot(void)