Shardpunk: Verminfall – How to put custom translations

Shardpunk: Verminfall – How to put custom translations 1 - steamsplay.com
Shardpunk: Verminfall – How to put custom translations 1 - steamsplay.com

Tips and Tricks for Shardpunk: Verminfall – How to put custom translations
 
 
This guide explains how to put custom translations (including support for new languages, or expanding the existing ones) into the game.
 
 

Introduction

Starting from version 1.0.29, Shardpunk is able to dynamically read and import text files holding translation data. This allows for creating mods that can:
 
 

  • Expand an existing translation with more combat/shelter character texts,
  • Create translations for a new language.

 
 
I’ve added an example mod (“example.esperantoMainMenu”, disabled by default) into the “~mods” folder, that you can use to see how to make stuff work. Also, I’ve uploaded one mod example to Nexus Mods: https://www.nexusmods.com/shardpunkverminfall/mods/1 – [nexusmods.com] 
 
 
 

Folder structure

Here’s how the folder structure for translations looks like:
 
 

Shardpunk root folder
 Data
 Languages <-- this is where the predefined, default language (English) is located
 ~mods <-- this is where you will be adding your stuff

 
 
I’ve added an example mod (“example.esperantoMainMenu”) into the “~mods” folder, that you can use to see how to make stuff work. Also, I’ve uploaded one example to Nexus Mods: https://www.nexusmods.com/shardpunkverminfall/mods/1 – [nexusmods.com] 
 
 
Here’s how a folder structure for a mod should look like:
 
 

[Root folder of the mod]
 Languages
 [Language code folder]
 meta.json ← file with basic metadata
 [.txt files with actual translations]

 
 
[Root folder of the mod] can have any name you like. Obviously, if someone creates a mod with the same folder name as yours, there will be issues. The example mods I’ve created are called “example.moreCombatTexts” and “example.esperantoMainMenu”.
 
 
“Languages” folder just needs to be there.
 
 
[Language code folder] holds a language code that the game will use to identify a language. I recommend using ISO 639-1 two-letter codes here, but you can basically use anything you want.
 
 
Important: the game will combine all translations from language folders of the same name. So if you want to create a mod that extends/overrides some of the default English translations, the language folder name should be “en”, as that’s the folder name present in the default translations path (“Data\Languages\en”).
 
 
 

The meta.json file

The meta.json file looks as follows:
 
 

{
 "displayName": "English",
 "description": "An example mod holding expanded combat texts for the English language.",
 "enabled": "true"
}

 
 
The displayNamefield holds the display text of the language that the mod provides. You should set it to a user-readable text when you are creating translations for a new language. The value of displayName will be displayed in the game’s settings window in the language selection dropdown.
 
 
The descriptionfield is currently not used anywhere, it’s only for informational purposes.
 
 
The enabled field allows you to control whether the game should use the translations from your mod.
 
 
 

Translation files

.txt files with actual translations are simple text fields, where every odd line holds a translation key, and every even line holds a translation value. As you might have guessed, every translation file has an even number of lines.
 
 
More info on the .txt files:
 
 

  • They have to have a .txt extension for the game to recognize them.
  • The names of these files do not matter.
  • Translation keys can appear multiple times in one/multiple .txt files, but it does not really make sense. The latest found translation value always wins (although I don’t load the files in alphabetical order, so I cannot guarantee what will be overridden by what).

 
 
In most cases, the names of translation keys should be self-explanatory. For instance, “weaponModification_StunModule_name” is about the name of the stun module weapon modification, and “skill_sociopath_desc” is about the description of the “sociopath” skill. When in doubt, refer to the English translations.
 
 
 

Special case: dynamic translation keys

The game displays random character messages during different combat/shelter situations. For example, a character might comment on the fact that they’ve killed an enemy, healed an ally or found something of value. When the game determines which text to display in such a situation, it does not look for a specific translation key – it looks for any translation key that matches a certain prefix. Consider this list of translation keys:
 
 

combatMessage_EnemyStillNotEncountered_common_1
That's strange. We should be seeing them by now...
combatMessage_EnemyStillNotEncountered_common_2
Still no trace of the vermin.
combatMessage_EnemyStillNotEncountered_common_3
It's too quiet here.

 
 
As you might have guessed, these texts will be used when determining what a character should say if there are no enemies present on a map after a few turns. The general syntax of such dynamic translation keys is as follows:
 
 

[combatMessage|shelterMessage]_[eventType]_[characterType][suffix]

 
 
There are different eventType values present. Explore the English translation keys to see all of them.
 
 
The characterType part allows you to define which character will be allowed to use this text. “common” is allowed to be used by everyone, but if you use character-specific type (you can find all character types in the characters.txt translations file of the English translation), you could create a message that would be only used by a specific character type.
 
 
Suffix is anything, really. You might want to make sure that your mod is using an original suffix name to minimize the occurrence of identical keys in other mods.
 
 
Example: if you would like to create a combat message specific to Silas, you could write:
 
 

combatMessage_EnemyStillNotEncountered_revolverCrazy_myCustomSuffix1
My name is Silas, and I do not like the fact that there are no enemies around.

 
 
 

Translation values

When creating translation values, stick to these rules:
 
 

  • Every translation value needs to be put in a single line. Use “\n” to put line breaks in a translation value.
  • Curly brackets “{“ / “}” are used for formatting. Example:
     
     
     
     
     

    "{0}" action now also grants +{1}% crit chance but costs {2} Stress instead.

     
     
     
    Will be displayed in the game as:
     
     
     
     
     

    "All In" action now also grants +10% crit chance but costs 4 stress instead.
  • Square brackets are used to highlight parts of text. This is often used when dealing with descriptions. Text put between square brackets will be highlighted in the game.

 
 
 

FAQ

Where I can upload my mod?

 
 
I’ve created an extension – [nexusmods.com]  for the Vortex app – [nexusmods.com]  for Shardpunk, you can upload mods there.
 
 

Can I somehow debug the translations’ loading process?

 
 
Yes, game logs should hold relevant data. The logs folder of Shardpunk is located at %appData%\LocalLow\Clockwork Pile\Shardpunk.
 
 

My translation does not fit into a UI element. What now?

 
 
I expect that this might be happening. If there’s no shorter alternative for a translation, just let me know where the problem exists, I will try to adjust the UI.
 
I am working on a Polish translation and I can see some issues about the UI size already.
 
 

What about future game updates? My translation might become outdated.

 
 
That is correct. Note that if there are any future changes to the translation texts, I will be adding new versions of keys instead of adjusting the existing ones – so the worst-case scenario will be that the game will fall back to English.
 
 
I might think of a separate thread/Discord channel for people doing translations so that they receive a heads-up on the upcoming additions/changes.
 
 
Thank you for your interest in Shardpunk: Verminfall – How to put custom translations, inspired by the outstanding work of bryqu. If you have any recommendations on how we can improve this content, please share them in the comments. Have a beautiful day, and don’t forget to bookmark us for more fresh updates and articles!
 


Be the first to comment

Leave a Reply

Your email address will not be published.


*