I just patched You Have to Win the Game to fix a crash bug in a previously undocumented engine feature. I had intended to launch the game with this functionality originally and only discovered in the weeks following its release that it was broken, and I just now got around to fixing it. (Turns out it was a ridiculous facepalm of a one-line fix, of course.)
Anyway, yeah, YHtWtG now supports localization! All text in the game and UI can be translated into other languages. Here’s how it works:
Step 1. Dump the string table
Run the game, open the console with the tilde (~) key, and enter “dumpstrings”. This will create a new folder “Localization” in My Documents (see my previous post for this location), and it will generate a subfolder “English” inside. The “English” subfolder will be a number of text files containing key/value pairs in the format “SplashText=Localization provided by [YOUR NAME HERE]”. (This defines is a string with the key “SplashText” and the value “Localization provided by [YOUR NAME HERE]”.) These files contain the entire localized text of the game. (Some strings, such as the room titles in YHtWtG, are not localized, but most of them are.)
Step 2. Create a new folder with localized files
Copy the “English” subfolder and all its contents to another subfolder, and rename it to the language of your choice (e.g. “Pirate”). For each file in the new subfolder, rewrite the values but not the keys. For instance, in the line “SplashText=Localization provided by [YOUR NAME HERE]”, “SplashText” must be left as it is, but “Localization provided by [YOUR NAME HERE]” should be translated into the target language. Note that if any strings are omitted from the localized files, or if any localized files are completely omitted, the default English strings will be used instead.
Step 3. Specify the localization folder to use when playing the game
Open the Config.ini file in the Config folder and specify the language in the Language field. By default, this will be blank (“Language: “); if specified, it should match the name of the new subfolder created in step 2 (e.g., “Language: Pirate”). The game will look for this folder and its contents inside the Localization folder when loading strings.
Aaaaand that’s really all there is to it! To share your localized files with other players, you can just zip/unzip the entire subfolder. The “Localization” folder is only created when it’s needed (e.g., by the “dumpstrings” command), so you might have to add that manually to use a language set if it doesn’t exist yet.
I should also note that my fonts only include the basic Windows-1252 character set, so there’s no support for crazy Unicode characters or anything like that. Maybe next time.