Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: IvKir on February 26, 2011, 12:43:01 am

Title: Russian translating
Post by: IvKir on February 26, 2011, 12:43:01 am
Hi, guys... got a problem here.

I, with help Kir2Yar started think about making a russian translate of OpenFS, but encounter a little problem... FS don't understand a cyrillic symbols ant Unicode... is there a way to solve this?
Title: Re: Russian translating
Post by: SypheDMar on February 26, 2011, 12:58:22 am
Unfortuntaely, FS_Open doesn't support Unicode yet, and implementing other characters have not been done yet. There was an off-shoot that did a Japanese translation, but that's not part of SCP.
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 01:29:31 am
Can we add this to wishlist?
Translation made by a hack of fonts - not so good.

Need support for Unicode in the briefing screens, messages, missions, and debriefing. It would be nice to have support for Unicode in the technical description room.

I may be sloppy writing in English, but I can translate to Russian. Plus ivkir promised to help. Already two translators. )

Give us the opportunity to do something useful for the community! )))

I do not ask support for Unicode in multiplayer, so that the network compatibility is not affected, I guess.
Title: Re: Russian translating
Post by: Nuke on February 26, 2011, 02:48:52 am
while designing yet another serial interface stack for one of my mcu projects, i came up with sort of a solution to move 8 bit characters with only 7 bits available in a byte  (8th bit is used for sync purposes). 7-bit is good enough for the lower 128 char slots so pretty much all english characters work (point of this is configuration of firmware settings over a terminal connection), but there are situations where you want special chars of the extended set. what ive kinda done to support 8-bit chars is to use one of the seldom used escape codes to indicate that the current character is to be ignored and the next character will have 128 added to it to allow access to the special chars. this essentially requires a second byte to store the new char value.

apply this sort of thing to freespace, where an 8 bit char is used. if a character was of a specific value (a special unused character), then this character would be ignored and the next would have a pre-defined value added to it. so if you used the device control 1 character (an unused char from the dot matrix printer era), then the next char would be its value + 256, dc2 may indicate to add 512 to the value of the next char and so on (depending on how many characters you need). internally the game would just see an 8-bit string, only text rendering code need be told what these special characters mean.

as for font files, depending on how many characters are supported, you may need to have multiple font sets for the same logical font. first file would contain chars 0-255, second file would contain chars 256-511 and so on, to correspond to what control character was used before it. kind of hackish, but would allow support of character sets that would otherwise be impossible without unicode.
Title: Re: Russian translating
Post by: PMY on February 26, 2011, 08:08:51 am
I can help with russian translation too. Of course if there will be means to do this.
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 08:37:28 am
while designing yet another serial interface stack for one of my mcu projects, i came up with sort of a solution to move 8 bit characters with only 7 bits available in a byte  (8th bit is used for sync purposes). 7-bit is good enough for the lower 128 char slots so pretty much all english characters work (point of this is configuration of firmware settings over a terminal connection), but there are situations where you want special chars of the extended set. what ive kinda done to support 8-bit chars is to use one of the seldom used escape codes to indicate that the current character is to be ignored and the next character will have 128 added to it to allow access to the special chars. this essentially requires a second byte to store the new char value.

apply this sort of thing to freespace, where an 8 bit char is used. if a character was of a specific value (a special unused character), then this character would be ignored and the next would have a pre-defined value added to it. so if you used the device control 1 character (an unused char from the dot matrix printer era), then the next char would be its value + 256, dc2 may indicate to add 512 to the value of the next char and so on (depending on how many characters you need). internally the game would just see an 8-bit string, only text rendering code need be told what these special characters mean.

You reinvented UTF-8 (http://en.wikipedia.org/wiki/UTF-8)

as for font files, depending on how many characters are supported, you may need to have multiple font sets for the same logical font. first file would contain chars 0-255, second file would contain chars 256-511 and so on, to correspond to what control character was used before it. kind of hackish, but would allow support of character sets that would otherwise be impossible without unicode.

...or just use system fonts for nonASCII.
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 08:49:48 am
I can help with russian translation too. Of course if there will be means to do this.

If in the engine Unicode is fully supported, we will have a mass of fascinating work. ) Not only the original campaign, but at least the blue planet too.

--ru
Если в движке юникод, то у нас будет масса увлекательной работы. ) Не только оригинальная кампания, но и как минимум голубую планету тоже надо перевести. ))
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 08:50:39 am
I can help with russian translation too. Of course if there will be means to do this.

If in the engine Unicode is fully supported, we will have a mass of fascinating work. ) Not only the original campaign, but at least the blue planet too.

--ru
Если в движке будет юникод, то у нас будет масса увлекательной работы. ) Не только оригинальная кампания, но и как минимум голубую планету тоже надо перевести. ))
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 09:07:13 am
Posted in Mantis.

http://scp.indiegames.us/mantis/view.php?id=2405
Title: Re: Russian translating
Post by: PMY on February 26, 2011, 09:10:57 am
Да, там куча кампаний/модов, достойных перевода: порт FS1, ST: Reborn, Inferno, The Babylon Project и т.д..
Title: Re: Russian translating
Post by: Nuke on February 26, 2011, 02:11:31 pm
while designing yet another serial interface stack for one of my mcu projects, i came up with sort of a solution to move 8 bit characters with only 7 bits available in a byte  (8th bit is used for sync purposes). 7-bit is good enough for the lower 128 char slots so pretty much all english characters work (point of this is configuration of firmware settings over a terminal connection), but there are situations where you want special chars of the extended set. what ive kinda done to support 8-bit chars is to use one of the seldom used escape codes to indicate that the current character is to be ignored and the next character will have 128 added to it to allow access to the special chars. this essentially requires a second byte to store the new char value.

apply this sort of thing to freespace, where an 8 bit char is used. if a character was of a specific value (a special unused character), then this character would be ignored and the next would have a pre-defined value added to it. so if you used the device control 1 character (an unused char from the dot matrix printer era), then the next char would be its value + 256, dc2 may indicate to add 512 to the value of the next char and so on (depending on how many characters you need). internally the game would just see an 8-bit string, only text rendering code need be told what these special characters mean.

You reinvented UTF-8 (http://en.wikipedia.org/wiki/UTF-8)

as for font files, depending on how many characters are supported, you may need to have multiple font sets for the same logical font. first file would contain chars 0-255, second file would contain chars 256-511 and so on, to correspond to what control character was used before it. kind of hackish, but would allow support of character sets that would otherwise be impossible without unicode.

...or just use system fonts for nonASCII.

its not quite the same as utf-8. utf-8 uses the most significant bit to indicate non-ascii character is in use. so if its one then the number of ones indicate the length of the sequence, and every other byte starts with 10 as its most significant bits, extending the character with the remaining bits. its somewhat less efficient for other languages and require 3 or 4 byte sequences for them, but its reverse compatable with ascii. my method involved using at most 2 bytes per character, and depending on available control codes could probably pull off a 12 bit equivalent character set (a 9 or 10 bit equivalent font would probably cover the char set for any languages).

the real issue is freespace's raster font format. it currently only supports 8-bit fonts. my idea would would use the same raster format. languages that cant be represented with ascii would need to load alternative font files, and languages that cant be represented with 8 bit char sets would use the encoding method above and load extra font files to represent the  +256, +512, and so on characters.

actually there was talk of a utf-8 implementation in order to support asian languages awhile back. though im not entirely sure its gone anywhere. though simply allowing that encoding method doesn't eliminate the issue with the 8 bit raster fonts, which are somewhat non-standard. i think our options are to support a standard format for font rendering (meaning freespace fonts would need to be created in those formats), or extend the existing raster font. you must also consider that reverse compatibility (the mantra of the scp) with retail fonts must be preserved. it might just be easier to support language specific 8-bit fonts with non-standard mapping and the existing format. then use special encoding and extended fonts for languages that need them.
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 03:02:05 pm
actually there was talk of a utf-8 implementation in order to support asian languages awhile back. though im not entirely sure its gone anywhere. though simply allowing that encoding method doesn't eliminate the issue with the 8 bit raster fonts, which are somewhat non-standard. i think our options are to support a standard format for font rendering (meaning freespace fonts would need to be created in those formats), or extend the existing raster font. you must also consider that reverse compatibility (the mantra of the scp) with retail fonts must be preserved. it might just be easier to support language specific 8-bit fonts with non-standard mapping and the existing format. then use special encoding and extended fonts for languages that need them.

Em... Can we use raster font for eu_US locale, and the system fonts to other locales?
As far as I know, for the subtitles, we use the system font.

Also, if freespace can use 8-bit fonts, then we can just use the localized code page, such as cp1251 or koi8-r. But in my opinion - it over time will create more problems for us.
Title: Re: Russian translating
Post by: kir2yar on February 26, 2011, 03:12:40 pm
Question for developers: The engine can use characters from 128 to 255? That is, whether it is possible to draw a bitmap font, without breaking compatibility with the standard?
Title: Re: Russian translating
Post by: Goober5000 on March 02, 2011, 11:18:11 pm
This is a very interesting thread. :)

Kir2yar, as you have probably figured out, the engine does not currently support Unicode.  However, our group has a long-term goal of adding Unicode support.  This will most likely be done through the wxWidgets toolkit.  Is this something that you might be interested to help with?

In the short term, I am not sure whether the font supports characters from 128 to 255.  I think it does, provided the font.vf file has bitmaps in those locations.  (The English font has blank bitmaps for characters above 128.)
Title: Re: Russian translating
Post by: kir2yar on March 09, 2011, 08:52:18 am
This is a very interesting thread. :)

Kir2yar, as you have probably figured out, the engine does not currently support Unicode.  However, our group has a long-term goal of adding Unicode support.  This will most likely be done through the wxWidgets toolkit.  Is this something that you might be interested to help with?

In the short term, I am not sure whether the font supports characters from 128 to 255.  I think it does, provided the font.vf file has bitmaps in those locations.  (The English font has blank bitmaps for characters above 128.)

I can translate text, but i don't familiar with wxWidgets, so i don't think i can help with it.
Also - is there any way to edit fonts.vf?

And one more thing - is there any way to separate texts in mission from mission itself... i  mean - description and briefing ant etc is in one file with mission file. Can we separate it?
Title: Re: Russian translating
Post by: chief1983 on March 09, 2011, 09:50:13 am
There is a custom font creation tool, it's a bit tricky to use, but there's a thread around here somewhere with some detailed instructions on how to best work with it.  I believe it makes those .vf files.
Title: Re: Russian translating
Post by: kir2yar on March 09, 2011, 11:53:32 am
There is a custom font creation tool, it's a bit tricky to use, but there's a thread around here somewhere with some detailed instructions on how to best work with it.  I believe it makes those .vf files.

If I can edit the fonts, then I can start translating using cp1251 or koi8-r.
Title: Re: Russian translating
Post by: karajorma on March 09, 2011, 06:19:55 pm
And one more thing - is there any way to separate texts in mission from mission itself... i  mean - description and briefing ant etc is in one file with mission file. Can we separate it?

You shouldn't ever be editing the mission file. strings.tbl and tstrings.tbl are what you want to be translating.
Title: Re: Russian translating
Post by: kir2yar on March 10, 2011, 03:30:24 am
You shouldn't ever be editing the mission file. strings.tbl and tstrings.tbl are what you want to be translating.

Thank you. Strangely, when I experimented with FRED, my text saved in the mission.

I understand the font is edited by volution tool kit?
That means the first thing I should do - to draw cp1251-compatible font.
Once I do that, it will be possible to begin the translation itself. Most likely, it does not even require any changes to the code.
Title: Re: Russian translating
Post by: kir2yar on March 10, 2011, 10:29:57 am
Original FS and FS2 translated by Fargus. As soon as I find the CD, I'll see can I use the fonts from there.
Title: Re: Russian translating
Post by: Tomo on March 10, 2011, 01:15:09 pm
Thank you. Strangely, when I experimented with FRED, my text saved in the mission.
Not strange at all.
The way translation works is as follows:

The mission file contains a "default language" version of the mission (English) and every bit of text in that mission file has an ID number.

When you play the game in a different language, the game reads that ID number and looks up the appropriate translation using chosen language and this ID from tstrings.tbl.
If it finds one, it shows the translation, and if it doesn't, it shows the "default language" string instead.

So the reason karajorma said that you shouldn't be editing the mission file is because that would actually delete the English version!
In order to add a new language you have to edit strings.tbl and tstrings.tbl instead.

That said, you're absolutely right that the first step is getting a suitable font.
Title: Re: Russian translating
Post by: karajorma on March 10, 2011, 05:08:27 pm
Yep. The reason why you should edit those tables is that the translations become future-proofed to a large degree. If you edit the missions you need to support them through any changes the SCP make. If some new feature requires a mission to be changed (a good example is when Skyboxes were added to missions) the changes will be made to the English version and that's the one that would be distributed in the media VPs. Your missions would then need to be upgraded or they'd lack those features.

If you use the table your stuff will stay current unless someone has to change the dialogue for some reason.
Title: Re: Russian translating
Post by: kir2yar on March 11, 2011, 05:56:20 am
Original FS and FS2 translated by Fargus. As soon as I find the CD, I'll see can I use the fonts from there.

Fargus translation and fonts a worse than failure. I can describe it only with obscene words.
I have to draw the fonts.
Title: Re: Russian translating
Post by: Vladislav on March 25, 2011, 10:20:20 am
I can help with the Russian translation, but not the Unicode part :P
We should do a voice translation as well as a text translation. I'd like to translate all the cutscenes too, it would add to the game.
Same with Blue Planet... Great mod.
So count me in :)
Just tell me what to do to get started.
Title: Re: Russian translating
Post by: PMY on March 25, 2011, 11:34:15 am
I don't think dubbing voices is a good idea. No matter how hard we would try, we just can't equal Volitions professional voice acting. And we probably won't even find enough actors to do this (lots of roles, and not only male but also female roles BTW).
Title: Re: Russian translating
Post by: chief1983 on March 25, 2011, 12:07:40 pm
Well, if the anime universe is any indication, you're going to find plenty of people on both sides of the ball when it comes to dubs vs subs.  Some people find that only having the text to read takes away from the action (really, that's the reason we VA campaigns in the first place right?), and some will say that dubs never do the original voices justice.  If there's enough interest in dubbing it, or someone who actually wants to do it, go for it.  I'm not sure you're going to find the interest or manpower to do it though.
Title: Re: Russian translating
Post by: Tomo on March 25, 2011, 01:00:47 pm
I don't think dubbing voices is a good idea. No matter how hard we would try, we just can't equal Volition's professional voice acting.
Rubbish!
There is no reason why 'amateur' VA couldn't compete with 'pro' on quality - several campaigns have really good voice acting, and there's plenty of excellent dubbing on YouTube.

The main advantage of professional VA is that they tend to be a lot better at getting a cast and meeting deadlines.

Amateur generally takes a lot longer and might not happen at all - but can still be excellent.
Title: Re: Russian translating
Post by: Thaeris on March 25, 2011, 02:14:42 pm
Don't forget that professionals ideally have access to quality equipment as well. My tools and utilities are, to say the least, on the low end of the spectrum.
Title: Re: Russian translating
Post by: Nuke on March 25, 2011, 02:23:54 pm
quality equipment that sounds only marginally better than an old soundblaster card. you would have to be an audiophile to tell the difference.
Title: Re: Russian translating
Post by: chief1983 on March 25, 2011, 02:51:36 pm
I think the microphone is one of the bigger concerns here.  A quality mic can make a world of difference, and is also in another world of price ranges.
Title: Re: Russian translating
Post by: Vladislav on March 25, 2011, 09:39:56 pm
Simply add a bit of communications static, kind of like it sounds like to be in a cockpit of a fighter. That should hide bad quality.
Title: Re: Russian translating
Post by: Nuke on March 26, 2011, 05:08:51 pm
I think the microphone is one of the bigger concerns here.  A quality mic can make a world of difference, and is also in another world of price ranges.

definitely this, any vocal mic of reasonable quality should work. like the ones garage bands use. should have a well shielded cable for best results. id also consider using a windscreen for these loud parts where you get a lot of blow noise (such as "Noooooooooooooooooooooooo!" ).
Title: Re: Russian translating
Post by: Iss Mneur on March 27, 2011, 10:27:34 am
I think the microphone is one of the bigger concerns here.  A quality mic can make a world of difference, and is also in another world of price ranges.

definitely this, any vocal mic of reasonable quality should work. like the ones garage bands use. should have a well shielded cable for best results. id also consider using a windscreen for these loud parts where you get a lot of blow noise (such as "Noooooooooooooooooooooooo!" ).
Or don't put the mic directly in front of your mouth.  Position it so that you talk (and blow) over or to the side of the microphone, wherever the actual pickup is.
Title: Re: Russian translating
Post by: Nuke on March 28, 2011, 08:00:01 am
problem with that is you have to boost the gain on the amp to get the same recording level, and by doing that you also amplify any ambient noise. a wind screen lets you speak directly into the mike in an actionable voice without that annoying blowing on the mic sound. really its the voice actors friend, and can be bought outright or made on the cheap. you can further reduce ambient noise my moving equipment (particularly stuff with loud fans) outside of the room. great care is taken to muffle the reflected sound, so usually you find the walls of the recording booth lined with foam paneling to lessen the effect. i very much doubt you need to bother with that much stuff, but thats how the pros go about it.

i used to be the fixit guy for the radio-tv class as an extra credit assignment for my electronics class. essentially i spent the first half an hour of the day in rtv room fixing things and teaching the reporter wannabes how to use the studio gear (actually one of them is now an indie film director). they did fake news every day and had 3 fake radio stations on hand (i setup one of them). the studio mics we had were really cheap (public school budget) so we had to do all kinds of improvisation. we used the material off the front of some dead speakers and a wire hanger to make some rather inexpensive windscreens, and they really improved the sound on the mics.
Title: Re: Russian translating
Post by: starlord on March 29, 2011, 04:41:12 am
actually while it has nothing to do with freespace, I'll also quickly interject here:

What you guys are doing is quite interesting... It so happens I would also need helpers in order to translate a document from russian to english (I've got already someone working on it, but he can use any help he could get)... that document is the tomorrow war: factor K story script... Should it be done with success, then a MOD team will create a patch to subtitle the add on, so us occidentals can also be given to enjoy the tomorrow war and most importantly it's sequel factor K...

What's your point of view on that?
Title: Re: Russian translating
Post by: kir2yar on March 30, 2011, 11:44:39 am
I'm still alive.

Real life attacked me. : ( New job. Constantly busy. : (

As soon as I get time I'll try to draw fonts.