Open ptakgit opened 3 years ago
Glad to hear that you have started the translation of messages. Please note that the language file the code page being saved is generally expected to match the DOS code page (inside DOSBox-X), so as a general rule if you use the code page 852 (Central Europe) in DOSBox-X, then these messages should be saved in this code page (852) as well.
There is indeed an exception: for Windows SDL1 builds, the messages for text in the drop-down menus do need to be saved in code page 1250 instead in this case, because Windows SDL1 builds use Windows's native menu in which the menu text is displayed using the Windows-only code page 1250, instead of the DOS code page inside DOSBox-X. This is considered an exception. I would suggest you to translate Czech messages for Windows SDL2 builds at start, which (like Linux builds) use internal code page instead of Windows GUI for the drop-down menus. Just save the language file using code page 852 and it should work. You can download the MinGW SDL2 build here:
After that you can convert the portion of the text in the language file for all drop-down menu text from code page 852 to code page 1250 using any conversion utility, and save the whole file in a different name specifically for Windows SDL1 builds. If you look at the Spanish message translation you will find two language files below, one for general builds and one specifically for Windows SDL1 builds:
https://github.com/joncampbell123/dosbox-x/tree/master/contrib/translations/es
Hope this helps.
That's a good point... DOSBox-X already contains guest code page to host Unicode conversion code. Perhaps the menu code should run the translated menu text through it as well, then feed the Unicode string to the WCHAR version of the Windows menu API i.e. SetMenuTextW instead of SetMenuTextA.
Win32 programmers haven't had to worry about lack of *W functions since Windows 95, it should be fine.
Mac OS builds could do the same, converting to (I assume UTF-8?) for the NSMenu objects.
Thank you, I will accept your recommendation. But - the main form left up corner windows should be converted in SDL2 form 852 to 1250 CP. In the picture below is text in messages.txt in CP1250 and are shown correctly, it is means that messges in 852 CP will be incorrect.
@ptakgit Windows since NT and Windows 98 are primarily Unicode based. The proposed change will not convert CP852 to CP1250, it will convert CP852 to Unicode and then feed it to the Unicode versions of the Windows API involving menus so it can display properly regardless of the host code page and system language.
Ideally on Mac OS the NSMenu can accept similar conversion from CP852 to UTF-8 Unicode.
The only odd one out is the in-window drawn SDL menu on Linux.
Unfortunatelly in SDL2 version are menu messages incorrect. The message.txt is now in CP852. Maybe the menu font is not for East Europe? Partially translated messages.txt, CP852 messages.txt messages.txt
Picture of the menu - red words are right text
@ptakgit You are apparently talking about the Windows system menu which will show up in both Windows SDL1 and SDL2 builds. But if DOSBox-X can convert text for Windows menu and macOS NSMenu like @joncampbell123 mentioned automatically, then this is hopefully no longer a problem.
@ptakgit Try the updated MinGW builds. The update mainly addresses the Windows system menu issue since the next version is approaching.
64-bit SDL1: dosbox-x-mingw64.zip 64-bit SDL2: dosbox-x-mingw64-sdl2.zip
For SDL1 build, you can try this for code page 852 and see the menu text.
dosbox-x -lang messages.txt -set country=42,852 -set output=ttf -defaultconf
I tested the both version but in both case the main menu is incorrect. Window menu (left up corner) is correct. Maybe the problem is wrong menu font setting - for CP 1250 it must be set with Eastern Europe charset (EASTEUROPE_CHARSET 238)?
SDL1 window menu - correct.
SDL1 main menu - incorrect.
SDL2 window menu - correct.
SDL2 main menu - incorrect.
Messages code page 1250 (partially translated) messages.txt
Messages code page 852 (partially translated) messages852.txt
@ptakgit As I mentioned earlier the updated builds are focusing on the fix on the Windows system menu (left up corner). Making the main drop-down menu fully Unicode compatible will be for all platforms and thus a bigger project, which will likely come later.
OK. I will temporary solve it with translation message.txt to the text without diacritics.
@ptakgit You can do that of course, but you can also make another language file with diacritics as normal (code page 852 or another suitable code page for your language), which will eventually be supported on all platforms.
Last question - is in the DOSBOX-X version you sended me ebove included also the modification https://github.com/joncampbell123/dosbox-x/commit/427fd343cd33ec437e20d3dbd004ca1484f118d0 for the faster file copying? I tested copying now with the same long time result.
@ptakgit Yes, it does. But please, use the default setting (instead of your own config file) for the testing. For example, I already mentioned above that for SDL1 build, you can try this for code page 852:
dosbox-x -lang messages852.txt -set country=42,852 -set output=ttf -defaultconf
The result may be different from using your own config file.
@ptakgit Please try the updated 64-bit MinGW SDL1 build. With your messages852.txt file both the main drop-down menu and the Windows system menu should look fine with the correct keyboard layout (e.g. keyboardlayout=cz
):
Screenshot for the main menu:
So you should be able to translate text with diacritics normally already. Thanks.
Some items are OK, other are wrong - see the picture.
I found the reason of the wrong texts. CodePage wasn't correct. For setting country and codepage doesn't works option [config] country=42,852 in .conf file! Only country has been setted on my DOSBOX-X, not codepage! It could be solved by the command chcp 852 in the [autoexec] section, but the country option doesn't works compatible with DOS. Second correct possibility is to start DOSBOX-X with parameters -set country=42,852, but using country= ... in the config should be possible also.
In conclusion - the translation of the menu now probably works, so I will continue with the translation into Czech. But please also look at the code page settings in the .conf file.
@ptakgit Just let you know the main factor for the current version for the local switch is the KEYB command (or keyboardlayout
config option), not the country config option. The KEYB command (or keyboardlayout
config option) will change the keyboard layout and also apply the appropriate code page. The code page in the country config option is mainly for the TTF output (the built-in CHCP command is only for TTF output) For the country code, you can also separately set it using COUNTRY command in the DOS shell instead of using country config option.
@ptakgit Please check out the updated 64-bit MinGW SDL1 build. It now supports saving to and loading from UTF-8 encoded language files, so I think you can just save your language file in UTF-8 instead of local code pages (852 etc). Also, you can just set country=42,852 for this as before.
The welcome banner messages have also been reorganized so that translating them from stretch should be easier than before (and more compatible with other code pages too), but for the existing language file(s) please copy the old translated text for the welcome banner messages manually.
I translated only part of the menu messagess to now. But translated menu texts are now correct in 852CP and UTF-8. If I will found any problem with menu, I will send a report. Thank you.
@ptakgit Just let you know that you can now also use the Windows SDL2 build for the menu translation, which should support language files in local code pages and UTF-8 too. It is always safer to set both country
and keyboardlayout
options (e.g. country=42,852
and keyboardlayout=cz
) in the config file. The MinGW SDL2 build based on the current code is available from:
SDL2 is also OK.
@ptakgit We have made some small improvements to the language files following the discussion in #2326 in the last a few days. The updated 32-bit Visual Studio builds are available below:
@ptakgit I have been using your (partially-translated) Czech language file for verifying the multi-language functionality of different types of menus (including the SDL-drawn menu), and it has indeed helped a lot. Please let me know if there is any update on the Czech language file. Thanks!
P.S. There have been major improvements for the multi-language feature in the last a few weeks. The latest Windows SDL1 and SDL2 builds are available from the same links in my previous post.
I've been busy lately, I won't be able to continue the translation until about July. After I finish it, I will send it. I downloaded the June version and it looks good. Thanks.
I started to translate the DOSBOX-X 'messages into the Czech language. But there is one problem with the code pages. In the czech Windows is used codepage 1250. I suppose, that the message.txt should be written with this (Windows) codepage, because translated messages for the menu are OK. But diacritics in messages for "PROGRAM" are wrong in the DOSBOX-X (for example :PROGRAM_CONFIG_PRIMARY_CONF), because there is used (correct ) CP852. IMHO the DOSBOX-X should translate these messages from windows codepage to the DOSBOX-X environment codepage. Is it correct idea?