Pillars of Eternity 2: Deadfire

1. Introduction:
This is a short guide on how you could go about making your own translation of this mod. Hopefully you'll find this guide useful either way as it covers some basic modding know-how for Pillars of Eternity.

Files you will be editing:
Directory: /%GAME DIRECTORY%/PillarsOfEternityII_Data/exported/localized/%YOUR LANGUAGE%/text/game/

  • abilities.stringtable
  • cyclopedia.stringtable
  • items.stringtable
  • statuseffects.stringtable

Don't forget to make backups of the originals!

Programs and websites you will be using:


2. How to translate this mod into another language using RegEx:

In order to reach some sort of efficiency when working with .stringtable files you'll need to get acquainted with the programming language RegEx. It's a huge pain to learn but once you get the hand of it you'll be able to automate most of the editing process.

Here are two examples of how a RegEx code could look like (courtesy of Xaratas), they ar ripped from a java program. That's why every \ is doubled.:

Example #1: English translation
// 12 * 3 = 36 per language
final static String[] replacementWords = new String[] {
// en
// constitution
"(Fit)", "(Hardy)", "(Robust)",
"(Sicken)(\\b|ed|ing)", "(Weaken)(\\b|s|ed|ing)", "(Enfeebl)(\\b|ed)",
// resolve
"(Steadfast)", "(Resolute)", "(Courageous)",
"(Shaken)(\\b|s|ed|ing)", "(Frighten)(\\b|s|ed|ing)", "(Terrif)(\\b|ies|ied|ying|y)",
// dexterity
"(Quick)", "(Nimble)", "(Swift)",
"(Hobbl)(\\b|ed|es|e|ing)", "(Immobiliz)(\\b|ed|e|ing)", "(Paralyz)(\\b|ed|es|e|ing|ation)",
// intellect
"(Smart)", "(Acute)", "(Brilliant)",
"(Confus)(\\b|ed|es|e|ing)", "(Charm)(\\b|ed|ing)", "(Dominat)(\\b|ed|es|e|ing)",
// might
"(Strong)", "(Tenacious)", "(Energized)",
"(Stagger)(\\b|ed|ing)", "(Daz)(\\b|ed|es|e|ing)", "(Stun)(\\b|s|ned|ning)",
// perception
"(Insightful)", "(Aware)", "(Intuitive)",
"(Distract)(\\b|ed|s|ing)", "(Disorient)(\\b|ed)", "(Blind)(\\b|ed|s|ing|ness)",


Example #2: German translation
// de_patch
// Verfassung
"(Fit(te)?)", "(Zäh(e)?)", "(Robust(e)?)",
"([Ee]rkrank)(te|t|en)", "(\\b|Ge)(schwächt(e)?)", "(Entkräftet)(e|\\b)",
// Entschlossenheit
"(Standhaft(e)?)", "(Resolut(e)?)", "(Mutig(e)?)",
"(Geschockt)(e|\\b)", "(Verängstig)(te|t|en)", "([Ee]rschütter)(ter|t|n)",
// Gewandheit
"(Schnell(e)?)", "(Flink(e)?)", "(Schwungvoll(e)?)",
"(Humpeln)(\\b|d\\b|de)", "(Bewegungsunfähig)(e|\\b)", "(Gelähmt)(e|\\b)",
// Intellekt
"(Klug(e)?)", "(Scharfsinnig(e)?)", "(Brillant(e)?)",
"(Verwirrt)(e|\\b)", "(Bezaubert)(er|e|\\b)", "(Beherrscht)(e|\\b)",
// Macht
"(Stark(e)?)", "(Hartnäckig(e)?)", "(Munter(e)?)",
"(Taumelnd)(e|\\b)", "([^(]Benommen)(e|\\b)", "(Betäubt)(e|\\b)",
// Wahrnehmung
"(Einsichtig(e)?)", "(Aufmerksam(e)?)", "(Intuitiv(e)?)",
"(Abgelenkt)(er|e|\\b)", "(Desorientiert)(e|\\b)", "(G?e?blende)(te|t|n[^d])"
};


As you can see you'll need to translate the words to augment, to suit your language and wordforms. But these two examples are a good place to start when trying to figure out how RegEx works.

3. Color codes:
In order for this mod to keep it's visual design across all different languages please use the following color codes:

Attribute               Color        
--------------              ---------        
Constitution =>    #f7b733
Dexterity       =>    #72da26
Intellect        =>     #00a4ff
Might            =>     #ff4800
Perception    =>    #ca58ff
Resolve         =>    #30d3d5

4. References:

- Information regarding RegEx can be found in this mod's forum starting with this post.
- [How To] Structure mods (Official forum).
- [How To] Work with Stringtables (Official forum).

Article information

Added on

Edited on

Written by

Spherikal

3 comments

  1. Spherikal
    Spherikal
    • premium
    • 24 kudos


    I've installed macros for Notepad++, but I'm totally confused what they're supposed to do. I can't see the difference. Could you please elaborate?


     
    So first off, macros are used to automate processes that you will do over and over again. If you only want to change one thing once there's not much point in creating a macro. What the macro does is that it records what you're doing in the program and then saves those actions for you to use later.
     
    In Notepad++ you'll find the Macro menu at the top bar and you'll start recording your macro by pressing "Start Recording". When you're done press "Stop Recording" followed by "Save Current Recorded Macro".
     
    With the basics out of the way let's see what you could use a macro for!
     
    Let's say that you want to find all entries in abilities.stringtable containing the keyword "Sickened" and make that keyword bold.
     
    First you'd have to make a RegEx to be able to find every possible spelling variation of the keyword (sick, sicken, sickened, sickening, sickens etc), which would look something like this:

    (sick)(\b|ened|ens|ening|en)

    You can try your RegEx out over at RegEx101.
     
    Next you'll want to add the actual bold style to your keyword which you'll do by using the following formatting:

    &;lt;b>$1$2&;gt;

    You'll need to use &;lt; and &;gt; instead of < and > when working in XML-files.
     
    The `$1` and `$2` means that it will replace what you find using the first RegEx with the first capture group `(sick)` coupled with the second capture group `(\b|ened|ens|ening|en)`.
     
    Once you're satisfied with your RegEx open "Find" in Notepad++ (default keybinding is Ctrl+F) and select "Replace".
     
    And it's at this point you'll start recording your macro.
     
    Enter the first RegEx into the "Find what:" window and the second RegEx in the "Replace with:" window.
     
    Press "Replace All" and voíla you've now added <b> </b> tags around all variations of the keyword Sicken to your abilities.stringtable file.
     
    Stop the macro recording, save it and then use it whenever you need to change all variations of the keyword Sickened in your mod.
     
    Hope that cleared things up a bit!
    1. namelessone123
      namelessone123
      • member
      • 0 kudos
      I see, thanks for explanation! I've read macro instruction again (in mod files) and looks like they just add formatting? I wrongly though they would boost my translating process. I think I'll just ask other guy who does Polish translation and see if I can help. Seems there's a lot of text to translation (not just afflictions/inspirations, but descriptions as well which I guess I have to copy from official language files?
  2. namelessone123
    namelessone123
    • member
    • 0 kudos
    I've installed macros for Notepad++, but I'm totally confused what they're supposed to do. I can't see the difference. Could you please elaborate?