Jump to content

[Tool] automatic creation of translation files


JimPanzee

Recommended Posts

What? How?

This script will read the scripts folder of your mod and read every item (DisplayName) and recipe.

It than connects to google translate and will write the translation in the lua\shared\Translate\[language]\ files.

 

But!

Yeah, it's only google translate. It works best with sentences. With groups of 3 words or less its not as good. While testing it with german, it got about 40% - 60% spot on and about 90% close enough to understand.

You have to decide if this is enough for your mod. Even if you don't want such a translation, this script will be good enough to create a starting point for a manual translation. It's faster to correct a few wrong words, than writing the whole file yourself.

 

Ok, how do I...

  • you need Python 2.7 installed on your machine to run the script
  • both scripts needs to be placed in your mod folder, next to the media folder
  • double-click "createTranslation.py"
  • it will create a results.log with some information about the process
  • it will write the translations in the folder Project Zomboid expects them.

What if I already have translation files for my mod, but I want to add a new item and need a translation just for this one?

First of: Better backup your existing translations first! Seriously file encoding is a bi.... I can't guaranty that it will work with your files. Special chars could get corrupted by the script if your file isn't utf-8.

But, if everything works, the script should always read existing translations first and just add new items and recipes to the existing translation files. It should NOT replace existing translations with google translate.

 

I'm from ... can it also create a translation for my language?

Sure. Right now it will only create german and french. But you can just open the file via any text editor, scroll to the bottom and add the line writeTranslationFiles('[your language]') to the other lines.

 

Copyright

The script that talks to google (goslate) is not from me. If you want more info about it, go here: goslate

With the rest, do what you want.

 

Download

Translator.rar

 

Please report any bugs you encounter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...