TUTORIAL CUSTOM LANGUAGE

Description :

Tutorial: How to add a custom text database to the game:

—-
1/ RUN IN WINDOWED MODE
To ease the use of such a feature, it will be easier to run the game in Windowed Mode. You can choose « Res.80% (Win) » from the « Options » menu and hit enter.http://steamcommunity.com/sharedfiles/filedetails/?id=101562455
—-
2/ GO INTO YOUR GAME FOLDER
Go to your game folder (C:\Program Files (x86)\Steam\steamapps\common\blocks that matter by default in Win7/Vista).
You can read the « custom_languages/how_to/README.txt » that will do exactly what we are going to describe in the next lines :)
—-
3/ COPY THE TEMPLATE FILES
Copy « custom_languages/how_to/Template/xx/ » into « custom_languages/datas/ ».
—-
4/ CHOOSE LANGUAGE ID
My example is « ws », so I renamed the « xx » folder into « ws ».
—-
5/ EDIT TEXT.XML
Reuse an existing xml tag (by renaming it) or add a new xml tag for each text you cant to translate (using your language ID as xml tag, in this example « <ws »)http://cloud.steampowered.com/ugc/560954765820814167/D122E7783900BDB1F5717FB6875D837289C3253C/
—-
6/ RUN THE TEXT EDITOR
Make sure the game is using your custom language ID (set it up like in 1).http://steamcommunity.com/sharedfiles/filedetails/?id=101583707
Then make sure the « Font.xml » file got a xml tag « Debug » on 1 (<Debug value= »1″ />) and restart the game. The Text Editor will show up (with a spoiler alert)http://steamcommunity.com/sharedfiles/filedetails/?id=101583398
—-
7/ ITERATE!
Bring modifications to your « Text.xml », and hot reload the changes in the Text Editor (Ctrl+R). You can also go to the game menus by hitting Ctrl+Enter (use F1 in the Editor for a full list of shortcuts)
—-
8/ SUBMIT IT TO THE WORKSHOP!
Once your Text.xml is content ready, complete the Empty field in « Font.xml » (Title, Desc, Author), save them.
When you are in the text viewer editor: hit F5 to submit to the workshop.
A yellow text « Submitting to the Workshop » will appear. Wait until it’s done.
Once the text disappeared, your item should be on the Workshop! congratz!
To check your item, you can press F6 to open a Steam Overlay on your item. You can edit the description, add some images or rename the title to suit your needs!
—-
9/ SUBSCRIBE TO LANGUAGE FILE
You can subscribe to the language file you’ve just submitted by going into the « Options », then highlight the Language entry and press the key to open the Workshop.http://steamcommunity.com/sharedfiles/filedetails/?id=101583299

Now you can subscribe to any language item.http://steamcommunity.com/sharedfiles/filedetails/?id=101583201
—-
10/ CUSTOMIZE FONT
If the language you want to use need a custom font, you can tweak the « Font.xml » file by removing the <!– –> around the « <Name value= »deffont.ttf » /> » and « <AdditionalGlyphRange from= »32″ to= »255″ /> ».
Then you’ll have to make sure the deffont.ttf (or any name you want) is a real existing file containing the font you want to use.

I’m using using the font « Pixel Cyr » to test some Cyrillic character. Here is what I have done to achieve this:
a/ I removed the existing deffont.ttf from the folder (which is the Nokia Cellphone font).

Note: the 1025 / 1169 additional glyph range was given by a table I found on the internet, describing the glyph table for the font « Pixel Cyr Normal » I was using. (you can see these table on the left of the screenshot). There are Hexadecimal or Decimal values in top of each characters, you have to report the Decimal one into the « Font.xml »

If you want to use various glyph ranges, you can add any number of line you like in the Font.xml, for example:
<AdditionalGlyphRange from= »1025″ to= »1169″ />
<AdditionalGlyphRange from= »2000″ to= »3000″ />
<!– etc –>
—-
11/ DEBUGGING
It’s easy to make a mistake in the « Texts.xml » file. As a consequence, when you try to select your custom language in the « Options » menu, the game might re-select the « en » default language.
To have hints on the errors that occur, you can run the game in « Console Mode ».

To do so, start the game by using the « BTM_DBG_launcher_win_bis.bat » situated in the game folder (C:\Program Files (x86)\Steam\steamapps\common\blocks that matter).
Then, when an error occurs, it will be logged in the Console. For example, if I made a mistake in my « Texts.xml » file, an error will pop in the Console when I try to select my language in the Options.