as afaik the localisation patcher doesn't work for linux i made a python script to adjust the executable
it takes the template.lng and the Dwarf_Fortress file and produces a Dwarf_Fortress_Lang file with the changed names
(note: replacements longer than the original get cut off)
#!/usr/bin/python
import os.path
def main():
if(os.path.exists("./Dwarf_Fortress")):
df = open("./Dwarf_Fortress", "rb")
print "opened df executable"
if(os.path.exists("template.lng")):
lng = open("template.lng", "rb")
print "opened template.lng"
translate(df, lng)
lng.close()
else:
print "a template.lng is needed"
df.close()
else:
print "the df executable is needed"
def translate(df_file, lang_file):
raw = df_file.read()
data = raw[0xd02d00:0x00da0cff] #the relevant part
for line in lang_file:
line = line.rstrip()
if not(line[0] == "|"):
continue
(old, new) = line.split("|")[1:3]
if old == new:
continue
if len(old) < len(new):
new = new[:len(old)]
if len(old) > len(new):
new = new.ljust(len(old), "\0")
data = data.replace(old, new, 1)
print "replaced " + old + " with " + new
target = open("Dwarf_Fortress_Lang", "wb")
raw = raw[:0xd02d00]+data+raw[0x00da0cff:] #put back together
target.write(raw)
main()
you need to add the md5-hash(should be: 98aa323f1b33623851405254ef5b509c) to hack/symbols.xml
(and add it to the 0.34.11 version)
also you need to mark it as executable
edit: first bugfix already