Author Topic: translation support  (Read 6718 times)

0 Members and 1 Guest are viewing this topic.

Offline totya

  • 25
translation support
Hi!

I see FSO2 is under development, this is good news.

Well, my problem, translate support in FSO2 is very limited, not translator friendly, full translate this app (with weapons names, ships names, objects names) cause many-many errors, I see this in available translation (of my native language), terrible.

But I see very good, positive changes, example:

- "$Alt Name" in ships.tbl (translatable ships names, see on HUD) / FSO 3.6.13
- "$Alt Name" in weapons.tbl (translatable weapons names, see on HUD) / FSO 3.6.11

But missing these, example:

1. medals.tbl / $Name

If I want change medal name, I need modify actual mission file in this line: grant-medal "xxx Medallion"

Possible add "$Alt Name" (or any translation support) of medals.tbl file?

2. Mission files
Example, in first training mission, if I press T on instructor, left side on HUD I see this:

INSTRUCTOR (ship name)
GTF MYRMIDON (ship class)

OK, if I translate this, then INSTRUCTOR=EXAMPLETRANSL

But no way change the ship name.
- If I open mission in Fred, and I try change this ship name to other, I see new ship name on HUD, but script is not working correctly anymore.
- If I modify Alt Name (in Fred), then Alt Name is show on HUD, but this show in second line, see:

INSTRUCTOR (ship name)
EXAMPLETRANSL (alt name)

First problem, first (English) line is visible, but this is unnecessary, and ship type is lost in second line. OK, I can add ship type to translated string, but string length is very limited: 19 character, this is too short to write of translated string + ship type.

Possible add new filed type support in mission files (#Objects section), example "$Alt Display Name" ?

Example:
#Objects
$Name: Instructor
$Class: GTF Myrmidon
$Alt Display Name=EXAMPLETRANSL

Result on HUD:
EXAMPLETRANSL (translated name)
GTF MYRMIDON (ship class)

Thanks.

 

Offline FelixJim

  • 28
  • User 11092
Re: translation support
As far as I can imagine, finding and replacing "Instructor" with "EXAMPLETRANSL" throughout the entire mission file ought to do the trick- changing both the name and the reference in all the mission logic.  The only danger would come if the word being replaced ever referred to something outside the mission file, like a ship class, or as a part of the syntax (probably more likely and risky than it sounds, I dunno). I tried this with FS2s first training mission and during a play through nothing surprising happened.

This doesn't mean I don't like the idea of having on name for a craft for the engine to handle and another for the player to see - this would be useful for general FREDing, not just translating.
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline totya

  • 25
Re: translation support
As far as I can imagine, finding and replacing "Instructor" with "EXAMPLETRANSL" throughout the entire mission file ought to do the trick- changing both the name and the reference in all the mission logic.  The only danger would come if the word being replaced ever referred to something outside the mission file, like a ship class, or as a part of the syntax (probably more likely and risky than it sounds, I dunno). I tried this with FS2s first training mission and during a play through nothing surprising happened.

This doesn't mean I don't like the idea of having on name for a craft for the engine to handle and another for the player to see - this would be useful for general FREDing, not just translating.

Hi!

Simple "finding and replacing" method is the first, what I tired, but the result: script is not working correctly anymore.
My next probe modify ship name with Fred (I think this is much stable method than simple replace), but result is similar.

Script is not working correctly anymore, this is mean:
In first training, instructor is fly, and stopped, and say "press T on my fighter".
But if I modify script (method is simple replace, or in Fred modify ship name), the result, Instructor is fly again, and not stopped.
This is mean, script logic is damaged. Tested on 3.6.12 & 3.6.14 debug version.

Try this if you want, see attached files.

Thanks for answer!

[attachment deleted by a ninja]

 

Offline m!m

  • 211
Re: translation support
FSO uses a system where you can specify the translatable string using a special syntax (XSTR("<string>", <id>)) where the string is the original string and the ID a number which uniquely identifies it. You can then translate these strings using the tstrings.tbl table without the need to change the table files themselves if the tables are set up the right way.

The problem here is that most mods only specify an invalid ID (-1) as searching a unique index is quite time-intensive but there is a tool which can automagically generate a tstrings table with the correct indexes and update the existing XSTR entries. You can find it here: http://www.mediafire.com/?x7pu4qg3wccy4qz

After that you can duplicate the section in the table for the language you want to translate for and replace the contents with the appropriate translation, e.g. you can search and replace "INSTRUCTOR" with the appropriate translation (in your case "EXAMPLETRANSL") then the correct string will appear in the game.
A problem is that not all tables are fully translatable, for example medals.tbl (in the retail version) doesn't contain translatable names for the medals.

 

Offline FelixJim

  • 28
  • User 11092
Re: translation support
As far as I can imagine, finding and replacing "Instructor" with "EXAMPLETRANSL" throughout the entire mission file ought to do the trick- changing both the name and the reference in all the mission logic.  The only danger would come if the word being replaced ever referred to something outside the mission file, like a ship class, or as a part of the syntax (probably more likely and risky than it sounds, I dunno). I tried this with FS2s first training mission and during a play through nothing surprising happened.

This doesn't mean I don't like the idea of having on name for a craft for the engine to handle and another for the player to see - this would be useful for general FREDing, not just translating.

Hi!

Simple "finding and replacing" method is the first, what I tired, but the result: script is not working correctly anymore.
My next probe modify ship name with Fred (I think this is much stable method than simple replace), but result is similar.

Script is not working correctly anymore, this is mean:
In first training, instructor is fly, and stopped, and say "press T on my fighter".
But if I modify script (method is simple replace, or in Fred modify ship name), the result, Instructor is fly again, and not stopped.
This is mean, script logic is damaged. Tested on 3.6.12 & 3.6.14 debug version.

Try this if you want, see attached files.

Thanks for answer!

Oh, yeah, I see what you mean - I was just checking nothing was obviously broken, not comparing to the original like I should have been doing. I'll admit to be kinda stumped as to why the AI behavior is changing though - a couple of tests show that simply naming a craft "Instructor" causes the AI behavior to change, which makes me think it's something codeside.
EDIT: This only applies to Training missions, as far as I can see.

@m!m: I think the problem here is that things like ship names aren't currently set up as XSTR entries, presumably because they're names in the engine needs to use rather than just arbitrary strings.
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline totya

  • 25
Re: translation support
FSO uses a system where you can specify the translatable string using a special syntax (XSTR("<string>", <id>)) where the string is the original string and the ID a number which uniquely identifies it. You can then translate these strings using the tstrings.tbl table without the need to change the table files themselves if the tables are set up the right way.

The problem here is that most mods only specify an invalid ID (-1) as searching a unique index is quite time-intensive but there is a tool which can automagically generate a tstrings table with the correct indexes and update the existing XSTR entries. You can find it here: http://www.mediafire.com/?x7pu4qg3wccy4qz

After that you can duplicate the section in the table for the language you want to translate for and replace the contents with the appropriate translation, e.g. you can search and replace "INSTRUCTOR" with the appropriate translation (in your case "EXAMPLETRANSL") then the correct string will appear in the game.
A problem is that not all tables are fully translatable, for example medals.tbl (in the retail version) doesn't contain translatable names for the medals.

Hi!

Thanks for answer, but these information is not answer in my topic problem.

I know What is the XSTR, and I think no problem if mod use "-1" at the end of line, show this XSTR message without problem.

If correct index found in XSTR line, AND registry language settings is changed to other language (only supported language, see: http://www.hard-light.net/forums/index.php?topic=80979, AND new language is found in tstrings.tbl, example #German, then tstrings.tbl is used.

At the moment, for me no problem with XSTR sections. The problem, many words not found in XSTR lines, example: ship names (what I see on HUD, see my first post in this topic).

tstrings.exe :

Thank for this app, but I can extract all XSTR string from mission files with my app. (and I see original tstrings.tbl is bad, example 3403-3406)

But... please tell me, how can I use this tstrings.exe application? No readme.txt. -help -h -? /help /h /? don't works with tstrings.exe.

Thanks.

  

Offline totya

  • 25
Re: translation support
Oh, yeah, I see what you mean - I was just checking nothing was obviously broken, not comparing to the original like I should have been doing. I'll admit to be kinda stumped as to why the AI behavior is changing though - a couple of tests show that simply naming a craft "Instructor" causes the AI behavior to change, which makes me think it's something codeside.
EDIT: This only applies to Training missions, as far as I can see.

Hi!

Are you exactly sure, this replace problem only occurs with training missions?
But if problem appear with training missions, this is mean, Instructor (or other?) ship name in training missions is untranslatable.

I think, my recommended solution, see first message "$Alt Display/Ship Name" is better, 100% compatible, clean solution.
I don't think this additional programming implementation is hard.

Thanks.

 

Offline m!m

  • 211
Re: translation support
But... please tell me, how can I use this tstrings.exe application? No readme.txt. -help -h -? /help /h /? don't works with tstrings.exe.
The application will print a summary of the available commands when you use "--help", "-h" or "-?" as parameter. Here is the output for me:
Code: (tstrings --help) [Select]
Usage: tstrings [options]
  Options:
    -h, -help, -?   Prints this help message
                    Default: false
    -m, -mode       The mode in which this program will run. Defaults to
                    'create'.
'create' to create the tstring.tbl
'update' to update the tstring.tbl
                    Default: CREATE
    -nobackup       Forces the program to not backup files that are beeing
                    modified.
                    Default: false
    -r, -root       The directory from which this programm will search in
                    data/mission and data/tables
                    Default: C:\\.

But that won't be any useful as the ship names aren't translatable like FelixJim pointed out. That somehow defeats the purpose of tstrings for that...

 

Offline FelixJim

  • 28
  • User 11092
Re: translation support
Are you exactly sure, this replace problem only occurs with training missions?
But if problem appear with training missions, this is mean, Instructor (or other?) ship name in training missions is untranslatable.

The special-check sexp also needs to refer to specifically Freighter 1 at some point, so that would probably be another problem. But yeah, without doing what I ought to do and check the code (a waste of time anyway, when I barely know the first thing about coding) I'm going to guess that using the name "Instructor" on a craft within a training mission triggers special behaviour (this is what I've observed anyway - I'm sure someone will confirm\debunk this sooner or later.
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline totya

  • 25
Re: translation support
But... please tell me, how can I use this tstrings.exe application? No readme.txt. -help -h -? /help /h /? don't works with tstrings.exe.
The application will print a summary of the available commands when you use "--help", "-h" or "-?" as parameter. (...)

Hi!

tstrings.exe is not say anything, I wrote above, this is don't work (win7 x64).

If I run .jar file directly, example:
Code: [Select]
java -jar tstrings.jar -hthen this is working,  I see help.

Ok, then use this.
data\tables dir is empty.
data\missions dir contain all original english mission files.

command:
Code: [Select]
java -jar tstrings.jar -mode create c:\Programok\NetOK\Jatek\Freespace2\result:
Code: [Select]
Exception in thread "main" java.lang.NoSuchMethodError: mm.tstring.ops.TStringsCreator.makeTString([Ljava/io/File;)V
        at mm.tstring.Generator.main(Generator.java:36)

 

Offline m!m

  • 211
:doubt: It seems like the version that was uploaded there was both outdated and wrongly configured. Try this link instead: http://www.mediafire.com/?1e62zd6gd8x5ukc

 

Offline totya

  • 25
:doubt: It seems like the version that was uploaded there was both outdated and wrongly configured. Try this link instead: http://www.mediafire.com/?1e62zd6gd8x5ukc

Hi!

This version is working...

The problem here is that most mods only specify an invalid ID (-1) as searching a unique index is quite time-intensive

Time intensive? Why? If ID=-1, this is mean no external strings specified (no pont of tstrings.tbl index). And, I wrote above, tstring.tbl used only if language in registry (windows) different from English.

Thanks.

 

Offline totya

  • 25
Are you exactly sure, this replace problem only occurs with training missions?
But if problem appear with training missions, this is mean, Instructor (or other?) ship name in training missions is untranslatable.

The special-check sexp also needs to refer to specifically Freighter 1 at some point, so that would probably be another problem. But yeah, without doing what I ought to do and check the code (a waste of time anyway, when I barely know the first thing about coding) I'm going to guess that using the name "Instructor" on a craft within a training mission triggers special behaviour (this is what I've observed anyway - I'm sure someone will confirm\debunk this sooner or later.

Hi!

This is not only training mission files problem, find/replace translate is ugly and non error free method.

I can not do anything else than wait for a developers response, they can implement this simple new function(s) or not.

Thanks.

 

Offline m!m

  • 211
Time intensive? Why? If ID=-1, this is mean no external strings specified (no pont of tstrings.tbl index). And, I wrote above, tstring.tbl used only if language in registry (windows) different from English.
I meant that constructing a tstrings table by hand is very time intensive and error prone which is why I wrote that little utility to make it easier to generate that file.

 

Offline Tomo

  • 28
I can not do anything else than wait for a developers response, they can implement this simple new function(s) or not.
One thing to remember is that this is not simple.

Localisation is a very hard problem, and FreeSpace2's original method was rather poor and hasn't been updated much since.

FreeSpace 2 also uses the names of things extensively, thus translations of ship names is a very dangerous change with the potential to break everything in a mission or campaign.

It is however a very worthwhile task.

 

Offline totya

  • 25
I can not do anything else than wait for a developers response, they can implement this simple new function(s) or not.
One thing to remember is that this is not simple.

Localisation is a very hard problem, and FreeSpace2's original method was rather poor and hasn't been updated much since.

FreeSpace 2 also uses the names of things extensively, thus translations of ship names is a very dangerous change with the potential to break everything in a mission or campaign.

It is however a very worthwhile task.

Hi!

I see change ship names is problematic, this is the reason why I wrote this idea.

My suggestion is change display name only, all inside logic is remain untouched. See examples from my first post, new "$Alt Name" function in "ships.tbl" and "weapons.tbl".

Thanks.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Won't work.

Basically the log ****s with the idea. Every single mention of the ship in the log must use the untranslated name or you start breaking SEXPs. There are ways around that but they're a big enough pain in the arse that no one has been willing to code them.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Just curious what is your language?

 

Offline totya

  • 25
Won't work.

Basically the log ****s with the idea. Every single mention of the ship in the log must use the untranslated name or you start breaking SEXPs. There are ways around that but they're a big enough pain in the arse that no one has been willing to code them.

Hi!

I'm sure, you (and others) don't understand what I wrote in first message in this topic.

Just curious what is your language?

My language? See my location in my profile.

« Last Edit: June 12, 2012, 08:55:54 pm by totya »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I think you're missing my point. While the name on the hud will be translated, the name in the log can not be translated. Which means when the game tells you ship X blew up players in a translated game will have no idea who ship X was.

So basically you're exchanging a small issue (Names can not be translated) for a bigger one (The log is now useless).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]