Jump to content

TRA and how to make it easier?


Domi

Recommended Posts

Good even, everyone. Basically, I have a wagonload of D-coded files, and I need to TRA'fy them. Now, I have not TRA'fied ever in my life, so I am looking for a simple solution. Below is JC's tutorial included in WeiDU Documentation, that leads me to believe that I need to fire up WeiDU and load in file after file, recording the last string number and then starting the next file with the next one etc. It sounds very cumbersome.

 

So, firends and modders, is that the latest in TRA' technology, or is there anywhere a smart program that converts the contents by the folder? Or can WeiDU do that on its own if I ask it to TRA the folder?

 

However, some WeiDU users, for reasons of convenience or simply never anticipating the opportunity to translate, may have originally chosen the "hard-coded" approach but now regret that decision. --traify will break out all the text in SAY, REPLY, and JOURNAL entries into translation-ready format. --traify may also be used on TP2 files.

 

To turn the hard-coded D file FWKI.d into a new D/TRA combo, use --traify and --out to specify the input and output filenames, respectively:

 

C:\Program Files\Black Isle\BGII - SoA\> weidu --traify fwki.d --out fwki-new.d

 

After a brief pause, fwki-new.d and fwki-new.tra will be created.

 

The --traify process turns fwki.d's

APPEND J#KLSYJ

  IF ~~ THEN BEGIN KelseySAHPR4

    SAY ~Urk. Who was the lucky donor?~

    IF ~~ THEN EXTERN SAHPR2 10

  END

END into fwki-new.d's

APPEND J#KLSYJ

  IF ~~ THEN BEGIN KelseySAHPR4

    SAY @0

    IF ~~ THEN EXTERN SAHPR2 10

  END

END and in the newly created fwki-new.tra, you will find

@0    = ~Urk. Who was the lucky donor?~and this dialogue file is now ready for translation.

 

--traify works from the top of the D down, starting at @0. It will NOT skip over any existing @x translation references it finds, so if your D contains any translation support at all, it is best to use --traify# as well.

 

Because standard --traify starts at @0 and is unaware of any any existing @x entries in the D, if you have begun to convert a D to a D/TRA pair by hand, you may have @x entries that clash with --traify's results.

 

In other words, if you already have a state that says

IF ~~ THEN BEGIN blah

  SAY @0

  IF ~~ THEN EXIT

END--traify will not skip @0 automatically, you will have two locations where @0 is used but you intended to use two different strings, and this will be bad.

 

To avoid this problem, add the --traify# argument to specify the starting number (rather than 0) for new @x entries.

 

C:\Program Files\Black Isle\BGII - SoA\> weidu --traify fwki.d --traify# 1000 --out fwki-1000.d

 

will create new @x references in fwki-1000.tra that begin at @1000, instead of @0. --traify# may also be used on TP2 files.

 

Finally, note that --traify works for BAF files as well.

Link to comment

First, do traifying in BGII directory. I have no idea why it doesn't work outside of BGII directory, but here you go.

 

That is, create a "tra" folder in your BGII directory and dump your .d files to BGII directory (NOT to "tra" folder), too.

 

Then:

- if you use Windows Commander, use this command:

weidu --traify BP#KIV.d --out tra

- if you do not use Windows Commander: run WeiDU 185 (I have no idea how BiggDU works, so I wouldn't risk it) in your BG II directory, then

--traify BP#KIV.d --out tra

 

Open "tra" folder in your BGII directory. If everything's OK, two files should be there: BP#KIV.d and BP#KIV.tra.

 

Repeat as needed.

 

(May I please have your .tra's for proofing later?)

Link to comment
run WeiDU 185 (I have no idea how BiggDU works, so I wouldn't risk it)

 

BiggDU is just a continuation of WeiDU except it's updated by thebigg. It works exactly the same.

 

Edit: Also, I'd be slightly quicker to make a batch file, which you could copy and paste 'weidu --traify filename.d --out tra' into, changing the name as necessery.

Link to comment

FOR %%1 IN (%INFOLDER%\*.D) DO WeiDU --traify %%1 --dout %%1 --out %OUTFOLDER%

 

Use this. Change %infolder% and %outfolder% to your desired file paths.

 

Edit: This is what I mean:

 

FOR %%1 IN (mymod\d\*.D) DO WeiDU --traify %%1 --dout %%1 --out mymod\tra

Link to comment
:) Cam mentioned something about Idobek having magical means of doing it an easier way. My only question is if it will keep the string numbering sequential between the files if it converts it as a batch?
Link to comment
:) Cam mentioned something about Idobek having magical means of doing it an easier way. My only question is if it will keep the string numbering sequential between the files if it converts it as a batch?

I don't think so. For each file to be traified WeiDU creates a matching tra file. So traifying foo1.d, foo2.d, and foo3.d would yield foo1.tra, foo2.tra, and foo3.tra, each one starting from @0. Don't worry about having to set USING clauses for these; since the file names match it's pretty straightforward to AUTO_TRA.

Link to comment

So, Cam, you are saying that as long as they remain in different files, it does not matter that the strings have the same numbers, it will figure it out?

 

I am going give it a try tonight (I actually need to add one more line) and see how it goes.

 

And, Kulyok, in the excitement, I all but missed your generous offer of proofread. Thank you, thank you, thank you!

Link to comment
So, Cam, you are saying that as long as they remain in different files, it does not matter that the strings have the same numbers, it will figure it out?

Yes. The order that WeiDU looks for tra references is as follows:

  1. If you use COMPILE ~foo.d~ USING ~bar.tra~, bar.tra is the first choice.
  2. If bar.tra does not exist or you did not specify a USING clause (i.e. COMPILE ~foo.d~) WeiDU will look for foo.tra inside your language folder if you've specified an AUTO_TRA directive
  3. If WeiDU still hasn't found string references, WeiDU will next look through the 'top-level' tra files designated in the LANGUAGE blocks, from the bottom up.

So, after traifying these files, drop the tra files into your language folder and then add an AUTO_TRA directive. This should only cause a problem if you have two .d or .baf files that are named the same.

 

edit: On second thought, I think WeiDU may simply die if you call COMPILE ~foo.d~ USING ~bar.tra~ and bar.tra doesn't exist. You shouldn't need to use USING anyway. :)

Link to comment

@Domi: Velkam. :)

 

@Cam: So, that means that I do not need a USING/AUTO_TRA directive at all in my .tp2, if I have LANGUAGE directive specified, if foo.tra corresponds to foo.d, and all files are in the specified directory?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...