a333 Posted April 3, 2013 Share Posted April 3, 2013 (edited) 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. 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: 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): 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. Edited May 7, 2013 by a333 Quote Link to comment Share on other sites More sharing options...
Chris Posted April 3, 2013 Share Posted April 3, 2013 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. Quote Link to comment Share on other sites More sharing options...
a333 Posted April 4, 2013 Author Share Posted April 4, 2013 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. Quote Link to comment Share on other sites More sharing options...
Chris Posted April 4, 2013 Share Posted April 4, 2013 Just posted it for information, use whatever you like. The OpenOffice equivalent of Excel will corrupt the file though, unfortunately. Quote Link to comment Share on other sites More sharing options...
a333 Posted April 11, 2013 Author Share Posted April 11, 2013 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. Quote Link to comment Share on other sites More sharing options...
a333 Posted April 16, 2013 Author Share Posted April 16, 2013 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. Quote Link to comment Share on other sites More sharing options...
Chris Posted April 19, 2013 Share Posted April 19, 2013 Here we go: http://www.xenonauts.com/devfiles/PlaymateFontMaker.zip Forever more, Playmate Font Maker will have a home. Quote Link to comment Share on other sites More sharing options...
a333 Posted April 19, 2013 Author Share Posted April 19, 2013 Thank you Santa! Opthread'ed. Quote Link to comment Share on other sites More sharing options...
duch Posted May 5, 2013 Share Posted May 5, 2013 (edited) 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 May 5, 2013 by duch Quote Link to comment Share on other sites More sharing options...
a333 Posted May 7, 2013 Author Share Posted May 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
duch Posted May 7, 2013 Share Posted May 7, 2013 i've solved all problems with font, but thanks for help. I've released partial translation and will continue translation Quote Link to comment Share on other sites More sharing options...
peterpanza Posted April 7, 2014 Share Posted April 7, 2014 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? Quote Link to comment Share on other sites More sharing options...
Gauddlike Posted April 8, 2014 Share Posted April 8, 2014 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. Quote Link to comment Share on other sites More sharing options...
peterpanza Posted April 9, 2014 Share Posted April 9, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.