Fallout 4

There are few mods like Better Item Sorting or Valdacil's Item Sorting, that modifies item name file by adding some prefixes, in order to let you sort you inventory more easily.
The most interesting thing is also to use those mods with DEF_UI/DEF_INV, that replace the sorting {tag} by an icon.

With Fallout4translator, you can translate those mods very easily, by using regEX:
-Open Fallout4Translator
-set you correct language source dest (en ->your language)
-Menu File -> open the item sorting mod esp
-select a line from the mod with a tag (that line will be used to test the regEx on the fly)
-Tool->Regex Translation Tool

Most strings in item sorting mods are like this:

(Note) My Special Demo Note 
{Tag} My Special Demo Tag 
[Chem] My Special Demo Chem
[Perk:Mag] My Special Demo Mag issue #1

there, you need to isolate the 2 main parts of each string, the tag and the caption:
you can to this very easily with the following regEx: 
^([\[\(\{\|].+?[\|\]\}\)]) (.+) 
^ means: we start by the beginning of the line
([\[\(\{\|].+?[\|\]\}\)]) means: get everything inside () {} [] ||, including the given brakets, and put the result in backreference 1
(.+) means: catch the end of the line and put the result in backreference 2
then use this in the replace string:
#1 %2
#1 means: Keep the first back reference as is and put it in the replace string
%2 means: try to translate the back reference before putting it in the replace string
click ok.
a lot of entries are now translated 

you may need to adjust some others (because the author may have changed some original captions
With regex you can do a lot of things. Possibilities are virtually infinite.
let say you want to isolate the mag number issue, do this:
[Perk:Mag] My Special Demo Mag issue #1
^([\[\(\{\|].+?[\|\]\}\)]) (.+) (\d+)
the last (\d+) will get the last number next to the end and put it in the back reference 3
#1 %2 #3
etc...


It now you want to translate the Tag (not recommanded if you use DEF_INV, beacuse english tags are the most uptodate) you can use a batch search and replace.
In the batch file, create an entry for each tag and save it so you can keep it for future update
Then apply the batch. 

Article information

Added on

Edited on

Written by

mcguffin

1 comment

  1. PapaiJarda
    PapaiJarda
    • member
    • 4 kudos
    I was using two xEdit scripts but yet typing tags by hand. This method is way better, thank you very much.
  2. necromunger
    necromunger
    • supporter
    • 5 kudos
    Good tutorial, thanks mcguffin.