Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Python] Language extractor and injector  (Read 1549 times)

Sallen

  • Bay Watcher
    • View Profile
[Python] Language extractor and injector
« on: January 04, 2014, 07:59:20 am »

This simple script will extract words from language files and put them a word per line, for easy automatic translation or treatment. It can also read that list and put the translated words back in their place.

Always backup your work! I take no responsibility for anything this script may do to you, your computer, your pets or your dwarves.

This is how it works. It has two modes "extraction" and "injection".

df_langex.py e langfile wordlist
This extracts the words from langfile and creates (or overwrites) wordlist. You can now work with wordlist.

df_langex.py i wordlist langfile
When you are happy with your words, give it wordlist and it will overwrite langfile replacing the words in it with those in the list. Note that the same langfile should be used for extraction and injection, otherwise the word count won't match and things will get messed up.

Download
http://dffd.wimbli.com/file.php?id=8288