Each time I try to traify new lines for my mods, I forget how it's done. Whether I need the game or not, what to do with line numbers, where the out file should go, whether the_bigg's triaify program traifies files one by one... well, all of it, rather. And it takes me about half an hour of searching(or, rather, trying again and again) to remember. So, without further ado, How It Works For Me:
You have a file, MyFile.d, and you have a .tra file for it, MyFile.tra. The last line of MyFile.tra is @2000.
First, backup both your files.
Second, no, you don't need to have BG2 installed anywhere, at least with Weidu v231.
Place weidu.exe to any directory, place MyFile.d into the same directory, make sure that your old MyFile.tra is NOWHERE near that directory, and run
weidu --traify MyFile.d --traify# 2001 --nogame --out MyFile.tra
This way you'll get 1) MyFile.d with @tra references; 2) MyFile.tra with NEW LINES ONLY AND NO LINE BREAKS.
You'll have to open your MyFile.tra via F3 in Total Commander, CTRL-A and CTRL-C all text, paste it in a Word document to add line breaks, then copy all the text again and then add it to the bottom of your old MyFile.tra.
Behold, you have MyFile.d and MyFile.tra.
(In English only, remember - you'll have to add new lines to your language MyFile.tra's, too, if someone's already translated it, or the mod won't install in that language).
And, of course, you absolutely DON'T want all your dialogue to remain commented in .d file in your distributed package, becase it's +1,5 mb of text extra for your players to download, and some of these players do not have good connection(and may live in a small Russian village where internet's only available once a month from a friend's computer, and only a limited number of megabytes. Hello, 21st century). If you need to read a commented traified .d file, leave a separate .d file on your hard drive/cloud storage/mailbox. There's "untraify", too.
P.S. If you don't need to add any new lines, but need a plain old traify for your v1 mod, it's
weidu --traify MyFile.d --nogame --out MyFile.tra
But it would still be wise to add line breaks later. It's a lot of saved time on editing(and you WILL need to edit it later, trust me).