Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: totya on June 09, 2012, 06:45:49 am
-
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.
-
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.
-
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]
-
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 (http://www.hard-light.net/wiki/index.php/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 (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.
-
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.
-
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 (http://www.hard-light.net/wiki/index.php/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 (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 (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.
-
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.
-
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:
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...
-
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.
-
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:
java -jar tstrings.jar -h
then 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: java -jar tstrings.jar -mode create c:\Programok\NetOK\Jatek\Freespace2\
result:Exception in thread "main" java.lang.NoSuchMethodError: mm.tstring.ops.TStringsCreator.makeTString([Ljava/io/File;)V
at mm.tstring.Generator.main(Generator.java:36)
-
: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 (http://www.mediafire.com/?1e62zd6gd8x5ukc)
-
: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 (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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Just curious what is your language?
-
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.
-
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).
-
Instructor in Hungarian is oktató according to google translate "EXAMPLETRANSL" looks like a truncated "EXAMPLE TRANSLATION" But I could be wrong. it wouldn't be the first time. And probably not the last.
-
Instructor in Hungarian is oktató according to google translate "EXAMPLETRANSL" looks like a truncated "EXAMPLE TRANSLATION" But I could be wrong. it wouldn't be the first time. And probably not the last.
Hi!
Thank you, if you help learn my own language. :)
Okay, without joke, "EXAMPLETRANSL" only example word, I think eaiser than "oktató" for english peoples... :)
-
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).
Hi!
Okay, original idea is good, because without this, translation support is poor. But you wrote, this is not very easy, because HUD display name and message display is different two procedure. Well, I know write application (about 20 years ago, but not in C), I don't see this is big problem. I think needed modify all procedures, which writes to the display.
Example:
original:
//Write HUD info procdure //
WriteHUD (Shipname)
//Write Message procedure//
WriteMessage (Shipname+ "blew up")
new:
//GetDisplayShipName (function)
Get: Shipname
Return: ShipDisplayName
//Write HUD info procdure //
WriteHUD (GetDisplayShipName(Shipname))
//Write Message procedure//
WriteMessage (GetDisplayShipName(Shipname)+ "blew up")
-
No offense, but why do you think you're qualified to tell the people who know the FSO code what is simple and what isn't?
-
I assume we're having some fundamental miscommunication here. So let me make this clear.
The issue is not that the change you want to make is hard. It's that it's pointless.
1) While I can make the name change on the HUD pretty easily, I can't change it as easily in the log. So the instructor will appear as oktató on screen but would appear in the log as Instructor. So when the player looks at the log and sees "Instructor killed by x" they won't know who the instructor is cause now instead of him simply being referred to by a name in another language, he's now not referred to anywhere by that name except in the log.
Basically it just makes things much more complicated to understand than they used to be. And when you're asking for a translation change that actually makes things harder to understand, you're failing on a fundamental level.
2) Very few of the coders are interested in working on translation code simply because it's a waste of time. I have in the past expressed an interest in working on it and it's always proved pointless because no one is willing to translate the game anyway. Over the years, we've had offers to translate the game into
Russian (http://www.hard-light.net/forums/index.php?topic=74824.0)
Italian (http://www.hard-light.net/forums/index.php?topic=65949.msg1301102#msg1301102)
And a whole host of other languages. Yet still Freespace only supports English, German, French and Polish (The 4 languages it always has) because no one has ever finished what they started.
So my advice is, post a translated strings and tstrings.tbl and then start complaining about the small remaining things you can't translate.
-
Totya - it's not entirely clear to me that you know what "log" karajorma is talking about. I felt like bringing it up, cause if you guys talk about different things, of course there will be a miscommunication.
-
No offense, but why do you think you're qualified to tell the people who know the FSO code what is simple and what isn't?
Hi!
Many people say great differences.
(...) The issue is not that the change you want to make is hard. It's that it's pointless. (...)
Okay, shortly, you say this small quest implementation is hard. Thanks.
-
It's hard to implement it properly so that it isn't pointless.
My second point is actually important too. Unless you are complaining about the German, French or Polish versions of the game, I'd need to see a strings.tbl before I'd consider coding anything to do with this.
-
It's hard to implement it properly so that it isn't pointless.
My second point is actually important too. Unless you are complaining about the German, French or Polish versions of the game, I'd need to see a strings.tbl before I'd consider coding anything to do with this.
Hi!
Okay, my first thing before I open this topic, this modification is easy, similar to new "$Alt Name" function in ships/weapons.tbl
If this coding/implementation is hard, then forget it.
At the moment, I don't send for you this file, because this (language) mod copyright disabled this. I'm looking for this mod developers, but this mod is old, and developers email addresses is not available...
This mod is now unusable, contains many errors (because FSO2 language support is poor), need completely restructure (I can do this, and already working on this), this possible if FSO2 is supported what I want.
I see german version (change with registry key). Nothing surprise, I see no external language support. Example, Instructor ship name in German version is "Ausbilder". This next not found (alone) in tables directory. This is mean (similar to medals problem) this language support is built-in (in source code). And again: this word not found (alone) in strings.tbl or tstrings.tbl.
Thank you all, I think now this is the end for me, thanks for all information.