From aimainahikari@hotmail.com Mon Nov 17 12:14:49 2003 Date: Tue, 29 Jul 2003 23:59:19 +0200 From: Raul Arabaolaza Barquin To: weimer@cs.berkeley.edu Subject: Translating tutorial for WeiDU Hi, Wes, i´m sending you the english versión of the "How to use WeiDu at a basic level to translate mods and games" tutorial i´ve send you a long time ago, Neil has put it in FWP, and i tought you would like to have it. Feel free to do whatever you want with it, i hope it can be useful for you to put in your website or the weiDU-readme or simply to make you laugh a little ;) Thanks. How to use WeiDU at a basic level to translate mods and games. In IE games, all the texts are contained in one file, named dialog.tlk. This file is no more than a series of strings each one with a reference number. Dialogf.tlk, which is found in non-English versions, contains the same text, but as it would be displayed to a female main character. The details about the dialog.tlk format can be found in Infinity Engine Hacking Project, but unless you need to create a new editing program, you don't need that level of detail. When I say that all the texts are in that file I'm talking about absolutely all the texts. For example, item (*.itm) files do not contain the name and description of the item. They contain pointers to a string number contained in the dialog.tlk. This is why item files must be exported to *.tbg or installed using WeiDU to make those texts appear in the games. This is also applicable to any kind of IE file: none have any text inside of them. When we load, for example, a weapon, and we see their description, we're really using two files: the *.itm file and the dialog.tlk. All files showing any kind of text, or texts showed in game (interface and so on), are described with a reference number, that number has a string assigned in dialog.tlk and that is what is showed. So, to translate a IE game we just have to translate its dialog.tlk, of course. You have to be careful and not change or delete the reference numbers because without them, the file is meaningless. If we want to put new text in the game, I mean, text that wasn't in dialog.tlk before, we have to put it in dialog.tlk and assign a reference number to it, then, when we want to use it we give that value to the game engine so it inserts the text. dialog.tlk makes it very easy to patch IE games with new translations-- we just have to replace the non-translated dialog with the new translated one. You don't even need to start a new game to use the translations because the save game files only have reference numbers, not the texts. Those who know something about programming will understand it perfectly. An inconvenient of this: it is very heavy work, because as ALL the texts are here, including the button names, item descriptions, etc, etc, in a single huge text file. For example, the dialog.tlk file for PST is 11.7 MB long when converted to a text file. Now, we are going to the next step: how to extract text from .tlk files and put them in .tlk format again. It is possible to use several programs, but no one in their right mind would use another thing but WeiDU (www.weidu.org), because it handles *.tlk export/import like no other. It's very easy to use and completely automated. (We adore you, Weimer). Let's suppose we have a completely new game (for example, PST) and we want to extract its texts to translate them. We just have to install WeiDU (unzip the *.zip file in the game directory), run it (a DOS window opens) and type: weidu --traify-tlk dialog.tlk --textout dialog.tra The result would be something like: C:\Documents and Settings\Raul>cd c:\juegos\black isle\planescape torment C:\Juegos\Black Isle\Planescape Torment>weidu --traify-tlk dialog.tlk --textout dialog.tra [weidu] WeiDU version 115 [./chitin.key] 372 BIFFs, 12135 resources [dialog.tlk] 106497 string entries [./dialogf.tlk] 106497 string entries Here you're able to see the information about the WeiDU version used (115), information about the *.key file (a list of all the game resources saved in sub-files, *.bif, which are something like the *.zip files), and information about dialog.tlk (in this case it has 106497 string references). In the same way, when we type it, a file named dialog.tra is created in the game directory. .tra stands for "translation" and is simply the name of text files WeiDU uses for multiple language text. You may open these .tra files with any text editor and see something like this: @0 = ~"I shall wait for you in death's halls, my Love." She smiles, but there is only sadness in it. She closes her eyes, and with an ethereal whisper, she fades.~ [DEN008B] @1 = ~POUCH Weight: 0 A small bag made of some unidentifiable material.~ @2 = ~Morte's Bite (Sharpened)~ Etc. Let's see the *.tra format a more deeply: @0 = ~"I shall wait for you in death's halls, my Love." She smiles, but there is only sadness in it. She closes her eyes, and with an ethereal whisper, she fades.~ [DEN008B] The @ is only a symbol, like the c: to talk about a hard disk. The number behind the @ is the reference that the string has assigned, the = is an "equal" , just that. It means the reference 0, for example, is equal to the following string, and the text that is inserted just as it appears, is what is between ~~. Sometimes, something between [] appears at the end of the string, it is the name of an audio file in format *.wav or *.wavc (the last is an especial format of IE), which sounds at the same time the text is displayed. For each reference there can be two different strings: the first one references the text that will be displayed if the protagonist is a man, and the second one if is a woman. Many times they are the same. When we have already all the dialog in *.tra format, now we just have to translate the texts. Remember: only what is between ~~. Once we have all the texts translated, we just have to turn them again to *.tlk format, again it is very easy, run WeiDU and type: weidu --make-tlk dialog.tra This creates the dialog.tlk file with the new strings translated, after we have edited all of the strings in dialog.tra to the new language. As always, make backups as you work. You can create a dialog with --traify-tlk and give it another name, for example: weidu --traify-tlk dialog.tlk --textout dialog01.tra In this way the file dialo01.tra will be created, so that when we type: weidu --make-tlk dialog01.tra It will show something like this: C:\Juegos\Black Isle\Planescape Torment>weidu --make-tlk dialo.tra [weidu] WeiDU version 115 [./chitin.key] 372 BIFFs, 12135 resources [./dialog.tlk] 106497 string entries [./dialogf.tlk] 106497 string entries [dialo.tra] parsed [dialo.tra] has 51 translation strings New TLK will have 251 entries Basically, it say the same than before, giving us information about the new *.tlk file created. In this case that it is formed by 51 strings and has 251 entries (or that its last reference is 251). Once we made this, we just have to move the old dialog.tlk to a secure place and change the name of dialog01.tlk to dialog.tlk. It is simple, isn't it? To translate the game, all you need to do is replace the original dialog.tlk with the new one that has just been created. This method works when translating entire games or mods that completely replace the dialog.tlk, but there are mods that just add some lines to dialog.tlk. Many WeiDU mods come with .tra files for their new content, but if they are not available and you need to translate the lines directly out of the .tlk file, we can extract just the new lines for translation. BEFORE installing the mod we must type: weidu dialog.tlk It will show something like this: C:\Juegos\Black Isle\Planescape Torment>weidu dialog.tlk [weidu] WeiDU version 115 [./chitin.key] 372 BIFFs, 12135 resources [dialog.tlk] 106497 string entries [./dialogf.tlk] 106497 string entries This is the current (pre-modded) dialog.tlk information. We must write down the number of string entries, in this case 106497. Now, we have to install the mod and type the same command thing. It will give us a different string entries number, and it will be greater than the one we have written, these are the new strings that have been added to de game, let's imagine that number is 106500. That means from 106498 to 106500 there are new texts. To extract just these new lines, we type: weidu --min 106497 --max 106500 --traify-tlk dialog.tlk --textout textomod.tra This creates a new .tra file called textomod.tra with the new texts-just the three new lines that have been added. Once we have translated the texts, the easiest thing to do is to send them to the mod creator for inclusion in the next version. A longer explanation of translating mods would be more complicated than this basic tutorial. WeiDU mods are a very different case, normally it isn't necessary to extract the texts because the *.tra files come with the mod, so you just have to translate them. Most WeiDU mod makers include their .tra files in a directory named after the language they are in ("english" or "german", for instance.) Once you have translated the .tra files, send them to the mod creator for inclusion. Do NOT rename the .tra files! If you translate a file called "setup.tra", do not rename it "setup-francais.tra" if you are a French translator! If there are no *.tra files in the WeiDU mod, we have to ask to its creator to convert the mod to use *.tra. This process, called "traify", is very simple and is explained in the WeiDU README. Most mod creators are happy to do this when asked. Since .tra files make mod creation easier, the trend is for more and more modders to use them from the beginning. Well, I hope this tutorial will serve its purpose and make mod translator's work easier. Thanx Heze for the translation and Jason for the spelling checks, as this tutorial was made in Spanish ~Mhoram _________________________________________________________________ MSN Compras: Veinte tiendas personales abiertas todo el día. http://www.msn.es/compras/