Editor output: using .po (gettext) files for handling translations

Started by kaputtnik, Tue 04/01/2011 18:45:32

Previous topic - Next topic

kaputtnik

Well, I have been doing some freelance translation work recently, and this is now the second time the client asked me if I was comfortable working with .po files. The last time I had simply opened the file with a text editor and replaced the former translation, but this time I got curious (I had seen .po files in Wordpress and Drupal projects before) and had a look at the format and its properties - and obviously, the GNU community has put a lot of effort into translation tools like poedit, gtranslator and pootle (and many more I haven't discovered, yet, I am sure).

I remember that the translation feature of AGS had some little irks, like only putting out one unique string for translation when the same sentence ("string") is used on different occasions and maybe in a different context, somewhat unsorted output and possibly missing text (I am not sure if this is still an issue, I remember one game where the GUI texts wouldn't get dumped into the translation file), and the slightly clumsy method of having to handle the speechref.txt file to be able to know who said what.

I know this is not really high priority, but I wanted to mention it and ask the people who know how the editor code looks like (now that it's freely accessible and I don't have to bother CJ with it, haha) if this is a good idea and possible at all:

Could AGS output .po files, or are there dependencies (gettext seems to be a rather huge framework, but I don't have the slightest idea) or technical issues that prohibit that? And it may make sense for websites and other purely text-based content, but is the format flexible enough and easy enough to handle to work with time-based (game) content?

The requests for a reformed translation system might be few, but I think CJ mentioned in some of the development threads that he was planning on rewriting a bit of it, so if this is done at some point in the future by one of the fantastic contributors who will appear from out of the depths of the internet pretty soon, using a GNU standard might be a good idea. Or not?
I, object.

krum110487

I am not sure how the plugins work within ags, but I could possibly develop an alternate output.

I program a bunch in C#, but I am not sure where to start looking for available classes, interfaces..etc

at worst I most defiantly could make a program to translate the current translation files into .po format, and back again. (not compiling, just from source to .po and back to source)

research time  ;D

kaputtnik

An editor plugin might really be the way to go, yeah. I wrote the post about your other project and have to agree with the concerns that have been uttered there: People shouldn't be able to modify the compiled translation easily, but the game author should be able to spread his text source in an easily accessible format if he wants to, and then probably release the translation as "official". I guess it works like that in most Open Source projects where one person retains creative control, and if there are major errors in the translation, sooner or later someone who speaks the language will get back to the author and tell him or suggest an alternative translation.

It would also be great to be able to sort the output by rooms, dialogs or characters - I think .po can do this quite easily. If you find a way to export these values from the editor, that would be awesome!

If it turns out to be too complicated and you decide to rather try and build a converter for the current format, maybe you could find a way to merge the translation file and the speechref.txt? This way every line could be identified as belonging to a certain character, and it is the basic way .po works anyway, as far as I understand.

I'm excited to see where you can take this!
I, object.

SMF spam blocked by CleanTalk