Page 1 of 1

Vega Strike Translation Tool

Posted: Thu Oct 16, 2008 6:03 pm
by dergringo
Hello everybody

I'm new to this community and have offered to translate Vega Strike into German.
While disucussing this (see here) I was made clear that you have to edit some source files to change the language. That led to the idea of creating a translation tool (let's call it Babel Strike / BS for now) that is able to change Vega Strike into the language of your choice.
Planned features on first release:
  • Written in Python
  • Run on any platform on which VS runs
  • Definition files that contain the information where and which strings are rpelaced
  • Language files that contain the strings which will replace the original ones
  • Quick and dirty user interface
  • Free like in Freedom (propapbly GPL)
If you have any suggestions or may like to help let me know. Let's get this great open source game translated together!

Re: Vega Strike Translation Tool

Posted: Mon Oct 20, 2008 2:04 am
by chuck_starchaser
Sounds very ambitious. Is it even possible? Translation software is usually pretty lame;
at least when it comes to Spanish, automated translations are usually disastrous.

Re: Vega Strike Translation Tool

Posted: Mon Oct 20, 2008 6:31 pm
by dergringo
Sorry if I mispresented the tool.
The idea behind it is to work with user created language files.
It does not make use of automated translation services.

Just have a package with several languages included and the user can then translate vs into one of those languages and back to english.

Re: Vega Strike Translation Tool

Posted: Mon Oct 20, 2008 11:23 pm
by ace123
Sounds like a great idea.
The main difficulty that people have had in the past is how to replace all strings in the code. And also how to separate out the important strings from the unimportant ones.
In python for example you may need to add a wrapper function like _("something") around each translatable string (ones that get displayed to the user).

Re: Vega Strike Translation Tool

Posted: Tue Oct 21, 2008 12:05 am
by charlieg
Don't forget that this is a very common problem and there are several established ways to integrate translations into a game. Don't reinvent the wheel.

Re: Vega Strike Translation Tool

Posted: Tue Oct 21, 2008 12:35 am
by loki1950
Been thought of but all the methods available would need a major reorganization of the engine code and all the python scripts data side so the verdict was just too much work for minimal gain.

Enjoy the Choice :)

Re: Vega Strike Translation Tool

Posted: Tue Oct 21, 2008 12:29 pm
by dergringo
ace123 wrote:Sounds like a great idea.
The main difficulty that people have had in the past is how to replace all strings in the code. And also how to separate out the important strings from the unimportant ones.
In python for example you may need to add a wrapper function like _("something") around each translatable string (ones that get displayed to the user).
Thanks for the tip. Well this is why I've implemented definition files (done only for 0.5 yet) that contain the information where to replace the strings (file and string/line number) so no changes are required by the vs devs. Just include a new definition file while the language files have a version compatibility var. So you have a language file for each language and for each version. So far the plan.

f.e.

french_0-5-0
french_0-6-0
german_0-5-0
german_0-6-0


This does not include mods but could be easy extended to work with em.

I hope to get a 0.1 release ready next week.

Re: Vega Strike Translation Tool

Posted: Tue Oct 21, 2008 3:37 pm
by chuck_starchaser
If it includes mods, we could use it for PU. I could make a Spanish translation in no time.

Re: Vega Strike Translation Tool

Posted: Fri Oct 24, 2008 9:25 am
by ace123
File and string number sounds dangerous.

What if we edit one of the python files and add a string to the top like even a debug statement, or even drastically change this?

I don't want your work to go to waste because the line numbers changed and suddenly when 0.5.1 is released, everything is incompatible.

Re: Vega Strike Translation Tool

Posted: Fri Oct 24, 2008 2:38 pm
by dergringo
ace123 wrote:File and string number sounds dangerous.

What if we edit one of the python files and add a string to the top like even a debug statement, or even drastically change this?

I don't want your work to go to waste because the line numbers changed and suddenly when 0.5.1 is released, everything is incompatible.
Good point! I added the abilitiy to use pattern files. Here you can see an example of vegastrike_0-5-0.py

Code: Select all

pattern = {
   "bases/bartender.py": [
        {"id":"babar0","ln": 5, "re": "\"\""},
        {"id":"babar1","ln": 6, "re": "\"\""}
    ]
}
Where id is the string used in the language file. ln is the line number and re the regex pattern.

And the example in the language file vegastrike_0-5-0_english.ini

Code: Select all

[description]
# The English language string
language: english

# The same string translated
language2: english

# Make sure a pattern file for the following mod/version combinition  is given

# If this file is for a specific mod then add the string here. If it's for Vega Strike leave it empty or write 'vegastrike' NOT IMPLEMENTED YET!
# mod: vegastrike

# The version which can be translated using this file
version: 0.5.0

[translation]
# The ids have to match the ones in the pattern file.

# bases/bartender.py
babar0: Hey, pal. What'll it be?
babar1: Bottoms up for ye olde bartender, eh?
This combination of pattern and language files makes it easy to modify the app for mods and newer versions. It also adds the ability to translate older versions (in a special case where this may be required).

I have an open ear for any better solution. This is just my idea to keep it as flexible as possible. Please let me hear your suggestions!

Re: Vega Strike Translation Tool

Posted: Mon Oct 27, 2008 10:00 am
by ace123
I am still a bit confused about this:
{"id":"babar0","ln": 5, "re": "\"\""},
I was expecting something more along the lines of traditional translation systems where it's just {"string": "translated string", ...} and every time it sees "string" it replaces it with "translated string".

Maybe it is worthwhile also including the original string as one of the fields in your pattern file. Redundant information is better than too little information as far as I'm concerned (probably even worth the expense of possibly another megabyte of extra data).
Even if you don't use the original string now, this field can do some error checking to ensure that you don't replace the wrong string (and print out a message if they do not match). In addition, in the future if the translation system is to be updated/changed then it will be easy to do without having to look at the diff between versions and have a complicated parser.

Re: Vega Strike Translation Tool

Posted: Fri Feb 06, 2009 6:15 am
by MC707
sorry I come a little late, but is this translation tool done...? (yes I know it is highly unlikely)

Re: Vega Strike Translation Tool

Posted: Wed Jan 08, 2014 11:13 pm
by Obu
And I'm coming even later...

As I seen no news on this topic from now 4 years, I guess it is off, right ?

I'm currently trying to translate for french players and this project presented here just sounds very nicely ! The incursions I made in the files and folders made me afraid as I fell alone on this translation... and when I see all the files and the way the text to modify is spread through out so big and numerous txt, dat, py and other stuff, I hope not to give up to fastly :lol:

Here is the discussion for french translation I found and I follow for this : http://forums.vega-strike.org/viewtopic ... 57#p134257. So if there is any news here, I'll be happy to hear about :)

Re: Vega Strike Translation Tool

Posted: Sat Jan 18, 2014 7:22 am
by TBeholder
What's wrong with gettext? It's pretty much standard. All the framework is there long ago, including Python libraries.

Re: Vega Strike Translation Tool

Posted: Tue Feb 04, 2014 5:58 am
by klauss
TBeholder wrote:What's wrong with gettext? It's pretty much standard. All the framework is there long ago, including Python libraries.
We just don't use it. It *would* need some love getting it to work consistently across all the data files we've got, but it might be worthwhile. Just need some patches ;)

Re: Vega Strike Translation Tool

Posted: Mon Jul 07, 2014 9:57 pm
by Hekaton
Greetings!

The spring has gone and we are sweating (at least here in europe) and so it´s later again. ;-)
Is there anyone who has some experience with gettext, some pros, some contras?
I think it would be realy good if there was VS at least in spanish, french and german (and of course maybe some new records of voices, the accent of "In death alone is there room for your kind" sounds unwillingly funny, but that´s rather a task for the native speakers, isn´t it?
If there´s need for some accent(s) though I could "decorate" the german version with any kind of austrian dialect. ;-)
Unfortunately I don´t know much programming at all so I could only translate texts, not code.
So, anybody outthere needing help with translating into german?

So far, CU!

Re: Vega Strike Translation Tool

Posted: Wed Jul 16, 2014 9:28 pm
by greendreamer
Hello Hekaton,

In the french forum, we have begun internationalization with gettext :
http://forums.vega-strike.org/viewtopic ... 50#p136341
You can see our way of doing on the wiki :
http://wiki.vega-strike.org/Development:Translations
and the results on Costalfy's github repository :
https://github.com/costalfy/Vega-Strike

We (ezee, VsObu, costalfy and I) have begun to add gettext tags around all in-game texts in the code (on the github version). Costalfy has extracted it in a .po file, and we are translating all these texts in french with poedit.
I think you could ask for an access to the Github to Costalfy, and then begin a german translation (we have now 1392 strings to translate from english to other langages). We could help you implement the new translation if you need.

Currently, our main problem is to add internalization in the C++ code.
ezee had found how to add and manage it in the game, but his post is (I hope temporarily) lost probably because of an encoding problem, as a lot of french ones.
We have not worked on this project for about one month, but I'll see if we could reactivate it.

See you soon.
Greendreamer

Re: Vega Strike Translation Tool

Posted: Fri Oct 10, 2014 6:20 pm
by greendreamer
Hi all,
The Vega Strike internationalization project is almost stopped, now.
ezee and Costalfly seem to be gone elsewhere. We will continue translations with Obu, but neither he nor I are C++ developers.
And we need one to create a language menu in the homepage, and test what we've already done.
If someone with C++ skills, time and enthusiasm passes here, it will be a great pleasure to work with him/her.
For now, I'll continue to traduce the .po file, and begin to include the code at the beginning of Python and C++ modules, to call gettext in these files (it should be in my reach. ;-P ).

Hekaton, if you (or another German player) passe here one day soon, I've created a german .po file in the github repository.
https://github.com/costalfy/Vega-Strike
You only have to
- download and install poedit,
- open the .po file (in /data/i18n/de/LC_MESSAGES/),
- select an english text and...
- translate it at the bottom of the screen.
(and save, and push your modifications on the online repositoriy, of course! ;-) ).

See you soon!
Greendreamer

Re: Vega Strike Translation Tool

Posted: Fri Oct 10, 2014 11:07 pm
by Obu
Hi Green (and the others !)

thanks for these informations, as you noticed I'm not present at the moment to help on this project... but I'm always ok to participate, just need to find some time for myself.

I'll have to have a look in the progress you made in the translation, it makes some time now...

Bests ;)

OBu

Re: Vega Strike Translation Tool

Posted: Tue Oct 14, 2014 11:41 am
by greendreamer
Hi Obu,

It's cool that you're still motivated. :D
You can work on the translation when you have the opportunity. There's no need to hurry.
I'll see what I can do with python files to include gettext.
When you're ready, don't hesitate to ask for help if needed.

All the best.
Greendreamer