Jump to content

Recommended Posts

So, you want to translate this game into your language.

I assume you understand the scale of this work. If not, then i'll recommend to read Safaquel's russian translation approach (Link), since this would greatly help you to work efficiently with the help of the community.

This topic is about technical aspects of the translation.

Data location

Most of the translatable text data located in the assets/strings.xml. Menu entries, interface elements, etc can be found here. As for now, some of the text is hardcoded, so you can't translate it yet, but it will change soon.

Xenopedia entries, respectively, are in the assets/xenopedia.xml.

You'll also want to check soldiernames.xml and soldiernamesfemale.xml.

Translating

You can use MS Excel for more comfortable editing, if you prefer it. Open Office is known to corrupt xmls, though.

XML files are encoded in UTF-8. That means you can just write there in your native language.

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

Be sure to save the file in UTF-8 because certain text editor tends to think it is smarter than you. Check the encoding in the save dialog and, even better, use notepad++ or akelpad.

Data strings also supports basic formatting. For example, translated string above is slightly longer than original, and sometimes it can lead to the rather unpleasant results.

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

That's how to fix it:

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

where < is a xml code for <, > is for >, so you basically got 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:

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

That's better.

You can also use line breakers to start a new line.


Font basics

Playground SDK employ special outline font format called MVEC. Main game fonts are xenonauts.mvec, xenopedia.mvec and arial.mvec.

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.

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

Arial font is used in tooltips, but not only there. When you'll try to insert some character that is missing in xenofonts, the game will resort to the arial.mvec, which i didn't check, but it's pretty stuffed. Result will be looking like this (image by Schnittertm):

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

Note the Ü character (Also note that this character is now redrawed and included in the font). If you are okay with how it looks, then leave it as is. If not, then proceed to the next section.

What will happen if you try to write something like that?

<Data ss:Type="String">出口</Data>

You'll get nothing (in the best case) or even CTD. That's because this characters are missing even in the arial.mvec. And this bring us to the...

Font creation

If you are to add some new symbols in the font, you will need a converter.

Playmate Font Maker will do.

1. Install the font you want to convert in your system. TTF fonts only. Be sure not to violate any copyrights.

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.

Solution:

The tool can't stomach glyph links. Glyph link is basically a shortcut to another glyph, and it doesnt 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, that's 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.

Known issues and advices

(by Schnittertm)

- 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;

- '%'-character in text (with- or without ASCII code) making tooltips dislay only ####, as xml seems to expect a variable to refer to and not finding it. Workaround for now, write out percent instead of using the character itself.

Use 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.

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

&#1057;&#1085;&#1080;&#1084;&#1086;&#1082;.JPG

577e7caaa9bbc_105710851080108410861082.J

577e7caaacf53_105710851080108410861082.J

577e7caaaf5e8_105710851080108410861082.J

Edited by a333

Share this post


Link to post
Share on other sites

Incidentally, be aware that strings.xml is an Excel spreadsheet and if you open it in Excel it is much easier to sort and manipulate.

Share this post


Link to post
Share on other sites

Excel is a proprietary software, therefore i can't test/recommend it. Open analogs can potentially break the xml or add garbage tags, so they need to be tested. But simple text editor is pretty robust option.

I'll add the Excel as more comfortable editor variant, if you are using it, though.

Share this post


Link to post
Share on other sites

Just posted it for information, use whatever you like. The OpenOffice equivalent of Excel will corrupt the file though, unfortunately.

Share this post


Link to post
Share on other sites

Updated with details about font creation, added issues section.

Forum abjures my diplomatic attempts to add some attachments, and file hosts are not that reliable. Looking for solution.

Share this post


Link to post
Share on other sites

I'm trying to give playmate font maker a good place to live. Everything else is ok, mvec's are available in the standalone, plenty of ttf's in the internet, but this tool is somewhat rare and unaccessible.

Share this post


Link to post
Share on other sites

hello friends!

I am translating game into Polish language.

I've translated about 50% of strings.xml

Now i have problem with fonts. For example in menu (while in game press escape) i've got 'Zakończ grę', but it looks like 'Zakocz gr'. I've replacet arial font, but have no idea what font should i use for xenonauts.mvec and xenopedia.mvec. Do you have a ttf with this font? I can add Polish fonts to it by editing font itself, but it needs to be otf or ttf. for now i have found similar font with polish characters, but it is only for developement, right?

Thank you

ps. when I select save to overwrite in new confirmation window is hardcoded 'yes' and 'no' - it is not taken from strings.xml

Edited by duch

Share this post


Link to post
Share on other sites

Hello duch!

How did you replace the arial font? It shouldn't work that way you described it.

If you'll give me a set of polish special letters, i'll add them to the fonts.

Share this post


Link to post
Share on other sites

i've solved all problems with font, but thanks for help. I've released partial translation and will continue translation

Share this post


Link to post
Share on other sites

i tried to translate the text into Chinese ,but found that the game dose not support Chinese.

It is easy as editing the XML files, I guess?Am I missing something?

Share this post


Link to post
Share on other sites

The characters you want to display have to be present in the font used inside the game in order for it to display.

Just changing the xml files will not work as they use a different set of fonts.

Share this post


Link to post
Share on other sites

Yeah,of course.I double checked the translating guide. If I figured it right.It's impossible to use Chinese without resetting every Chinese character one by one.But Chinese has thousands of characters,i'll give it up.

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

×