Prison City is a dystopian, action-packed side-scroller with tight mechanics and intricate level design. Battle Techno-Terrorists with your chakram and grenades, eat hot dogs for health, and locate contacts to help take down bosses.
[h3]From lead developer Programancer:[/h3]
Something with Prison City I had implemented a while back was the ability to import your own localization file if you know what you're doing--kind of a back door to adding languages! I had secretly hoped someone would figure out how to do this obscure thing, but there have been a couple of requests from the community to let them provide some localization, so it seems appropriate to equip you with the knowledge to do this! The base file is already included in the latest version of the game on Steam, so if this is something you want to do, this guide will point you in the right direction!
[i][b]Please note: This is something that, while supported, is more of a do-at-your-own-risk thing and was never meant to have wider support outside of development and tinkering, so be aware there may be behaviors, oddities, or even crashes you experience if this isn't done correctly. We'll cover that at the end of this guide.[/b][/i]
So first and foremost, go to the game’s installation directory, and find “dialog.dat”. This is the file that houses all of the in-game text across all languages. [u][b]Make a backup of this file![/b][/u]
Included in the latest build of the game is [b]dialograw.csv[/b] – it’s a comma-separated list of the contents in dialog.dat, along with notes. As long as this file is in the installation directory of Prison City, the game will use that for the game strings, and it will also create a new dialog.dat in %localappdata%/PrisonCity with the encoded contents of the csv that we can move to the installation folder after you’re finished, but isn’t entirely necessary.
Open up dialograw.csv in a spreadsheet editor like Excel or Google Sheets, and take a look at how it’s laid out:
[list]
[*] Dialog ID on Column A
[*] Internal Notes on Column B
[*] Language Data starts on Column C, with Row 1 containing important metadata, and Row 2 being the language name
[/list]
So to get started, we will ignore the metadata row for now (we will go back to that later)- just copy the default English metadata string (“0|0|0|0|0” without spaces), and go straight to the first vacant column of the CSV. This will be your new localization column. On the file included, it’s column N!
[img]{STEAM_CLAN_IMAGE}/43163498/bf0132a0d5ecf7fbcba0103a42441c8d49257ec8.png[/img]
Go to Row 2, and enter your language name. This is what’s displayed in the “Language” menu. From there, just go down the rows and localize each chunk of text.
You’ll notice for some things, there are special characters in use.
[list]
[*] ☁ is for dialog cadence. When the game sees this in codecs, it’ll add a delay to the text typing
[*] \n is a linebreak
[*] {0-9} is a variable that is replaced by the game while it’s running. Usually lives, or other stats
[*] For the Tutorial strings, [hang], [jump], etc are strings that are replaced by buttons. It is important that these have a space before and after them. For example, “This is the [hang]button” will not work. It needs to be “This is the [hang] button”.
[/list]
Once you have everything localized, run the game and navigate to the Languages menu. You should see your new language at the bottom of the list!
[i][b]Do note however that this menu will seem a bit odd if you’ve only added only 1 new language, and it will not scroll appropriately if you navigate downward. The “Back” button is hidden behind some UI flare, but is still usable. Adding an additional language solves this![/b][/i]
Now that you’ve set your new language, it’s time to do the hard part- [i][b]making sure it all fits and doesn’t suck![/b][/i] This is where you make adjustments to strings and get everything to fit.
[i][b]BUT WAIT! BEFORE YOU DO THAT![/b][/i] What about that metadata row we mentioned earlier?
This is an important part of making sure things fit. In column B Row 1, there’s a note for what the metadata does: lang group|menu size offset|dialog size offset|dialog delay|ignore dialog width rules
Each one of these values changes how the text will display, and they’re defined with a numerical value. For example, default English is 0|0|0|0|0, which means each of those values is 0 (default). Here’s what each value does:
[list]
[*] [b]Lang Group[/b]
- This determines if the dialog will need to use the smaller font (1) or not (0) for UI elements
[*] [b]Menu Size Offset[/b]
- This will expand in pixels the length of the menu option bars
[*] [b]Dialog Size Offset[/b]
- This will expand in pixels the width of the Codec Dialog text area
[*] [b]Dialog Delay[/b]
- This will change the default wait time for typing text. Languages without spaces will type very quickly, so this is important to increase just for readability.
[*] [b]Ignore Dialog Width Rules[/b]
- Important for languages that don’t use spaces. Normally strings will break based on line width on spaces, however with this set to 1 the game will no longer try to check total width of the string, and instead let you add manual breaks or spaces to force a break
[/list]
If your language doesn’t display correctly before you’ve changed these values, take a look at the other languages and see what their values are and try those out! It can take a bit to get it just right, but if you have strings that still don’t fit, it might be time to adjust the localization a bit!
[img]{STEAM_CLAN_IMAGE}/43163498/f8f1cbc9ac98aec2bc2f6258c63b5edd967826af.jpg[/img]
And that’s all there is! If you’d like to finalize your loc, feel free to move the generated dialog.dat from %localappdata%/PrisonCity into your installation folder and move or rename dialograw.csv, however this isn’t totally necessary.
[img]{STEAM_CLAN_IMAGE}/43163498/7ed227b0b8750baf8d787a8619eda1ba1ea55947.jpg[/img]
[i][b]Some considerations:[/b][/i]
[list]
[*] Not all characters/glyphs are supported. There are something like 15,000 characters supported by the game fonts, but there are some limitations, and many I’m not aware of!
[*] If you set the in-game language to a new language you’ve made, it will save that language index to your game data. In most cases, it’ll revert back to English, however keep in mind that the game may crash if you delete the assigned language from the dialog file, and you’ll need to either manually edit your save file in %localappdata%/PrisonCity or restore your new dialog file and set your language back.
- Cloud saves are also enabled on Steam, and this language index WILL go to other devices you have Prison City installed without the updated dialog file, so keep that in mind. You’ll have to add your dialog file to those devices manually.
[*] If you decide to revert back to default languages, make sure to get rid of the [i][b]generated[/b][/i] dialog.dat that’s located in %localappdata%/PrisonCity, as it can conflict with Prison City’s active dialog file without dialograw.csv in the installation folder.
[*] It’s important to use the special characters where appropriate, or they won’t display correctly. For example, you can’t use a button tag (“[jump]”) in anything other than tutorial text boxes.
[/list]
And that's a wrap with this update! Be sure to give this new localization feature a try in Prison City--available NOW!
Follow Retroware's publisher page to stay up-to-date with all our games, news, and more!
https://store.steampowered.com/publisher/retroware