Working on a RimWorld translation tool.. need feedback

Started by cappie, October 12, 2014, 01:46:13 PM

Previous topic - Next topic

cappie

Hi guys,

I'm working on a translation tool that can import new string's from Tynan's original english translation (including the Defs, but right now, they're not yet implemented) to make the translation work a bit easier. I'm doing this because I was fed up with the incomplete translation for alpha 7 :)

NOTE: This tool is meant as an augmentation to the Github translation repositories (not as a replacement!!) for those who aren't as familiar with Git(hub), editing XML files but to know how to properly translate game language-strings..

What I've written right now is a small importer that reads in the Keyed folder from the original English translation. Next step is to also import the Defs folder (which shouldn't be that hard, considering I wrote a recursive directory importer that can handle XML's). The importers are written in such a way that when there's a new version of RimWorld, I can just update the files and re-run the importers to add all the original English strings (the new ones). Running such an import should not affect the translations already in the database then. Anyway, after that I'll write an importer for all current translations, so that the translations database is going to be filled to near completion. My goal is to create a tool with which one can 'generate' the entire language packs for RimWorld, based on which translation is completed or not..

This means that this tool will eventually be able quickly update whenever a new version of RimWorld is released and it can generate the translated 'Keyed' and 'DefInjected' files (in their respective subdirectories) for each language once the missing (new) strings have been translated. I have a first version of the basic translation page running at http://rwt.gamechat.nl/translate.php (rwt = rim world translator)

Feel free to have a look and provide some feedback... let me know if this is useful at all, of not I'll scrap it for own use on other projects, but I thought it might be useful.

My todo list is:

  • Create actual decent code instead of this prototypey shit
  • Create original English Defs importer & import them
  • Create importer for all current translations
  • Create a way to log in using some kind of authentication service (OpenID or something similar)
  • Create export script to generate .zip containing the entire Languages-folder
  • Create a voting system so that the community decides which version of a translation string is best.. we should be able to vote what best suits the game, considering it's unique feel and setting.

TL;DR: I'm building a RimWorld translation tool (which is not finished yet) for great translators that are not able (or willing) to work with GIT.. got feedback?

UPDATE: released the code on Github.. sorry I didn't check this thread earlier; I kinda lost hope and abandoned it after a month of 0 replies :)

Pirx Danford

#1
Its looking very nice.
My suggestions to improve it (besides your todo list):
- also insert a "Home" Link back to the first page and reset the selected language to empty, because right now if I go back via the browser back button the language stays selected, but the overall overview is shown - one has to select empty or another language to switch back to the own language again
- offer a select for Origin between the language select and "only show the first", which filters displayed elements by Origin
- exchange the input type text for the amount of strings to be shown with a select and offer something like 3, 5, 10, all
- make the untranslated strings checkbox do what it is labeled for, so dont use it to remove the display limit (if you use my former suggestion that is done with the all option then), but make it only show untranslated strings when it is checked and additionally display already translated strings when it is unchecked, or make a select with "Untranslated", "Translated", "Both" instead of a checkbox
- introduce a search function which is controlled by a select with the options "All Fields", "String Name", "Origin", "Original English", "Translated Text", meaning the search does search in all fields or only in the subsequently selected fields, only offer the search on each languages page, so you only search within the scope of that language

Thats all for now - great work so far :-)

cappie

Thanks for the feedback, the UI isn't final.. I wanted to quickly whip something up to start doing some translations, but after 30 minutes I realised it would be better for me to ask here first.

I'm hoping Tynan will respond to this, because t.b.h. he has the final say about I should continue with this or not.. I think the general idea for an importer-exporter with a centralised translation system could be very useful, however I don't feel that I have the best overview needed for it to be truly useful.

Also, as soon as I have something that works, I will release this on Github.. but right now, the code is rather.. erhm.. prototype'ey.. :)


Tynan

This looks very interesting! Thank you for doing this.

I thought about writing a simple tool that would check a translation and list the missing elements by comparing it to the original English Keyed folder and to the original Defs. Essentially, it could auto-generate a to-do list. That might be another idea for a starting point.

But this looks like a much more full-featured project! I very much hope you can finish it.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Sakuukuli

This tool would make translating much easier! It reminds me of https://crowdin.com/, but that one has a monthly fee.

I've made translate-ready templates for translating DefInjected's: https://github.com/Sakuukuli/RimWorld-Templates

I've also included the script that I used to generate those files, it's not pretty but it might give you some ideas: https://github.com/Sakuukuli/RimWorld-Templates/blob/master/RimWorld_DefsToDefinjecteds.py

AlyxMS

My biggest pain about translating so far:

No knowing where the problem is.
E.g. Tynan changed Metal to Steel in Alpha 8, the debug log is clearly telling me MineableMetal does not exist, but I end up looking times and times over the thing def folder to find that it is in the Buildings_Natural.xml
I hope this tool would be able to scan all my XML files and locate the keyword "MineableMetal"

Oh and another thing:
<rep>
    <path>XXX.stages[0].label</path>
    <trans>XXX</trans>
</rep>
<rep>
    <path>XXX.stages[0].description</path>
    <trans>XXX</trans>
</rep>
<rep>
    <path>XXX.stages[1].label</path>
    <trans>XXX</trans>
</rep>
....

Making these is a pain. Since alpha 8 utilizes this kind of thing much more than ever.
If templates like this can be auto generated it would be really helpful.

Haplo

To find words I know (and mass replace them) I use this: dnGREP
It's a rather helpful tool to locate these hidden words :)

AlyxMS

Quote from: Haplo on December 15, 2014, 04:49:05 PM
To find words I know (and mass replace them) I use this: dnGREP
It's a rather helpful tool to locate these hidden words :)

Thanks, that's would save me some time on debugging.

Nemh

That's perheaps some kind of hidjacking a bit more that topic, but I just create a small script which can be useful associated with the Sakuukul work : I explain, the French translation projet (for example) is actually a bit outdated, but It's also a bit long to check all files, compare them to the Sakuukul template folder, see line per line which label are missing etc... So I just made a little python script (runs fine on my GNU/Linux with python3, I don't know a lot about the Windows or Mac compatibility especially with the files paths, but feel free to modify it) wich takes some arguments and say wich label are missing in the specified file.

With the Keyed's files, it works file by file, with DefInjected it works folder by folder because of the variation of the names of the .xml's. 

Be carefull to modify the template folder path and the local one, to point the ones in your PC, I have this configuration :

Main Folder
       |
       | ------ RimWorld-Templates
       |                  |
       |                  | ----- Keyed
       |                  | ----- DefInjected
       |
       | ------- RimWorld-fr
       |              |
       |              | ----- Keyed
       |              | ----- DefInjected
       |
       | ------- diff.py


and that's works pretty nicely : for example I can this kind of output :
~/Rimworld/Traduction $ python3 diff.py -k Alerts -d BiomeDef
For Keyed/Alerts.xml :
Missing label :  <HunterLacksWeapon>
Missing label :  <HunterLacksWeaponDesc>
Missing label :  <BrawlerHasRangedWeapon>
Missing label :  <BrawlerHasRangedWeaponDesc>
Missing label :  <AlertHypothermia>
Missing label :  <AlertHypothermiaDesc>

For the DefInjected/BiomeDef folder :
File up to date


Help is accessible using the -h option, I don't know if that would be interesting for anyone, but I think that could, tell me (I know I'll use it personally). Also if tyou have any question, just ask there (or on another place if you think I should make another topic)

The script is accessible on this git repo or here for direct view, (but no license or Readme, even if it's actually very small right now ^^, and not always up to date I presume). That's one of my very first program in Python, I mainly learnt it today, and I came with only C experience, so the coding quality should be quite poor, but it works, so I'm quite happy ! :)

Edit : I still have some small updates idea, like finding old label wich aren't used anymore, or finding all the missing label in all the file tree, and also fixing some things (try using it with -d TraitDef :s).

Gaesatae

I can't even begin to think how much time, work and suffering, the scripts and tools on this thread have saved me.

Sakuukuli: I'm sure I'd have given up at the moment I open the ThingDef folder if it wasn't for your script.
Haplo: dnGREP! I've found love...
Nemh: I've used your script to locate all the lists using the German translation as the template. Saved a lot of time. (I though "if a German couldn't find a list in the code I'm sure a Spaniard like me isn't going to... also if I miss one I could always blame them."  :D ;))

I just wanted to say thanks!

cappie

Sorry, but I haven't checked up on this post after a month of no reactions.. I thought it just died :)

Anyway, I released my piece of shit code on GitHUB.. I'll more than gladly host all updated code.. just add a pull request and we'll work on it together.

https://github.com/cappie/rwt

Tynan

This is great, I really appreciate you guys writing software to help ease this process.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

cappie

Hey Tynan, you're welcome man.. I salute you on living the dream of any indi game developer (even with all the coders angst, writersblock and negative folk on the forum and elsewhere you have to deal with)

I'd like to see if I can help by pouring some more time into this and building an importer/exporter for your translation files.. feel free add me on Hangouts (preferable) or drop me a line via (myname}2000{at)gmail.com (hopefully it wont drown in my inbox) to convey any wishes, or if you have a piece of example code that I can port to PHP to easy the suffering of writing the importer :)

Humort

There is such site very convenient for the translation.http://opennota.duckdns.org:9000/#/texts
I ask not to perceive as advertizing, but at this stage, it would be desirable to see something similar in this project, or on the contrary, to use the site for development of the translat
I speak Russian if you don't understand that I wrote, Google Translator is guilty of it

Sakuukuli

I just wanted to let everyone know I've updated my templates to alpha 10 after a long pause in case someone was waiting on it.