nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.15k stars 149 forks source link

After exporting a text file, text formatting breaks. #347

Closed Herman-Sid closed 4 months ago

Herman-Sid commented 4 months ago

Hello. I'm trying to translate text for the game Outward. I open the resources.assets archive, its location is standard steamapps\common\Outward\Outward_Defed\Outward Definitive Edition_Data The file menu_all (inside the archive) is taken as an example.

If I click View Data, the content looks good, all indents and spaces are preserved. But if I click Edit Data, OR if I export the file, then all the indents and spaces disappear and I get one long line. It doesn't matter what format I export in, the resulting formatting is always ruined.

I tried opening the export file in different editors, but the content was one line.

And when I import this file back, its formatting is restored. Working with a bunch of letters and text without any formatting makes the process very difficult.

Can you do anything about these ?

good bad bad2

nesrak1 commented 4 months ago

Use the text asset plugin

Herman-Sid commented 4 months ago

Where is this plugin located, how to install it and how to use it? Could you write more about this, I couldn't find a description of it in the main thread. In the program itself, if I click the “plugins” button, there are only two plugins: Import.txt and Export.txt

nesrak1 commented 4 months ago

The "bad view" as you call it is very much intentional. It escapes certain characters like newlines to \n and isn't great for multiline strings (but is great for the computer parsing it). The import and export txt options simply copy the string as is in and out of a file. So you should use that instead of editing the dump. That does mean you can only edit the exported file in an external text editor and can't edit the file in a dialog box in UABEA, but that's just how it has to be for now.

Herman-Sid commented 4 months ago

It's a pity that this is so, do you happen to know what text editor can also escape the special characters /n, so that the text looks normal during editing ?

nesrak1 commented 4 months ago

As I said, export .txt and import .txt (the text asset plugin) is what you want. You don't want to export/import dump because that contains \n. Despite the ".txt" part, you can name it whatever extension you want.