Ludeon Forums

Ludeon Forums

  • June 27, 2019, 04:28:42 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Working on a RimWorld translation tool.. need feedback  (Read 5330 times)

cappie

  • Muffalo
  • *
  • Posts: 14
  • Colonial Dictator
    • View Profile
Working on a RimWorld translation tool.. need feedback
« on: October 12, 2014, 01:46:13 PM »

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 :)
« Last Edit: March 19, 2015, 05:09:50 AM by cappie »
Logged

Pirx Danford

  • Drifter
  • **
  • Posts: 85
  • Refugee
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #1 on: October 12, 2014, 03:10:48 PM »

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 :-)
« Last Edit: October 12, 2014, 03:13:38 PM by Pirx Danford »
Logged

cappie

  • Muffalo
  • *
  • Posts: 14
  • Colonial Dictator
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #2 on: October 12, 2014, 03:34:33 PM »

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.. :)

Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 11528
    • View Profile
    • Tynan's Blog
Re: Working on a RimWorld translation tool.. need feedback
« Reply #3 on: December 10, 2014, 05:54:14 PM »

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.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Sakuukuli

  • Muffalo
  • *
  • Posts: 7
  • Translations contributor
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #4 on: December 11, 2014, 10:49:18 AM »

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
Logged

AlyxMS

  • Super Translator
  • Drifter
  • ***
  • Posts: 73
  • Debris Collector
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #5 on: December 15, 2014, 02:29:12 PM »

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.
Logged

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2088
  • Shadow
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #6 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 :)
Logged

AlyxMS

  • Super Translator
  • Drifter
  • ***
  • Posts: 73
  • Debris Collector
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #7 on: December 16, 2014, 03:01:54 AM »

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.
Logged

Nemh

  • Drifter
  • **
  • Posts: 24
  • Refugee
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #8 on: January 03, 2015, 05:04:19 PM »

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 :

Code: [Select]
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 :
Code: [Select]
~/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).
« Last Edit: January 03, 2015, 05:18:12 PM by Nemh »
Logged

Gaesatae

  • Super Tester
  • Colonist
  • ***
  • Posts: 213
  • Refugee
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #9 on: January 25, 2015, 07:39:23 PM »

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

  • Muffalo
  • *
  • Posts: 14
  • Colonial Dictator
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #10 on: March 19, 2015, 05:04:14 AM »

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
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 11528
    • View Profile
    • Tynan's Blog
Re: Working on a RimWorld translation tool.. need feedback
« Reply #11 on: March 19, 2015, 02:42:52 PM »

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

cappie

  • Muffalo
  • *
  • Posts: 14
  • Colonial Dictator
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #12 on: April 17, 2015, 04:14:06 AM »

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 :)
Logged

Humort

  • Drifter
  • **
  • Posts: 92
  • keelah se'lai
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #13 on: April 23, 2015, 03:14:24 AM »

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
Logged
I speak Russian if you don't understand that I wrote, Google Translator is guilty of it

Sakuukuli

  • Muffalo
  • *
  • Posts: 7
  • Translations contributor
    • View Profile
Re: Working on a RimWorld translation tool.. need feedback
« Reply #14 on: June 04, 2015, 12:55:21 PM »

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.
Logged
Pages: [1] 2