WinBoard translations

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

WinBoard translations

Post by hgm »

I could lay my hand on a Chinese translation of WinBoard 4.2.7. I ws able to extract the translation, and apply it to a recent WinBoard version. This required a bit of hand tweaking, as some of the strings are slightly changed (e.g. by indicating a menu-tabbing character, or listing the accelerator key with the menu item) in a way that did not really affectthe translation. (But it did thwart the automatic process of applying it.)

Of course there are also many new strings, but the Chinese translation provded actually an excellent handle to find those automatically. (I only had to look for Roman characters between quotes, something that would not have worked in most other languages. :lol: )

I am playing with the idea to let all strings displayed by WinBoard come from a file. That should be relatively easy to accomplish, once they are all identified. Would there be people that are willing to translate such a file to their native language?
User avatar
phhnguyen
Posts: 1437
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: WinBoard translations

Post by phhnguyen »

I can help for Vietnamese :)
Nettogrof

Re: WinBoard translations

Post by Nettogrof »

I can help for the french version
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: WinBoard translations

Post by Greg Strong »

I'm sure my wife would be happy to do Russian and Ukrainian translations.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: WinBoard translations

Post by stegemma »

If you need it, i can translate to italian.

I've restarted chess programming... maybe we will meet in the next italian tourney?
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard translations

Post by hgm »

Well, there is more enthusiasm than I had expected! Now let's hope no one will be discouraged because of the magnitude of the job: it might be a lot tougher than expected. So far I located about 850 strings that need translation: menu items, dialog text, displayed message.

Some might not need a translation, or might not even have one. (Like the variant names. Also all these fancifull names for board sizes could be simply 'translated' by replacing them by the square size in pixels.)

I collected all strings in a file 'lang450.txt', which I put on-line here. It contains lines of the format:

Code: Select all

"English string" === ""
The idea is that the translators would write the translated string between the second pair of quotes, like

Code: Select all

"English string" === "translated string"
I can then use the file as an editor script to process the source files, thus applying the translation. This way the translation will be more durable, as it can be easily applied to future versions as well. (Altered or new strings will then remain untranslated, of course; they will have to be added to the scripts.)

Note there are already some translated versions of earlier WB versions around; they should contain about 70% of the needed strings. So it really makes sense to salvage those. For instance, I could locate a Russian version of 4.2.6 here:

http://www.sbor.net/~avs/winboard/winboard_ru.html

I thought I once had seen a Russian translation of an even newer WB version (perhaps even 4.4.0), but I could not find it through Google now. Perhaps a Russian reader can help us out here?

I also know there is a Spanish version around (of WinBoard 4.2.7 or Winboard_x?).

Currently, the translations are _static_, i.e. they are done by modifying the source, and recompiling. This has the obvious disadvantage that each language needs a separate executable. In the future, I hope to be able to let WB do the translation at run time, by having it read the applicable language script at startup, and use it to replace its compiled-in strings. Implemented that way, it could even be made possible to switch language during the session!

Note that some translations will be more troublesome than others: to translate to languages that use Roman script, replacing the strings is all there is to it. For Russian, it is also required to change the font. For Chinese (and Vietnamese?) it will be necessary to change the text encoding, and this can be a bit tricky. The Chinese translation uses a 1-byte/char encoding in the source, so that each Chinese character shows up as two (garbage) characters there (and not as Chinese!). At least, when I use my NotePad or WordPad to view or edit it. Only when compiled on a Chinese Windows system, you will actually get a WinBoard that displays Chinese characters in its menus (on that Chinese system; for me the same .exe still prints garbage...). Such Chinese systems would also display the Chinese in the source when they view it through NotePad.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard translations

Post by hgm »

OK, I made some good progress:

I managed to have WinBoard apply the translation at run time. (Mostly so; I had to do it per dialog, as you can only do it while the dialog is up, and I might have missed one or two.)

I added an option /language=XXX, where XXX must be the name of a translation file. So you could make a file called "French", with lines in it like "&File" === "&Fichier", and WinBoard will use the translated string. (Does not work for the startup dialog yet, as that is apparently popped up before I read the translation file.) As far as I could judge, translation of all elements works now: Title bar, dialog items, menus,printed strings. (I still have to do mark of the latter in the source as translatable, but most already work.)

For those who want to try this (very rough) version, it can be downloaded from http://hgm.nubati.net/winbo_int.zip .
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard translations

Post by hgm »

I uploaded a new version, which now also translates the startup dialog. (Same link.)
User avatar
nanochess
Posts: 64
Joined: Thu Feb 19, 2009 5:34 pm
Location: Mexico, Mexico

Re: WinBoard translations

Post by nanochess »

I can check the Spanish version 8-)
All good things are difficult to achieve.
Toledo Nanochess book http://www.amazon.com/Toledo-Nanochess- ... 1304864375
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard translations

Post by hgm »

Great! I just extracted the Spanish translation made by Fransisco Garcia from WinBoard 4.2.6, and put it at:

http://hgm.nubati.net/espanol.lng

This was a very complete translation: even the help file was translated in Spanish for a large part! (I did not put that on line.) Of course there are many new strings now, and some strings are slightly altered, so they are not recognized anymore. Anyway, I already shaped up the main menus a little bit, so that these are recognized again. So when you put this file in the same folder as winboard.ee, starting with

winboard /language=espanol.lng

you should already see a lot of Spanish in the menus and dialogs. It would just be a matter of adding the missing strings, copying them from lang450.txt, and completing the Spanish translation.