Jump to content
Chris

Translating Xenonauts - A Guide (and our plans to support it)

Recommended Posts

On release, Xenonauts will only OFFICIALLY be released in English. I sadly do not speak any foreign languages, so I'm unable to assess the quality of the translation and so can't officially support any of them.

However, I want Xenonauts to be playable by as many people as possible, irrespective of what language they speak. I understand that the research descriptions can be difficult to understand if English isn't your first language.

I would therefore like to include an option in the game to change the language of the game. This will probably replace the "Report Bugs" button in the game launcher when we are further into beta. This will make it clear that the language packs included are unofficial, but it will let a player load them up with a couple of clicks.

The community will have to provide these language packs. We don't have enough money to hire translators at Goldhawk, and there is also the problem that I don't have any way to assess how well a translator is working because I can't read their work.

If you are interested in translating Xenonauts into another language, this is a guide on what will be required and what will result from it.

THE JOB:

Translating Xenonauts will involve translating large numbers of text strings in XML files into your chosen language, plus editing a few image files. The files involved are:

  • strings.xml - this file contains the vast majority of the text strings in the game (translate the right-hand column). It contains a LOT of lines, but it shouldn't be particularly difficult.
  • xenopedia.xml - this file contains all of the research description text strings. There is only about 100 entries, but it will probably be the most challenging part of the translation.
  • soldiernames.xml - this contains the soldier names and nationalities, all of which are currently in English.
  • soldiernamesfemale.xml -as above, but for female soldiers.
  • Images with baked-in text: This presently is only the "End Turn" button on the Ground Combat. A photoshop file will be provided in the near future, allowing you to update the text to other languages.

GETTING INVOLVED:

There are two ways to get involved. You can either help someone else with their existing translation of the game (check the threads in this sub-forum), either by offering to help them do the translation work or just by proof-reading their work. To do this, comment in their thread and see if they are willing to work with you.

Alternatively, you can start your own translation project. To do this:

  • Create a thread in this sub-forum with the title "<Language> Translation - <your username>"
  • Start working!
  • Post up your in-progress work (register an account with a filehost like Dropbox to make this easier) so people can comment on it
  • Success!

HOW TO TRANSLATE FILES:

The files you will want to translate are all XML files. It is possible to translate them using any basic plain text editor, such as Notepad. However, we recommend using the following two programs:

- Notepad++ is a plain text editor that is much more fully featured than normal Notepad. Really useful.

- Microsoft Excel can be used for strings.xml and xenopedia.xml, as those XML files are spreadsheets.

The two "spreadsheet" XML files you need to translate (strings.xml and xenopedia.xml) are designed to be opened in Microsoft Excel, as that is what we at Goldhawk use to open them. If you open them in Excel, the XML file will be displayed as two neat columns of information.

If you open them in a plain text editor, they will still be editable, but there is a LOT of useless formatting tags in the text that makes reading the information difficult. However, as demonstrated below, editing the XML files directly can give more customisation. Ultimately, it is up to you to decide what works better.

DO NOT use Open Office to edit these files, as it will corrupt them. Use Excel or Notepad++.

Whichever program you use to edit the files, ensure it encodes the saves in UTF-8 (Notepad++ will do this by default, but not all text editors will). If the file is encoded in UTF-8, you can simply type in text strings in your native language.

EXAMPLE TRANSLATION TUTORIAL (by forum user a333)

This is a quick tutorial on how to edit a text string on the Title Screen. It assumes strings.xml has been opened in Notepad++.

<Data ss:Type="String">Normal</Data> turning into<Data ss:Type="String">Нормальная</Data>

Data strings support basic formatting. As you can see, the translated string above is slightly longer than the original, which can cause problems (as seen in the image below).

attachment.php?attachmentid=1998&stc=1

This is how to fix it using basic formatting:

<Data ss:Type="String"><font size='17' face='fonts/xenonauts.mvec'>Нормальная</font></Data> 

Here < is xml code for <, > is for >, so you basically have an xml inside of an xml:

<Data ss:Type="String">  <font size='17' face='fonts/xenonauts.mvec'>Нормальная</font></Data> 

Second level is likely to be processed by another parser, so it should be writed in codes. And the result is:

attachment.php?attachmentid=1999&stc=1

That's better. Also, a note - you can also use line breaks to start a new line. The code for these is below:


INFORMATION ON FONTS: (by forum user a333)

This is fairly specialist information that is worth reading, but hopefully it will not affect you too much as modders have worked hard to add most non-Latin characters to the main fonts in the game.

The Xenonauts engine (Playground SDK) uses a special outline font format called .MVEC. The main game fonts are xenonauts.mvec, xenopedia.mvec and arial.mvec.

xenonauts.mvec - this is the standard font used in most areas of the game (and on our logo).

xenopedia.mvec - this is the font used in the research pop-ups (it is the Tahoma font that comes with Windows)

arial.mvec - this is the backup default font used by our engine, and is also used in tooltips.

The Xenopedia font contains ASCII (of course), almost all of the Controls and Latin-1 Supplement (advanced punctuation and basic diacritics), all Latin Extended A (advanced diacritics), Greek and Cyrillic sets.

The Xenonauts font is slightly less universal, so it contains only basic punctuation, ASCII, Cyrillic, Greek and some of the Latin-1 supplement. Obviously, it contains only capital letters.

The Arial font is used by tooltips, but it is also the "backup" font. If you try to use a character that is missing in either of the two other fonts, the game will load that character in Arial instead. You can see this below:

attachment.php?attachmentid=2000&stc=1

Note the Ü character does not match the rest of the Xenonauts font - this is because it has been drawn in Arial. (This character is no longer missing from Xenonauts.mvec, but was when this image was taken.)

If, however, you write a character that is missing in all the fonts, even Arial, you will see nothing. It may even crash the game. If that is happening to you, read on below:

ADDING NEW FONTS: (most people don't need to know this stuff)

If you need a character that is not included in the three current fonts, you will have to add a new font to the game that does include it. If you need to do this, expand the information below.

You will need a font converter to create the MVEC font that the game engine uses; Playmate Font Maker will work.

1. Install the font you want to convert in your system, TTF fonts only (be sure not to violate any copyright).

2. Run the tool. You will see the glyph sets available for the importing. There are basic sets for most of the languages, but you are free to modify/add your own, and probably you will have to do so. The sets are actually plain text files in a tool folder (UTF-8 encoded).

3. Select what you want to see. Don't forget numbers, some punctuation and ASCII English.

4. Tool will show if the font is missing something. If everything is ok, push the button and save the font somewhere.

5. Replace every font file in the assets/fonts/, or you can choose to replace only default (arial.mvec).

- Be sure to take into account UI stylistics. Xenonauts font must be heavier, while xenopedia should be readable even in small sizes.

- Arial.mvec is a bit tricky choice. Basically, you should be able to include everything in this one, as it is the default font for which game resorts in a case of a missing glyph. But exactly because of that this font should contain as much letters as possible. Use unicode font, add everything, act on your own risk. Also, everything will be quite monotonous.

Also, you may meet the repeating glyph problem when you are writing "АБВГ", but in the game it looks like "ААБГ" and so on. Fonts with languages which have some latin letters (like greek uppercase A,B,E,Ζ,etc) especially prone to this.

This is because the tool can't stomach glyph links. A glyph link is basically a shortcut to another glyph, and it doesn't contain any actual vector data. In good fonts all similar letters like Greek/Cyrillic A, B, etc, are linked to their corresponding english twins to save some bytes. Same goes for the complex letters like Ë, Î, Ñ.

So, this is what you do:

1. Download any font editor (Fontforge will do, and it's free).

2. Open your ttf.

3. Ctrl-A will select all the glyphs, then click the right mouse button on any, and chose "Unlink Reference". All links will be exchanged for a copied vector data.

4. File -> Generate Fonts, format: TrueType, No Bitmap Fonts, uncheck the validation (sometimes it causes CTD and will produce unneeded warnings). There you go. Now install the new ttf, be sure to select it in the Font Maker (if the font you installing was already present in system, you'll see the new font as fontname_0.ttf).

5. Convert and check. You're done.

ISSUES FOR DEVELOPERS TO FIX:

- New Game, Load Game, overwrite save dialog buttons and Game Options are still hardcoded (though they have corresponding strings in xml);

- No string for 'Funds' in the subscreens;

- No string for 'Unassigned' in the Soldier and Vehicle subscreens;

- Apparent strings for 'Fuel level' and 'Paused - Press Space to resume' for Aircombatmode don't work, presumably hardcoded;

- Strings for soldiers nationality in the soldiersnames.xml files;

- Groundcombatmode Tooltip for Equipment tile only working when in the grenade selection screen of the tile;

- No tooltip on End turn button showing and End turn button seems to be a graphical element with no text string to adjust;

- To use the % character in text, you must use the double percent sign: %%

* All tooltips in Arial and case sensitive, most other strings printed in the Xenonauts font with only capital characters. This is a reminder to write case sensitive for tooltip entries, with other entries it does not matter as it will be rendered out in all capitals anyway.

Share this post


Link to post
Share on other sites

This thread is just to pull all the translation resources into one place so they are not last. Thanks to everyone that contributed to it; it's certainly not all my work.

If I've missed stuff or you have suggestions, post them up here and I'll amend the post if neccessary.

Share this post


Link to post
Share on other sites

Thanks for rereading and refining my walls of text, Chris. It's definitely better this way.

Share this post


Link to post
Share on other sites

bad news :/

i buy xenonauts after that

Originally Posted by Chris

Yeah we'll definitely do a German version. Germany's the biggest market for strategy games in Europe as far as I'm aware.

Originally Posted by Chris

Sadly not. This is something we'll add at release rather than during development. A lot of the translation is done by the local distributors anyway as part of of the distribution deal.

anyway i hope someone will translate xeno in german

Share this post


Link to post
Share on other sites

Is the game sufficiently completed in terms of the string entries, so that translating them now would be meaningful? If the texts are to be reviewed at some point later, perhaps it would be better before any translations are to be done, to wait for that point. Having a translation that is different than the final version of the original would not be so nice.

I only ask that because I think I have noticed posts suggesting changes to the entries.

Share this post


Link to post
Share on other sites

A small question to Chris and (or?) a333.

This is nothing said about what character set ariel.mvec supports but it looks like Cyrillic doesn't included because i got this issue with tooltips that have a tag <font face="fonts/arial.mvec"\> in it. Basically you see only punctuation marks and numbers. And it looks like this after i remove this tag. Everything is ok, but looks like game use xenonauts.mvec in this case. So the question is... actually there are two of em:

1) Am i right about ariel.mvec (that it doesn't support Cyrillic)?

2) Is there a plan on remaking this font with support of more character sets or i should make my own ariel.mvec with Cyrillic set support?

Share this post


Link to post
Share on other sites

That's for a333 to say, I'm afraid. He did all the Cyrillic-support work, I've never had to use it myself.

Share this post


Link to post
Share on other sites

Yes, it appears that the arial.mvec didn't have extended symbols included. Here's the new arial.mvec, it contains cyrillic, extended european, bunch of punctuations and greek (i'm sure i've done this already, but it seems i haven't. Strange, i'm sure i've had a thought about the tooltips. Anyways, thanks for pointing that out).

https://dl.dropboxusercontent.com/u/60491525/arial.mvec

Chris, i've tested the basic behaviour with the couple of english tooltips, and also tried cyrillics. Didn't made the thorough testing yet, so you may wish to wait before including this, especially in the stable build.

Newfr, if you'll throw a couple of tests with the new file too, it would be greatly appreciated.

Share this post


Link to post
Share on other sites
Newfr, if you'll throw a couple of tests with the new file too, it would be greatly appreciated.

Sure thing, I'm doing some testing anyway. I'll send you a PM if I'll find any problems.

Share this post


Link to post
Share on other sites

Well, there is a HUGE problem. If some string used more then just once the whole method with changing font size can't be used. For example "Central America". Translation "Центральная Америка" doesn't fit in its space (that in a upper right corner on Geoscape screen) with resolution 1440х900 (full screen) or less. If use it like this

<font size="20">Центральная Америка</font>

that will fit nicely on Geoscape but will mess things up in base naming window (huge letters) and on monthly financial report (letters not render at all).

Share this post


Link to post
Share on other sites

Any body send me fonts witch polish signs? (ąĄęĘłŁżŻźŹćĆóÓśŚ) ?

I have fonts witch them (our production), but game crashed in equiment soldier panel. - when original fonts paste in to the folder fotns game works good.

pls help

Edited by pantego

Share this post


Link to post
Share on other sites

Is anything final? I mean text strings. If yes, we can start with the translation :)

Because its boring to translate every and every version again the same things :)

Share this post


Link to post
Share on other sites

Guys,

I'm having some issues with a simple problem.

When I resize some text in strings.html it doesn't work with all resolutions.

Am I supposed to resize everything based on the highest resolution or what?

Gam

Share this post


Link to post
Share on other sites
Guys,

I'm having some issues with a simple problem.

When I resize some text in strings.html it doesn't work with all resolutions.

Am I supposed to resize everything based on the highest resolution or what?

Gam

Now when you resize text manually (using tags "font size" in strings.xml) it just became a fixed sized without taking resolution into account. And if that variable used in several different places (like my example with Central America) things became even more messed up. So i would recommend to avoid resizing at all cost and hope devs will do something about it.

Sadly now devs think that provide space barely enough for english word to fit without problems is a great idea. For example "off" in Russian looks like "выключить" (like 9 letters longer) and even commonly used abbreviation looks like "выкл" (just 1 letter longer) but that's don't fit because there is space just for 3 letters!

Translating Xenonauts really makes you a sad panda lots of times.

Edited by Newfr

Share this post


Link to post
Share on other sites

Chris, thank you for a great game! ))

I have such question: is it allowed to translate prologue novell "Crimson Dagger"? Posted this question here Copyright notice says "no". Is it so?

Share this post


Link to post
Share on other sites

Good evening!

I'm working on a new Russian translation, and I have a question - is there a xenonauts.ttf file with cyrillics already integrated?

In the xenonauts.mvec there are no several necessary symbols, such as our beloved Ёё, proper m-dash, quotes etc. In xenonauts.ttf supplied with the game, as well as in the file supplied in the "QM/GM word docs" tread, there's no cyrillics at all.

I've sent a PM to a333 a couple of weeks ago, but still no answer.

I've managed to recreate all other fonts by the manual posted by Chris, but for xenonauts I just don't have a source... So I use a replacement for now, similar-looking, but still different.

Probably if I had an already-cyryllized ttf, I'd manage to add the few symbols I need.

And the second question - is there an easy way to translate strings melded into exe? I'm not a pro with debuggers and stuff...

Thank you in advance!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×