.trs file question...

Started by miguel, Thu 05/01/2012 11:10:19

Previous topic - Next topic

miguel

Hi there,

I've had some problems when updating a translation file into a game,
is this the right way to do it?

-change the new .trs file for the old one;
-'Update All' where it says Translations on the Editor;
-Compile the new translation file;
-Make new exe (in my case because the game is finished);

Thanks
Working on a RON game!!!!!

Khris

If all you did was update translated lines, you can skip steps 2 and 4, afaik.
"Update" will add changed/newly added game strings to the bottom of the translation source, and compiling the game shouldn't be necessary if all you changed is the translation file (since the game source didn't change).

miguel

Thanks Khris but I can't do it right, looking at the .trs file I can see that it has repeated lines, some "spell-corrected" and some in their original form. I followed your example but it still doesn't work.

Is there a way to erase the original lines completely so that it doesn't get repeated? Somehow the editor ignores the new .trs file...
Working on a RON game!!!!!

Khris

I don't think there is.

What exactly IS the problem? Are you unable to update the .tra file?

miguel

I can't seem to do it, no.
Somehow the editor is not updating the new .trs...
Working on a RON game!!!!!

miguel

Sorry to double post here!

Did anybody had the same issue with translation files?
Working on a RON game!!!!!

Khris

So you update the source, put the translated lines into the empty ones below the original text, save it, recompile the source but the translation doesn't show up in the game?

miguel

I didn't explain my problem well,

the .trs file being changed is for proof-reading matters.

I've tried to do in some different ways but it somehow doesn't get all text modified...
Working on a RON game!!!!!

arj0n

Quote from: miguel on Mon 09/01/2012 13:38:50
the .trs file being changed is for proof-reading matters.
Being changed as in only changing the original lines (not using the empty lines) or changed as in only using (filling) (some of) the empty lines?

miguel

Being changed as in only changing the original lines...

First time I did it, the Editor "asked" me to include actual translations lines and I added just 3 letters on the first empty line...
Working on a RON game!!!!!

Khris

That's the problem right there, you aren't supposed to edit the original lines. (It doesn't break the game but as you noticed, it doesn't have any effect.)

You can "abuse" the translation feature by putting corrected lines below the original ones; if that "translation" is selected in winsetup, the game will use the corrected line whenever it finds one, just like if it were an actual translation.

But in order to correct the original lines, you have to edit the game's source within AGS.

miguel

Okay, I got it now. Dumb Miguel!

That means that I actually have to manually copy/paste lines, right?

Thanks for the help guys.
Working on a RON game!!!!!

miguel

Sorry for double posting but now that I've managed to get the translated file working it seems that my gui for reading the screen hotspots doesn't work!

It's a simple gui with a label '@OVERHOTSPOT@' like I've always used before...

All lines containing Hotspot1,2,3... have been duplicated. Is that what's causing the error?
Working on a RON game!!!!!

Khris

What error exactly...? What doesn't work?

Does the label actually read "@OVERHOTSPOT@" in-game?

Did you remove duplicate lines from the translation source?

miguel

Sorry I said 'error', the game doesn't crash but
   the label reads a static name (reading the file I found it's the first name right under @OVERHOTSPOT@), I've inserted a blank line and the label reads the screen correctly up to a point.

It seems that character names got changed and inventory item names also.

I did remove duplicate lines as I was trying to fix the static label, but  because it didn't work I am using a file with everything duplicated now.
Working on a RON game!!!!!

Khris

It's really important that you don't mess around in the translation file. You can't remove or insert lines at any point without screwing up everything.

Create a fresh translation source (create a new translation in the project tree), open it and the current translation file next to each other and go through them line by line. That's the only thing you can do short of copy-pasting every translated line in a newly created source.

Khris

Got the file and looked at it.

I have no way of telling what's wrong with it.

First of all, if a line doesn't need to be translated, you can leave the line below blank. I don't even want to think about sitting there and pointlessly duplicating all those lines by hand for no reason at all. (And this is stated right at the top of the translation source.)

I guess at this point it's best if I explained how AGS handles translations internally. When a game is started with a translation selected, AGS loads the entire contents in a buffer.

Suppose the translation file looked like this:
1: Some text
2: Irgendein Text
3: Some more text
4: Noch mehr Text
5: Hallo!
6: 
7: How are you?
8: Wie geht's dir?

So now the game is run, and AGS encounters this line: Display("How are you?");. AGS will now search the translation for the string "How are you?", looking only at lines 1, 3, 5, 7, etc.
An exact(!) match is found in line 7, and line 8 isn't empty, so AGS displays line 8 instead.

In other words, if you change the original lines, AGS can no longer match the game source text to the translation file's original lines.

That's why right at the top of the translation, it says this:
Code: ags
// ** REMEMBER, WRITE YOUR TRANSLATION IN THE EMPTY LINES, DO
// ** NOT CHANGE THE EXISTING TEXT.


It also seems like somebody removed all the comment lines further down. That didn't break anything but I don't really get why one would do that.

Long story short, since this is just to fix spelling errors: either fix them in the game source or create a fresh translation source and put the errors back in the original lines.

miguel

Right, thanks for all the troubles Khris,

I still can't get it to work, the file I sent you has the exact command lines than a new one, I don't understand when you say somebody changed it.

I even have the game running fine now, but it doesn't run the new translation after setting it up in the setup...

I'll manage something.
Working on a RON game!!!!!

Khris

It looks like AGS no longer puts comment blocks further down in the file like it used to.

So you created a new translation source, put corrected lines in the blank spaces but they don't show up in the game when you select that new translation?

miguel

Yup, that's it.

I'm supposed to compile the new translation file, nothing else?
Working on a RON game!!!!!

SMF spam blocked by CleanTalk