Workers & Resources: Soviet Republic 워커스 앤 리소스: 소비에트 리퍼블릭

Workers & Resources: Soviet Republic 워커스 앤 리소스: 소비에트 리퍼블릭

평점이 부족합니다.
BTF Tool - localization text editing
Nargon 님이 작성
Do you want to change ingame strings? Or are you just curious about what texts the game hides? Then there is a solution. Tool for editing *.btf files.
   
어워드
즐겨찾기
즐겨찾기됨
즐겨찾기 해제
Introduction and download link
Language files (*.btf) are not easily editable. However, I was not satisfied with the translation of some texts and I was looking for a way to change the texts.
After some reverse engineering I found how to read and write the structure of *.btf files. So I created a tool to export/import strings to an easily editable text file.

The BTF Tool is a simple console application (no GUI) for windows.
Requires .NET Framework 4.8
You can download this app on Github: https://github.com/Nargon/BTFTool
It has no installer, you have to download the zip file and extract all the files somewhere.

This app is intended for advanced users. So you must at least be able to work with the command line.
WARNING! This app isn't perfect, it doesn't have btf format checks, so if you're not careful, you might damage the btf file. Please don't try stupid things or you will have to restore btf file from steam integrity check.

How to change texts? Here is a quick guide on how to do it.
Export
Export all texts from english language to file EN.txt:
BTFTool S:\Steam\steamapps\common\SovietRepublic\media_soviet\sovietEnglish.btf --export=EN.txt
In the file EN.txt you will see a lot of strings. The structure is simple.
String <number>: "text"
Modify
Now comes the hard part! You have to know what you want to do.
For exaple i want to change the "Alcohol" to "Lemonade" and the "Alcohol addiction" to "Lemonade addiction" :)
You need to find the original texts and the string number. There is no simple way to find the correct line. Just look at the strings around and then you can guess whether you have the right one or not. Or try it out and see where the change shows up. I found the correct string numbers for this example to be 512 and 2454.
I prepared a new file (Patch.txt) with these two lines and modified them to Lemonade. Of course, you can edit strings directly in a large text file, but I recommend preparing a patch file that contains only the lines you changed.
Import
Import the changed strings back to sovietEnglish.btf
BTFTool S:\Steam\steamapps\common\SovietRepublic\media_soviet\sovietEnglish.btf --import=Patch.txt
See the result
I don't know how to describe it, but a picture is worth a thousand words.

It is not perfect because I only changed two strings, but there are a lot more alcohol related strings.
The purpose of this guide was not to turn all alcohol into lemonade, but to show how to work with the tool for editing btf files. And I accomplished that.
Conclusion
Alcohol is changed to lemonade, what to do next?
I recommend keeping your Patch.txt and preparing a .bat or .cmd file for easy import. Why? Because when you update the game, the localization files are overwritten with the new version. And then all your lemonade will turn back to alcohol. So you will have to run the import again and modify the strings again.
댓글 6
den_rain 2025년 2월 17일 오전 1시 56분 
Works nicely! Thank you!
Polkovnik Berezin 2024년 7월 11일 오전 10시 24분 
Although I didn't make the first mistake, and I also tried with the correct path (where I had my file), I did not realise that the spaces were preventing the command from being properly executed – which is not surprising in retrospect. I have now managed to get it to extract correctly. Many thanks, comrade Potski! :rare_soviet_star:
potski 2024년 7월 11일 오전 9시 46분 
https://steamcommunity.com/id/PolkovnikBerezin I think you first tried to double click the app, then you have worked out to run it from the command line? Note that the example command line that is given above uses a path to the BTF file that has no spaces, all the bit starting S:\.... He was able to run that because he has the Steam folder stored in his S: drive, when by default it will appear in your Progam Files (x86) folder, in other words in a folder with spaces in its name. To use spaces in a path in Windows you just have to put quote marks " " round the whole path, "C:\Program Files (x86)\..." That worked perfectly for me. Now I can get Vodka, not lemonade ;)
Polkovnik Berezin 2024년 7월 10일 오후 5시 00분 
After a today of messing with it, I have managed to go back to the original issue. The executable runs, but seems to skip the parsing stage. I think I have exhausted my capacity to trouble-shoot.
Polkovnik Berezin 2024년 7월 9일 오후 6시 07분 
Update to this: After downloading the installer for the .NET Framework 4.8 targeting pack and then running it, I was told I already had it installed. Upon trying to run any commands with BTFTool now I get the console error "Access is denied.", along with a pop-up explaining that the program is incompatible with my device. I'm guessing I'm missing something, considering that I have only a vague idea what I am doing. I would appreciate any help if you can be bothered to put up with me.
Polkovnik Berezin 2024년 7월 9일 오후 3시 41분 
Cordial greetings! I am the current Bulgarian translator for the game, and a Czech friend of mine directed me to this potentially extremely useful tool. I have been trying to get it to read a copy of the latest .btf for the past half-hour, alas to no avail. I have downloaded the tool and successfully run BTFTool through the command line, but it is only writing the new .txt file with no content. Here is what I entered exactly, and the outputs.

E:\Program Files (x86)>BTFTool S:\Program Files (x86)\sovietBulgarian.btf --export=TEST.txt
Export OK, Number of lines: 0, File written: TEST.txt
ALL DONE, app exit

For some reason, it appears not to be performing the parsing stage at all – no error is displayed so I cannot know for certain. Do you have any advice as to what might be the issue?