• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Translation Tool V2

knarox

New member
Hi all,

UPDATE:
 

  • Added option to add new languages (field)
  • Added Option to change delimiter for using it as "normal" csv reader
  • Added more logging


UPDATE V2.1:

  • Added Option to remove languages (fields)
  • GUI changes
  • Minor bugfixes


UPDATE V2.11:

  • Fixed bug introduced with V2.1 that last line get lost after saving.


UPDATE V2.2

  • Now able to handle Translations with multiple lines
  • Huge performance update
  • Added a edit box for better multi line edit - also possible to open multiple (for example see more language parallel):

    image.png
  • image.png



UPDATE V2.3

  • Added function to removed double entries (the button was already in V2.2 but not worked)

    This function will delete double entries but not the first one



UPDATE V2.4

  • CL will now be changed to CR+CL (internal)






Pics:

FileOpend.png

Log:

Log.png

Qick HowTo:
 

HowToPic.png

1. Load Localization.txt (default path: ...\Steam\steamapps\common\7 Days To Die\Data\Config
2. Select Entry (4)
3. Choose Field  (5) - the translations are in the red marked area. The other fiels are orther data values.
4. Change Text
5. Save with File->Save...

(1) Here you can load the file.
(2) You can open it and  select a field to remove with the  "-" button. To add a field you press "+" and enter a new name then pressing enter.
(3) Allows you to search all for special items in the list.
(4) The list with the data. Each item in here has the same fields.
(5) The fields that can be edited.
 

Links:

Program

SourceCode

Its only for editing the Localization.txt file and other csv files.

Greetings

knarox

 
Last edited by a moderator:
An awesome piece of work, knarox - and adding a "Language Removal" function will give us back some much-needed extra performance. Whenever I add a new mod into my mess, I always clean up a page or two out of that file - and it does make a difference, (though it's rarely mentioned in any of the forums that I (daily) visit). 
Thank you!

 
An awesome piece of work, knarox - and adding a "Language Removal" function will give us back some much-needed extra performance. Whenever I add a new mod into my mess, I always clean up a page or two out of that file - and it does make a difference, (though it's rarely mentioned in any of the forums that I (daily) visit). 
Thank you!


You are welcome.
Its done.
Now you can remove languages or other fields :)

Please report bugs, opinions or suggestions.

Thanks :)

 
Last edited by a moderator:
Hello Knarox! Thank You for work!

I want to ask You how i can solve some problem.

I often edit the Localization of my mod and chose the path of simply adding lines to the beginning of "Localization.txt". I need this to make it easier to transfer changes from version to version.

Therefore, when i make new entries - there is no problem, but when i add existing lines - they are, of course, duplicated for the game.

So far, i don't pay attention to the yellow messages in the console - they don't bother anyone. But in the future, i would like to clean up the file from duplicate lines that are left from vanilla.

The localization file is some kind of database format that i do not know. Can You tell me which program uses this type of database, in order to do such cleaning automatically?

 
Last edited by a moderator:
Hello Knarox! Thank You for work!

I want to ask You how i can solve some problem.

I often edit the Localization of my mod and chose the path of simply adding lines to the beginning of "Localization.txt". I need this to make it easier to transfer changes from version to version.

Therefore, when i make new entries - there is no problem, but when i add existing lines - they are, of course, duplicated for the game.

So far, i don't pay attention to the yellow messages in the console - they don't bother anyone. But in the future, i would like to clean up the file from duplicate lines that are left from vanilla.

The localization file is some kind of database format that i do not know. Can You tell me which program uses this type of database, in order to do such cleaning automatically?


I am not sure if i am understand your question correct but i will explain how that file is build up - maybe this helps you.

The traslation file is just a csv file. Seperated via the character ',' and including the first line as header.The header defines the "columns". In the actual files there are 20 of them:
 

Code:
Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,latam,french,italian,japanese,koreana,polish,brazilian,russian,turkish,schinese,tchinese,spanish
Each following lines are the data like line 1:

Code:
xuiBuffStatDays,UI,XUI,,?,Days,,Tage,Días,Jours,Giorni,日,일,Dni,Dias,Дней,Gün,天数,天,Días


So its like Key = xuiBuffStatDays
File = UI etc.... and later the translations for each language:
german = Tage
 

Note there are some commas following some commas that means this field is empty. Like:,,
 

Its always important to have in each line the same amount of commas. It has to match with the header.

So if you added some thing but not all lines have the same amount of commas the file is not valid.  And i think that this happens to your editing.

Also important is that some line have quotes with comas in it. Thats the tricky part.

For example line 24:

Code:
buffStatusWoundedTooltip,buffs,Buff,,x,Your maximum health is low. Apply first aid to restore it.,,"Deine maximale Gesundheit ist niedrig. Wende Erste Hilfe an, um sie wiederherzustellen.",Tu salud máxima está baja. Aplica primeros auxilios para restaurarla.,Votre santé max. est faible. Appliquez des premiers soins pour la rétablir.,La tua salute massima è bassa. Usa gli oggetti di pronto soccorso per curarti.,最大体力が低下しています。応急処置を施して回復させましょう。,최대 체력이 낮습니다. 응급 치료 키트를 찾아 회복하세요.,"Maksymalny poziom zdrowia jest niski. Użyj apteczki, aby go przywrócić.",Sua saúde máxima está baixa. Use primeiros socorros para restaurá-la.,"Максимальный уровень здоровья снижен. Воспользуйтесь аптечкой, чтобы восстановить его.",Maksimum sağlığın düşük. Yenilemek için ilk yardım uygula.,你的最大生命值较低。使用急救措施恢复生命值。,你的生命值不足。實施急救,恢復生命值。,Tu salud máxima está baja. Aplica primeros auxilios para restaurarla.
This part: "Deine maximale Gesundheit ist niedrig. Wende Erste Hilfe an, um sie wiederherzustellen."

That is necessary because the text itselft contains comas but these are NOT mean to be "columns seperator". So the quotes means that this section will ignore the commas.

The other files are xml files - these are an other file format to hold data structure.

 
Last edited by a moderator:
Yes, i understand about it.

What do You think - is there an automatic way to remove unnecessary entries?

For example:

wineBarrel,blocks,Block,,,Wood Barrel,,,,,,,,,,Деревянная бочка,,,,

..... (many lines)

wineBarrel,blocks,Block,,,Wine Barrel,,Weinfass,Barril de vino,Fût de vin,Barile di vino////////
 

The fact is that i often change the names and meaning of what is written.

Editing existing records will lead to confusion, so i just create them again - at the beginning of the file.

I would like to get rid of the vanilla duplicates (the last line) that are left without doing it manually, because i have a LOT of them :) .

(something like the function of "finding and deleting duplicates")

 
Last edited by a moderator:
Yes, i understand about it.

What do You think - is there an automatic way to remove unnecessary entries?

For example:

wineBarrel,blocks,Block,,,Wood Barrel,,,,,,,,,,Деревянная бочка,,,,

..... (many lines)

wineBarrel,blocks,Block,,,Wine Barrel,,Weinfass,Barril de vino,Fût de vin,Barile di vino////////
 

The fact is that i often change the names and meaning of what is written.

Editing existing records will lead to confusion, so i just create them again - at the beginning of the file.

I would like to get rid of the vanilla duplicates (the last line) that are left without doing it manually, because i have a LOT of them :) .

(something like the function of "finding and deleting duplicates")
Oh now i got it :)

Yes that is easy to implement for me. Just have to search for double entries  where the "key" is the same and delete all but one.... i am one now ;)

EDIT:

i can find duplicates. Already coded in but i have to work around the returns in the file that make me trouble right now. Like in line 6644:

Code:
TwitchAction_BuffDistortDesc,twitch,Actions,,,"Distorts the vision of the target and their party for 60 seconds.

Does not allow other [FFAFAF]Vision Effects[-] or [FFAFAF]Headshot Only[-] to be applied.",,,,,,,,,,,,,,
This breaks my program right now and i am now looking in that.

 
Last edited by a moderator:
:)  Why did You make Utility? do You translate by yourself?

 
Last edited by a moderator:
Tested this Tool with a Mod, 'Steel Ammo' by KhainGB. Works fine and i'm happy with it.

But since v2.1 the Translation Tool lost the last line from the Keys-List when saving the translation.

First load and save:

ttool01.png


Second load and save:

ttool02.png


Third load:

ttool03.png


 
Tested this Tool with a Mod, 'Steel Ammo' by KhainGB. Works fine and i'm happy with it.

But since v2.1 the Translation Tool lost the last line from the Keys-List when saving the translation.

First load and save:



Second load and save:



Third load:

Thanks for the reply. I fixed it in V2.11.

:)  Why did You make Utility? do You translate by yourself?
I did the first version years ago because yes i wanted to translated it more easy. Then i lost the source code and. 
I was bad that the code was lost but then i was curious if i can write that program from scratch again and how if i can make it in one day - because now i am a bot more experienced. 

That problem with the new lines i am still into it but i think until next week i can solve this.

 
Is the "Remove duplicated keys" button operate for now?
Its added with Update V2.3 that i uploaded now.

UPDATE V2.3

  • Added function to removed double entries (the button was already in V2.2 but not worked)

    This function will delete double entries but not the first one

 
It works not to 100% because i cant split up each entry, but saving will not damage the file.

Good example is entry - its not working:

TwitchAction_BuffNoMeleeDesc

But the entry above is working:

TwitchAction_BuffAntiLeechCommand

This is because the regular expression doesnt work on it. But right now i cant find the error - maybe some regular expression expert can help?

i use this line:

string[] result = Regex.Split(s_single_linebreak, "^\\s(?<Quotes>(?s)(?:(?!\\n).)*)", RegexOptions.IgnorePatternWhitespace);


s_single_linebreak is the text file the contains all data as single line. Then i split by regex. 

The result should be each entry, but it works only about ~99,9%

 
Thank You for the duplicate removal feature! :)

I think it works for me the way i need it! I will use this in my next mod release!

 
Last edited by a moderator:
Can this open a custom localization.txt file, and expand it to add ALL of the languages?  I only know english and so my .txt file only contains the updates for english.  Would like to open it up and be able to save it with ALL of the languages.

 
I can't download this.  Says forbidden if I copy the link to a new tab in my browser.  otherwise it just flashes real quick when i click on it to download.

 
I can't download this.  Says forbidden if I copy the link to a new tab in my browser.  otherwise it just flashes real quick when i click on it to download.


Hi Iceburg71

The link works perfect, it can be a basic failure and you just have to reload the page.
With Google it is also useful to use Save link as.
Regards

 
Ok, I got it downloaded.  When I run it, it tells me I  need .net installed.  It asked me if I wanted to download it.  I clicked ok and it took me to a .net download page.  I tried both the 64 bit and 32 bit versions, and it still asks me to install .net.  so what version of .net is needed, because it takes me to 5.09, but that doesn't work.

thanks

 
maybe some regular expression expert can help?
I’m not a regex expert, but I come from the Perl world and I know even there CSV parsing is difficult (many reasons, one is that there’s no actual CSV standard, etc) so people are encouraged to use modules to parse it as those modules handle a lot of edge cases and formats. Anyway, I’m not a .Net person (a previous post indicates .Net is needed, I don’t know what language you’re writing your tool in) but it appears there may be a built in CSV parser for it:https://odedcoster.com/blog/2012/03/28/did-you-know-a-net-csv-parser-that-comes-with-visual-studio/

 
Last edited:
Back
Top