joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.59k stars 375 forks source link

[Japanese language] Menu translations #2554

Open maron2000 opened 3 years ago

maron2000 commented 3 years ago

I'm trying to prepare a Japanese translation, however, Dosbox-x menu seems that it cannot handle Japanese characters. I tried file-encoding both UTF-8 and Shift-JIS but it doesn't display properly. The screenshots below shows something, but not Japanese. Are there any other settings that I have to change? Thanks in advance.

Language file encoded in Shift-JIS translations2

Language file encoded in UTF-8 (PC-98 mode) translations

Wengier commented 3 years ago

First of all, thanks for preparing a Japanese translation.

There are 3 types of menus in various DOSBox-X builds, namely Windows SDL1 menu, macOS NSMenu, and SDL-drawn menu. The first two types of menus should support Japanese characters just fine (with the latest code). The last one (used by Windows SDL2 and Linux builds) unfortunately not at this time. Also, please make sure to use the latest DOSBox-X 0.83.14 testing builds for the Japanese translations, not DOSBox-X 0.83.13 release version, as version 0.83.14 (to be officially released by the end of month) improves general Chinese/Japanese/Korean support significantly, especially for TrueType font (TTF) output (set output=ttf and a Japanese TTF font e.g. ttf.font=UnifontFullMediumMono.ttf for UnifontFullMediumMono.ttf), and set country=81,932 so that Japanese support should work for all machine types, not just PC-98 mode.

Wengier commented 3 years ago

@maron2000 Below is a screenshot showing latest DOSBox-X 0.83.14 Windows SDL1 build above with Simplified Chinese translation (with language file zh_CN.lng) in TTF output:

image

maron2000 commented 3 years ago

@Wengier Thank you for your prompt reply. Good to see your reply, since I was struggling to find a way to confirm my translation on Dosbox-X. I managed to display it on main screen of PC-98 mode with some glitches, but I'll switch to 0.83.14 later on.

Edit: BTW, I prefer SDL2 build because it is more friendly to use Japanese keyboards. (or are there a way to use Japanese keyboard layout in SDL1 version?)

translations3

maron2000 commented 3 years ago

Tested the DOSBox-X 0.83.14 Windows SDL1 build, and confirmed the menu shown in Japanese. It's a huge improvement than the present version!

There are some glitches when using half-width Kana, as shown in the first line of the screenshot below. Also, when a line exceeds 80 columns there are glitches probably because of a hyphenation issue of multi-byte characters at the end of the line. (found in the 8th row explaining overlay option)

translations4

Wengier commented 3 years ago

@maron2000 Glad to hear that you confirmed that the menu now shows correctly in Japanese, and also thanks for pointing out the half-width Kana. I have added a new config option "ttf.halfwidthkana" in the code so that when you set it to true, then half-width Katakana will be displayed instead of upper ASCII characters A1-DF even for standard (non-PC98) modes with code page 932 in TTF output. Do note that by doing so there will be no longer ASCII box-drawing characters available as they are replaced with half-width Katakana. But you can toggle this option from the menu dynamically ("Video" => "TTF options" => "CJK: Allow half-width Japanese Katakana"), or with "config -set ttf.halfwidthkana=true/false".

A screenshot showing the ASCII characters with half-width Katakana (code page 932) using UnifontFullMediumMono.ttf uploaded by @roytam1 earlier.

image

The updated Windows SDL1 build based on the latest code:

Meanwhile, you can certainly upload your Japanese translation file for us to test out too, even if it is not yet finished. I am sure many people hope to see DOSBox-X with full Japanese interface.

For the Japanese keyboard, do you mean PC-98 mode or in general? In PC-98 mode the Japanese keyboard layout is always used (unless you set pc-98 force ibm keyboard layout = true), even for SDL1 builds of course. I don't have a Japanese keyboard to test myself, but I do notice the apparent differences between the setting pc-98 force ibm keyboard layout = true and pc-98 force ibm keyboard layout = false when I type various special keys on the keyboard, for both SDL1 and SDL2 builds.

As for lines exceeding 80 columns and happen to split DBCS characters, I suspect it may cause similar glitches in real DOS systems too, but you can always force a new line (inserting a "\n" for example) in such case so that they will be displayed correctly.

maron2000 commented 3 years ago

@Wengier Thanks for your update. I'll check your comments later on. Meanwhile, I uploaded the present version of my Japanese translation here. It's not finished, and I haven't proof-read it, but it may help anyway.

Edit: Changed link address (Changed my repository from clone to fork)

Wengier commented 3 years ago

@maron2000 Thanks for the Japanese language file! I see that the menu is almost fully translated, so are help messages of some DOS commands. Keep up the great work!

maron2000 commented 3 years ago

I noticed that if I display DOS command help from the menu, it switches to full-screen mode and shows help as the screenshot below. The font is not the TTF font set in config, and therefore seems to fail to display Japanese characters. I don't think to fix this is an urgent matter, but I think it better that DOSBox-x don't switch to full screen just to show a help.

BTW: The Japanese translation is mostly finished, though we have to check the alignment of words, etc. I decided not to use half-width katakana to consider people using box-characters, although it is useful to put more information in a single line. translations5

maron2000 commented 3 years ago

@Wengier Regarding the SDL1, SDL2 matter, the SDL1 version omits some keys in the Japanese keyboard. Your 0.83.14 SDL1 pre-release provided above seems that the problem is resolved to some extent, and I have no critical problems so far in using the SDL1 version. However, keys such as "Katakana/Hiragana" key is still not recognized in the mapper tool, and I cannot allocate the key to a certain function. (Mapper tool of 0.83.13 SDL2 version recognizes the "Katakana/Hiragana" key) This issue is applicable not only to PC-98 mode but the normal mode as well.

This is not related to the title of this thread, so may be I should start a new thread for this matter.

Wengier commented 3 years ago

@maron2000 Thanks for reporting. Yes, it is a known issue that the Configuration Tool interface (and SDL drawn menu) does not support DBCS characters at this time, although I had improved its compatibility with other SBCS code pages (e.g. 852 and 858) recently. We had also discussed that it may be possible to apply FreeType support to them so that they will support CJK characters too, but this will require more significant code changes and will not be included in the upcoming version.

The reason that the DOS command help function switches to full-screen mode automatically is that the DOSBox-X window size when in a windowed mode may be small, and in such cases the DOS command help window may only be shown partially. But I have changed the code so that if the DOSBox-X window is already maximized, then there will no longer be a full-screen switch.

For the Japanese keyboard, it is indeed a separate issue really. I don't have a Japanese keyboard myself, and below is a screenshot from the SDL2 build, and I wonder which key(s) you refer to above:

image

You can certainly open a separate thread with more such information. Thanks.

Wengier commented 3 years ago

@maron2000 Great to see that you have already finished the Japanese language translation by now (https://github.com/joncampbell123/dosbox-x/pull/2564). Well done!

maron2000 commented 3 years ago

@Wengier Thank you for your prompt response to my pull request. There are a few items not translated, and I want to clarify what it actually means before translated.

  1. :MENU:pc98_allow_4partitions Allow 4 display partitions in graphics layer I want to now what display partitions means.

  2. Regarding the 2 options in the "Debug" menu, I propose to put Japanese saying: :MENU:debug_pageflip : page flip debug line -> Display debug line (Write CRTC Register) デバッグ用ライン表示 (CRTCレジスタ書込み) . :MENU:debug_retracepoll : retrace poll debug line -> Display debug line (Read CRTC Status) デバッグ用ライン表示 (CRTCステータス読取り) . It may be too long to display in the menu, so I appreciate your advise for this.

joncampbell123 commented 3 years ago

@maron2000 PC-98 video hardware uses a video chipset by NEC that allows the display to be divided into "partitions" as defined by values written to a 16-byte RAM region on the device.

Firefox_Screenshot_2021-05-31T15-10-27 455Z

See also page 7-8 of this PDF file:

http://hackipedia.org/browse.cgi/Computer/Platform/PC%2c%20NEC%20PC%2d98/Video/NEC%20High%2dPerformance%20Graphics%20Display%20Controller%207220/%c2%b5PD7220%2c%20%c2%b5PD7220%2d1%2c%20%c2%b5PD7220%2d2%20Graphics%20Display%20Controller%2epdf

Wengier commented 3 years ago

@maron2000 These menu items were added by @joncampbell123 earlier, so you can take a look at his explanations. Meanwhile, I have updated the Japanese language file slightly, and you can certainly check it out.

P.S. I decided to buy a USB Japanese keyboard to try out myself, but the (international) delivery will take some time of course.

maron2000 commented 3 years ago

@joncampbell123 @Wengier Thank you for your comments. I understood the meaning of the 4 partition option, that it enhances the scrollable partitions of graphic mode of GDC from two to four. I believe that text mode of actual GDC already allows four partitions by default while it is two for graphic mode, according to the Features section (page 1-1) of uPD7220A Users manual provided at the same site you pointed out.

If my understanding is correct, I'll translate the option like: GDCのグラフィック分割領域を4つに拡張 (Enhance graphic partitions of GDC to four)

Wengier commented 3 years ago

@maron2000 I have updated this translation already, but please free feel to make further updates to the language file.

Wengier commented 3 years ago

With the release of DOSBox-X 0.83.14 support for Japanese language is improved further significantly (compared with earlier release versions), and the Japanese language file is available from contrib/translations/ja/ja_JP.lng. @yksoft1 may be interested in it too.

maron2000 commented 3 years ago

I'll close this issue, since translation of most of the items are finished.

Wengier commented 3 years ago

@maron2000 Thanks for the Japanese translation. Also, I would like to let you know that the Windows SDL2 build and Linux builds (both using SDL-drawn menu) now support Japanese menu text as well, as long as they are not using an OpenGL output. The updated Windows SDL2 build of DOSBox-X build is available from:

A screenshot using your Japanese language file:

image

Wengier commented 3 years ago

@maron2000 Furthermore, the DOS command help (which uses the Configuration Tool interface) should now show CJK characters too. An screenshot is available below:

image

In addition to the updated Windows SDL2 build above, the updated Windows SDL1 build is also available from:

roytam1 commented 3 years ago

A screenshot using your Japanese language file:

image

I think you did notice there is some kanji displayed glitchy

Furthermore, the DOS command help (which uses the Configuration Tool interface) should now show CJK characters too. An screenshot is available below:

image

and at least first line of kanji is not displayed in dialog.

Wengier commented 3 years ago

I think you did notice there is some kanji displayed glitchy

The first screenshot was intended to show the menu text in the menu bar, but I yes did notice the glitches in some Kanji of the welcome banner messages after I posted the screenshot. It was due to a bug in the border-character replacement code which has already been fixed, and the Windows binaries have been updated accordingly.

and at least first line of kanji is not displayed in dialog.

Yes, and this is because the Configuration Tool expects fonts of 14-pixel height, but the Japanese fonts to be used are 16-pixel height. I think it is the best result that can be achieved for now since it is not really noticeable I guess.

Wengier commented 3 years ago

A new screenshot showing both the welcome messages and the SDL-drawn menu in Japanese DOS/V mode:

image

And when using the JEGA machine and TrueType font (TTF) output:

image

maron2000 commented 3 years ago

@Wengier Hi, very nice to see a SDL2 version supporting menu in Japanese! Here is a link to a 14dot bitmap Japanese font. (from http://izumilib.web.fc2.com/sinonome/) It's a public domain font converted to FONTX2 style, where the original can be found here (http://openlab.ring.gr.jp/efont/shinonome/)

Wengier commented 3 years ago

@maron2000 Thanks for providing a 14-dot bitmap Japanese font! Since at this point it may only be used by DOS command help (and nothing else), I am not sure if integrating another DBCS font is a good idea at this time (but it will probably be so when the Configuration Tool becomes fully translatable). In any case, I have already added a "jfontdbcs14" config option (similar to other similarly-named config options in [render] section) which allows you to load such a font, and in this case this font file will be used instead of the default 16-dot bitmap Japanese font. Both Windows SDL1 and SDL2 builds have been updated accordingly:

Wengier commented 3 years ago

A screenshot showing the DOS command help with the use of this font:

image

Wengier commented 3 years ago

@maron2000 I have already added support for translations of the main Configuration Tool interface, and also integrated the 14-dot Japanese font you provided during this. Meanwhile, I have added some new entries in the Japanese language file (https://github.com/joncampbell123/dosbox-x/blob/master/contrib/translations/ja/ja_JP.lng) for the Configuration Tool text. Can you translate them accordingly? Thanks. The updated Windows builds are available from:

maron2000 commented 3 years ago

@Wengier Thank you for your information. I'll inform you after the translation is finished.

maron2000 commented 3 years ago

@Wengier I translated the added items, which can be found here. As you can see in the screenshot below, we need some more width in some boxes and/or use half-width katakanas in order to fit the translated words such as "キャンセル" (Cancel) and "クリップボードに貼付" (Paste Clipboard).

configtool_translated

Wengier commented 3 years ago

@maron2000 Thanks for the translation! I have already fixed the issue with button width, and some button layout has been adjusted too. You can get the latest Windows builds below:

A screenshot showing the [autoexec] section editor:

image

maron2000 commented 3 years ago

@Wengier Thank you, and I appreciate your prompt actions. I checked and see that most of the translation is okay. I made some minor fixes regarding overflow of boxes and line feeds, which can be found below. https://github.com/maron2000/dosbox-x-1/commit/eb84792f989d62b818e2d7399b4e8c71f4f055b6

Wengier commented 3 years ago

@maron2000 Thanks for the updates. I have uploaded it accordingly. Meanwhile, I have added the ability to translate the button names in the Mapper Editor interface (probably the last interface needing such support). In order to reduce the work to translate them, for most of them I decided to re-use the translated text from the drop-down menus. There are some remaining button names (along with some title names) needed to be translated though. And because of the re-use of menu text, there may be some overflow text in some buttons, so can you please fix them accordingly? If this is not possible, you can also manually add new mapper-specific labels (e.g. :MAPPER:caprawmidi) in the end of the language file so that these will be forced to be used instead of the text as used by the menu text. Please check out the updated Windows builds:

Thanks!

maron2000 commented 3 years ago

@Wengier I translated the items for Mapper Editor and uploaded it, which can be found below. https://github.com/maron2000/dosbox-x-1/commit/2c26102553bc4c44cc39fd0821685b639f178055

I made some minor changes in the existing translations for the menu bar etc. to make it consistent as much as possible. Though there are some boxes with text overflowing, but I think it is fairly acceptable. There are not enough space for the "Capture (キャプチャ)" button, so it may be better to enlarge the box for that button.

The items to translate for "Exit" button and the message while button capturing is on-going are missing, so it remains as English. The suggested translation for them are as follows. "Exit" -> "終了" "Capture enabled. Hit ESC to release capture." -> "キャプチャしています。ESCで終了します。"

mapper_editor_translation

Wengier commented 3 years ago

@maron2000 Thanks for the update. I think you probably downloaded an earlier build (which I updated again later), so there are some items missing in the language file (although this does not include "Capture enabled. Hit ESC to release capture". Can you check the new build? Thanks!

P.S. Support for DBCS text is now supported in OpenGL-mode SDL-drawn menu as well. So all types of DOSBox-X menus now support Chinese/Japanese/Korean characters by now.

maron2000 commented 3 years ago

@Wengier Sorry that I uploaded a translation file based on an old update. Please find the following updates. https://github.com/maron2000/dosbox-x-1/commit/2859779f1b2496c7388db8f3ef036363354baa23#diff-4f9d1948dde30cb07eba2822aa3e5e52077ddb3cd10d24bcfeaaf474b0f731e9

In Japanese, "Help" - "About" will be XXXXについて (About XXXX), and we cannot omit XXXX in this case. So in the menu bar, I translated "About" as "DOSBox-Xについて", which is very usual for other Japanese software as well. If you are to add "DOSBox-X" in the window as below, please consider adding it to the menu bar as well so that both menu bar and window displays are consistent.

:ABOUT
%s について (About %s in English)

about_dosbox

Wengier commented 3 years ago

@maron2000 Thanks. I have enlarged the relevant mapper buttons accordingly, so that the mapper interface should now look better (no overflow any more):

image

For the "About" button, I decided to re-use the "About DOSBox-X" text from the drop-down menu, so that the displayed text will be "About DOSBox-X" (or DOSBox-Xについて in Japanese) everywhere. Please check out the updated Windows builds:

Wengier commented 3 years ago

I have also added a Traditional Chinese language file below, using Simplified => Traditional Chinese conversion tool plus some manual fixes. If any Traditional Chinese user finds errors in the language file please let me know:

https://github.com/joncampbell123/dosbox-x/blob/master/contrib/translations/zh/zh_TW.lng

1abcd commented 3 years ago

@Wengier I am Traditional Chinese user, I made a lot of corrections to zh_TW translation. I wish I don't do the wrong action.

Wengier commented 3 years ago

@1abcd Thank you so much for the corrections! I am sure the language file is greatly improved with this. Please let me know if you find any issues with the Traditional Chinese system (or other things). Thanks!

Wengier commented 3 years ago

A screenshot showing the Traditional Chinese interface (with your updated language file in TTF mode with SarasaGothicFixed.ttf font):

image

Wengier commented 3 years ago

I tried to make a sample Korean language file for testing, and Korean characters appear to look fine in both Korean DOS/V and TTF modes. Only welcome messages and drop-down menu are translated with Google though for demo purpose:

A screenshot in TTF mode (code page 949) with SarasaGothicFixed.ttf font:

image