DEFINE_ACTION_MACRO bgee_language BEGIN
ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
LOAD_TRA ~rr/tra/bgee/english/game.tra~
LOAD_TRA ~rr/tra/bgee/%LANGUAGE%/game.tra~
END
END
ALWAYS
ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
OUTER_SPRINT tra_path ~mymod/tra/bgee~
END ELSE BEGIN
OUTER_SPRINT tra_path ~mymod/tra~
END
END
// elsewhere
COMPILE ~mymod/foo.d~ USING ~%tra_path%/%LANGUAGE%/foo.tra~
LOAD_TRA ~%tra_path%/%LANGUAGE%/bar.tra~
The saving grace here is that %tra_path% is not something you will have to undo if and when a proper solution materialises.ALWAYS
ACTION_IF GAME_IS ~bg2ee~ BEGIN
OUTER_SPRINT tra_version ~c-aranw_cp1252~
END ELSE BEGIN
OUTER_SPRINT tra_version ~c-aranw_utf8nb~
END
END
LANGUAGE ~English_BG2EE~ ~English~ ~aranw\tra\english\c-aranw_utf8nb.tra~
LANGUAGE ~English_BG2~ ~English~ ~aranw\tra\english\c-aranw_cp1252.tra~
results in a working .tp2ALWAYS
ACTION_IF GAME_IS ~bg2ee~ BEGIN
OUTER_SPRINT tra_version ~c-aranw_cp1252~
END ELSE BEGIN
OUTER_SPRINT tra_version ~c-aranw_utf8nb~
END
LOAD_TRA ~aranw\tra\english\%tra_version%.tra~
END
LANGUAGE ~English~ ~English~ ~aranw\tra\english\%tra_version%.tra~
WeiDU v 23500 Log
C:\Program Files (x86)\BeamDog\Games\00546\setup-aranw.exe
[./chitin.key] loaded, 843510 bytes
[./chitin.key] 185 BIFFs, 59857 resources
[.\weidu.conf] loaded, 17 bytes
[lang\en_us/dialog.tlk] loaded, 13189457 bytes
[lang\en_us/dialog.tlk] 114144 string entries
Using Language [English]
[English] has 1 top-level TRA files
Using lang\en_us/dialog.tlk
Would you like to display the readme? [Y]es [N]o
ERROR: No translation provided for @1
Continuing despite error.
Install Component [UNDEFINED STRING: @1]?
[I]nstall, or [N]ot Install or [Q]uit? ERROR: No translation provided for @157
Continuing despite error.
ERROR: No translation provided for @160
Continuing despite error.
ERROR: No translation provided for @161
Continuing despite error.
ERROR: No translation provided for @162
Continuing despite error.
ERROR: No translation provided for @164
Continuing despite error.
ERROR: No translation provided for @167
Continuing despite error.
ERROR: No translation provided for @168
Continuing despite error.
ERROR: No translation provided for @169
Continuing despite error.
ERROR: No translation provided for @170
Continuing despite error.
ERROR: No translation provided for @171
Continuing despite error.
Saving This Log:
WeiDU Timings
load TLK 0.000
parsing .log files 0.000
unmarshal KEY 0.016
loading files 0.016
Parsing TP2 files 0.016
stuff not covered elsewhere 0.031
unmarshal TLK 0.078
TOTAL 0.156
Still struggling with thisLANGUAGE is evaluated before ALWAYS, so you can't put variables in there like that. If you are not using AUTO_TRA, I would suggest you use something similar to bgee_language (invoked in your ALWAYS block; overrides the relevant tra files loaded by LANGUAGE) and %tra_path% (set in your ALWAYS block; used to softcode your tra files in USING and LOAD_TRA).
ALWAYS
ACTION_IF GAME_IS ~bg2ee~ BEGIN
OUTER_SPRINT tra_version ~c-aranw_utf8nb~
LOAD_TRA ~aranw\tra\english\c-aranw_utf8nb.tra~
LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_utf8nb.tra~
END ELSE BEGIN
OUTER_SPRINT tra_version ~c-aranw_cp1252~
LOAD_TRA ~aranw\tra\english\c-aranw_cp1252.tra~
LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_cp1252.tra~
END
END
LANGUAGE ~English~ ~English~ ~aranw\tra\english\c-aranw_cp1252.tra~
ALWAYS
ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
LOAD_TRA ~C#Ajantis_SvA\Tra\utf8\english\Setup-C#Ajantis_SvA.tra~
LOAD_TRA ~C#Ajantis_SvA\Tra\utf8\%LANGUAGE%\Setup-C#Ajantis_SvA.tra~
COPY ~C#Ajantis_SvA\Tra\utf8\%LANGUAGE%~ ~C#Ajantis_SvA\Tra\%LANGUAGE%~
END ELSE BEGIN
LOAD_TRA ~C#Ajantis_SvA\Tra\bgii\english\Setup-C#Ajantis_SvA.tra~
LOAD_TRA ~C#Ajantis_SvA\Tra\bgii\%LANGUAGE%\Setup-C#Ajantis_SvA.tra~
END
END
ALWAYS
ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
COPY ~C#Ajantis_SvA\Tra\utf8\%LANGUAGE%~ ~C#Ajantis_SvA\Tra\%LANGUAGE%~
END ELSE BEGIN
COPY ~C#Ajantis_SvA\Tra\bgii\%LANGUAGE%~ ~C#Ajantis_SvA\Tra\%LANGUAGE%~
END
END
AUTO_TRA ~edwin/tra/%s~ // Your normal AUTO_TRA declaration (not that we have a choice)
ALWAYS
ACTION_IF GAME_IS ~bg2ee~ BEGIN
OUTER_SPRINT tra_path ~%MOD_FOLDER%/tra/bgee~
END ELSE BEGIN
OUTER_SPRINT tra_path ~%MOD_FOLDER%/tra~
END
/*
* Loads UTF8-encoded tra files to replace those loaded by LANGUAGE
*/
DEFINE_ACTION_MACRO bgee_language BEGIN
ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
LOAD_TRA ~%MOD_FOLDER%/tra/bgee/english/game.tra~
LOAD_TRA ~%MOD_FOLDER%/tra/bgee/%LANGUAGE%/game.tra~
END
END
/*
* Copies UTF8-encoded tra files over the normal ones, for use with AUTO_TRA
*/
DEFINE_ACTION_FUNCTION autotra_workaround BEGIN
COPY ~%MOD_FOLDER%/tra/bgee/%LANGUAGE%~ ~%MOD_FOLDER%/tra/%LANGUAGE%~
END
LAM bgee_language
LAF autotra_workaround END
END
/*
* In LANGUAGE, tra files have been split into different files depending on what they are used for
* Strings that are displayed in the game need to follow the game's encoding
* Strings that are displayed during the installation (component names, etc.) need to follow the OS's encoding
* Additionally, since different OSs use different encodings, there is need for one file per OS
* Accordingly:
* game.tra: encoded in whatever charset is used by the target game, UTF8 and "normal" copies are needed
* setup-win32.tra: encoded in whatever local charset is used by Windows for the relevant language
* setup-osx.tra: encoded in UTF8
* setup-unix.tra: encoded in UTF8
* This is obviously as optional as you want to make it, and multiple setup-*.tra files can be safely omitted
* for languages or translations that don't need special encodings (typically English, for example)
*/
LANGUAGE ~American English~
~english~
~edwin/tra/english/game.tra~ // Holds text displayed in the game
~edwin/tra/english/setup.tra~ // Holds text displayed during the installation
LANGUAGE ~Francaise~
~french~
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/french/game.tra~
~edwin/tra/french/setup-%WEIDU_OS%.tra~
LANGUAGE ~Espanol~
~spanish~
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/spanish/game.tra~
~edwin/tra/spanish/setup-%WEIDU_OS%.tra~
LANGUAGE ~Russian~
~russian~
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/russian/game.tra~
~edwin/tra/russian/setup-%WEIDU_OS%.tra~
LANGUAGE ~Deutsch~
~german~
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/german/game.tra~
~edwin/tra/german/setup-%WEIDU_OS%.tra~
LANGUAGE Polish
polish
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/polish/game.tra~
~edwin/tra/polish/setup-%WEIDU_OS%.tra~
LANGUAGE ~Simplified Chinese~
schinese
~edwin/tra/english/game.tra~
~edwin/tra/english/setup.tra~
~edwin/tra/schinese/game.tra~
~edwin/tra/schinese/setup-%WEIDU_OS%.tra~
// further down
//Dialogues (compiled with AUTO_TRA)
COMPILE
~edwin/dlg/eredwinp.d~
~edwin/dlg/eredwinj.d~
~edwin/dlg/ervicon.d~
~edwin/dlg/ermazzy.d~
~edwin/dlg/eranomen.d~
~edwin/dlg/erelvira.d~
~edwin/dlg/erlovetalk2.d~
~edwin/dlg/erterl02.d~
~edwin/dlg/eredwina2.d~
~edwin/dlg/eredwina.d~
~edwin/dlg/erlovetalk.d~
~edwin/dlg/erimoen.d~
// yet further down
// Compiled with USING; %tra_path% is redundant in this case, but I'm including it as a demonstration
COMPILE ~edwin/dlg/erlovetalk25.d~ USING
~%tra_path%/english/erlovetalk25.tra~
~%tra_path%/%LANGUAGE%/erlovetalk25.tra~
In your example, what happens upon uninstall from a BGII:EE game? Will the former encoded tra files be in the LANGUAGE folder again?Yes, the "normal" TRA files will be restored upon uninstallation.
Question to game.tra: Is this a standard like setup.tra? Because in my case, setup.tra also contains text that will show in the game (item descriptions, etc.). Is this externalized in game.tra for the current WeiDU? I totally missed this."setup.tra" is just a convention. You can use LANGUAGE to load whatever TRA files you wish, they just can't overlap, or they'll shadow one another. In this case, you split your TRA file into two parts, encode them separately and load them at the same time (in LANGUAGE). The end result is identical to if you had had a single TRA file, except that you can use different encodings. Your new "game.tra" contains the text for creature names, item descriptions etc., and "setup.tra" is left with component names and such.
ACTION_IF FILE_EXISTS_IN_GAME ~neera.dlg~ THEN BEGIN
/*Tell the player it is using BG:EE stuff */
PRINT @5000
INCLUDE ~bg1npc\lib\liam_bgee_vars.tpa~
OUTER_SPRINT ~bgee~ ~bgee/~
// BG:EE tra conversion
// Character encoding for BG II for various languages: ensure the name matches the menu choices
ACTION_DEFINE_ASSOCIATIVE_ARRAY languageencoding BEGIN
"french" => "CP1252"
"spanish" => "CP1252"
END
OUTER_SPRINT initialencoding ~~
ACTION_PHP_EACH languageencoding AS lang => encoding BEGIN
ACTION_IF ("%LANGUAGE%" STRING_EQUAL_CASE ~%lang%~ = 0) THEN BEGIN
OUTER_SPRINT initialencoding ~%encoding%~
END
END
// Isaya: check for existence of BG1NPC/TRA/%LANGUAGE%/BG1NPC.tra as a marker that the mod
// has already installed at least one component, so conversion is already done, in order
// to avoid repeating for each component (as a backup of all tra files is then done in each
// subdirectory of backup)
// This is a handy trick with BG1 NPC, since BG1NPC.tra is created when the mod is installed
// and removed with the mod. But it cannot be used as a generic trick for other mods.
ACTION_IF NOT (FILE_EXISTS_IN_GAME ~bg1npc/tra/%LANGUAGE%/BG1NPC.tra~) AND
(STRING_LENGTH ~%initialencoding%~ != 0) THEN BEGIN
ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~WIN32~ = 0) THEN BEGIN
// Only convert for the language selected by passing the directory as parameter
AT_NOW ~bg1npc/conv_tra.bat %LANGUAGE% %initialencoding%~
END
ACTION_IF ("%WEIDU_OS%" STRING_EQUAL_CASE ~OSX~ = 0) OR ("%WEIDU_OS%" STRING_EQUAL_CASE ~UNIX~ = 0) THEN BEGIN
// Only convert for the language selected by passing the directory as parameter
AT_NOW ~bg1npc/conv_tra.sh %LANGUAGE% %initialencoding%~
END
// Isaya: all tra files have to be renamed from .tra_utf8 to .tra!
// Otherwise the tra files for dialogs are still with the Windows 1252 encoding
MOVE ~bg1npc/tra/%LANGUAGE%/bg1npc_tmp.tra_utf8~ ~bg1npc/tra/%LANGUAGE%/bg1npc_tmp.tra~
... MOVE all tra files
LOAD_TRA ~bg1npc/tra/%LANGUAGE%/setup.tra~
PRINT ~re-loaded %LANGUAGE% TRA files~
END
END ELSE BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.are~ THEN BEGIN
/* Tell the player it is using Tutu stuff */
PRINT @1000
INCLUDE ~bg1npc\lib\g3_tutu_cpmvars.tpa~
OUTER_SPRINT ~bgee~ ~~
END ELSE BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~AR7200.are~ THEN BEGIN
/* Tell the player it is using BGT stuff */
PRINT @1001
INCLUDE ~bg1npc\lib\g3_bgt_cpmvars.tpa~
OUTER_SPRINT ~bgee~ ~~
/* Tell the player it is not Tutu or BGT */
END ELSE BEGIN FAIL ~Please install on BG:EE, Tutu or BGT.~
END
END
END
with conv_tra.bat:: Use a parameter to the script (%1) to specify the directory that must be converted
:: Use a parameter to the script (%2) to specify the encoding of the files to convert
:: Prevent display of DOS command lines
@echo off
:: Since the pattern matching in Windows considers that "fu.tra_utf8" also matches "*.tra", we have to
:: handle the file extension by ourselfves in order to avoid all those tra_utf8_utf8 etc files
:: Use %%~ni instead of %%~nxi (x is for extension) and specify the tra extension
for %%i in (bg1npc\tra\%1\*.tra) do bg1npc\iconv -f %2 -t UTF-8 "bg1npc\tra\%1\%%~ni.tra" > "bg1npc\tra\%1\%%~ni.tra_utf8"
and conv_tra.sh# Use a parameter to the script ($1) to specify the directory that must be converted
# Use a parameter to the script ($2) to specify the encoding of the files to convert
for file in $(ls bg1npc/tra/$1/*.tra)
do
iconv -f "$2" -t UTF-8 "$file" > "$file"_utf8
done
I couldn't test conv_tra.sh in a real installation as I don't have the game under my Linux virtual machine but I checked it the script standalone nonetheless.Wisp, ever since I wrote the code to use MOVE in V231 and now in V235, I'm finding that the foo.tra_utf8 file I ask to move are actually copied under the new name but foo.tra_utf8 is not removed. Do you know if it's this a bug or if there's a reason for that?MOVE only moves if the destination file does not exist. Otherwise it copies.
DEFINE_ACTION_FUNCTION autotra_workaround BEGIN
ACTION_IF !FILE_EXISTS ~%MOD_FOLDER%/tra/%LANGUAGE%/utf8.mrk~ BEGIN
COPY ~%MOD_FOLDER%/tra/bgee/%LANGUAGE%~ ~%MOD_FOLDER%/tra/%LANGUAGE%~
COPY_EXISTING sw1h01.itm ~%MOD_FOLDER%/tra/%LANGUAGE%/utf8.mrk~
END
END
('If ever' part is a little sad. :( I have no idea how to convert Polish/French/Italian files, since I can't check the result, not knowing the language. I can convert Russian files, sure).Well, I don't want to get anyone's hopes up prematurely. And even if WeiDU will be able to offer something substantial to help with this, it won't be magic. At a minimum, WeiDU would have to know the charset used for the input text (and it would have to be a single charset). So it would operate under pretty much the same constraints you're under when you use iconv today.
But what exactly should I do with the .tra files I have, how do I get BG2EE files out of them? I obviously can't read anything, but I see the visual difference between the files, so maybe I can do this.There are a few things that go into it.
Btw, is there a way to convert all the files at once, not one-by-one?Sure. You can, for example, use something like Isaya's batch file. iconv can be downloaded from here (http://gnuwin32.sourceforge.net/packages/libiconv.htm) (you want the zip with the binaries; the program is located in the bin/ directory, and you need the two dll files as well). Unlike Isaya's batch file, however, I would recommend that you organise your files with directories instead of weird filename extensions. That's what directories are for.
Wisp (and everyone else): I think Polish has different charsets for BG1 and BGII, too. I don't know which, though.It's probably CP852, but I suppose someone would have to confirm it.
Related to the landmine, I would recommend that you place all strings that are used during the installation (component names, strings that are PRINTed, etc.) in a separate file, because only game text should be encoded in UTF-8 for BG(II)EE. Having them in separate files makes it much easier to handle.
Just to be clear on this, the game engine for BGII:EE uses cp1252.The original engine uses CP1252 (et al.). BGII: EE uses UTF-8. (It sounds like that is what you meant, but just to be clear.)
The text shown/used in-game uses UTF-8(no BOM).
1. setup.tra [everything declared and referenced inside of the .tp2 or related processing files like .tpa .tpp .tph] (which would come encoded differently in different languages and platforms)Not everything referenced inside TP2 files should go into setup.tra. Strings for SAY, for example, need to go into mymod.tra, since they are used in the game rather than during the installation. setup.tra should contain only those strings that are printed to the command prompt.
2. mymod.tra [everything called by .d and .baf to be placed into the dialog.tlk and displayed ingame] (which need to be set up into at least two copies per language; one {example:english=cp1252} for the older games, and one {ALL LANGUAGES THE SAME=UTF-8(no BOM)} for BGII:EE.
I ask this because it means untangling .tra materials, some of which, like the declared strings for soundset references in the .tp2, etc, show up in the game... so I am trying to figure out if all the .tp2 actions are pulling form the correct .tra.I don't know about Aran in particular, but I'd expect the vast bulk of your text is dialogue and other types of game content, with two handfuls or so of strings used during the installation. Untangling the strings is not necessarily some huge task. You can likely just create a new tra file and move your dozen (or whatever) setup strings into it. No need to disturb the rest.
Or is it that only the strings displayed in the cmd screen are the ones that need to be declared initially in LANGUAGE, and that everything actually processed pulls from the ALWAYS?Perhaps I'm confusing things, but technically, the only strings that need to be loaded by LANGUAGE are those that are used while the user is selecting components. In terms of syntax, it's TP2 flags, components and component flags that need LANGUAGE. Actions, patches and values can use strings loaded in other ways.
Cahir: I PMed Zed Nocear at G3 about his way to convert string chars for BGQE - neat little tpa that replaces special characters with the one of the right encoding upon install. If you have other means of contacting him (Polish forum etc.), I'd be happy if you could give him a call. :)
I have the problem that OUTER_SPRINT "tra_path" isn't set for bgee, the installer takes the LANGUAGE one whatever I do (cannot LOAD_TRA from %tra_path%, cannot do USING). I'd need a second pair of eyes for this.Your logic is a bit convoluted and excessively nested, and it'd be easier to follow if you made use of INCLUDE [1], but it is correct and the BGEE block is the only block to evaluate on BG: EE and %tra_path% evaluates to ~AjantisBG1/translations/bgee~ afterwards. How is the problem manifesting itself? Have you confirmed that it is using the wrong tra_path (e.g., by PRINTing the value), or are you inferring this from the installed state of the mod? If it is the latter, are you sure your TRA files really are encoded in UTF-8?
http://kerzenburg.baldurs-gate.eu/files/jastey/Setup-AjantisBG1.tp2
Thank you in advance.
ACTION_IF GAME_IS ~tutu tutu_totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/tutu.tpa~
END ELSE ACTION_IF GAME_IS ~bgt~ BEGIN
INCLUDE ~ajantisBG1/somedir/bgt.tpa~
END ELSE ACTION_IF GAME_IS ~bg1 totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/bg1.tpa~
ACTION_IF GAME_IS ~totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/bg1_totsc.tpa~
END ELSE BEGIN
INCLUDE ~ajantisBG1/somedir/bg1_bg1.tpa~
END
END ELSE ACTION_IF GAME_IS ~bgee~ BEGIN
INCLUDE ~ajantisBG1/somedir/bgee.tpa~
END
ACTION_IF GAME_IS ~tutu tutu_totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/tutu.tpa~
END
ACTION_IF GAME_IS ~bgt~ BEGIN
INCLUDE ~ajantisBG1/somedir/bgt.tpa~
END
ACTION_IF GAME_IS ~bg1 totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/bg1.tpa~
ACTION_IF GAME_IS ~totsc~ BEGIN
INCLUDE ~ajantisBG1/somedir/bg1_totsc.tpa~
END ELSE BEGIN
INCLUDE ~ajantisBG1/somedir/bg1_bg1.tpa~
END
END
ACTION_IF GAME_IS ~bgee~ BEGIN
INCLUDE ~ajantisBG1/somedir/bgee.tpa~
END
EDIT: Actually I did not edit the mod title, as this is always taken from the LANGUAGE path, but I edited the "EE install detected..." line, and this edit never showed.If you edited @14 in the TRA file in the BGEE subdirectory, the edit would not show when ALWAYS was evaluated, since the BGEE-encoded TRA files are not loaded until afterwards (at the end of the ALWAYS block).
ALWAYS
ACTION_IF GAME_IS ~tutu tutu_totsc~ THEN BEGIN
INCLUDE ~AjantisBG1/install/ajantis_tutu.tpa~
/* Tell the player it is using Tutu */
PRINT @1
END
ACTION_IF GAME_IS ~bgt~ THEN BEGIN
INCLUDE ~AjantisBG1/install/ajantis_bgt.tpa~
/* Tell the player it is using BGT stuff */
PRINT @2
END
/* vanilla BG1, general */
ACTION_IF GAME_IS ~bg1 totsc~ THEN BEGIN
PRINT @3
INCLUDE ~AjantisBG1/install/ajantis_bg1.tpa~
/* BG1 with TotSC installed */
ACTION_IF GAME_IS ~totsc~ THEN BEGIN
INCLUDE ~AjantisBG1/install/bg1.tpa~
END ELSE BEGIN
/* BG1 without TotSC installed */
INCLUDE ~AjantisBG1/install/totsc.tpa~
END
END
ACTION_IF GAME_IS ~bgee~ THEN BEGIN
INCLUDE ~AjantisBG1/install/ajantis_bgee.tpa~
PRINT @14
END
END
AUTO_TRA ~AjantisBG1/Translations/%s~
LANGUAGE ~English~
~English~
~AjantisBG1/Translations/English/Setup-AjantisBG1.tra~
LANGUAGE ~Francais~
~French~
~AjantisBG1/Translations/French/Setup-AjantisBG1.tra~
LANGUAGE ~Deutsch~
~German~
~AjantisBG1/Translations/German/Setup-AjantisBG1.tra~
BEGIN @0
/* STATE.IDS patching to ToB - thanks, Cam, if you read it */
/* adds custom IsValidForPartyDialogue state */
APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~
COMPILE EVALUATE_BUFFER ~AjantisBG1/Friendship/Ajantis_friendship_d.d~
USING ~%tra_path%/%LANGUAGE%/Ajantis_friendship_d.tra~
ACTION_IF GAME_IS ~tutu tutu_totsc bgt bgee~ THEN BEGIN
COMPILE EVALUATE_BUFFER ~AjantisBG1/Friendship/Tutu_Interjections.d~
USING ~%tra_path%/%LANGUAGE%/BG_Interjections.tra~
VERSION @30001
README ~aranw/docs/readme-aranw-%LANGUAGE%.html~ ~aranw/docs/readme-aranw.html~
ALWAYS
INCLUDE ~aranw/lib/regexp.tph~ /* extra regexp vars */
ACTION_IF GAME_IS ~bg2ee~ BEGIN
OUTER_SPRINT tra_version ~c-aranw_utf8nb~
LOAD_TRA ~aranw\tra\english\c-aranw_utf8nb.tra~
LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_utf8nb.tra~
END ELSE BEGIN
OUTER_SPRINT tra_version ~c-aranw_cp1252~
LOAD_TRA ~aranw\tra\english\c-aranw_cp1252.tra~
LOAD_TRA ~aranw\tra\%LANGUAGE%\c-aranw_cp1252.tra~
END
END
LANGUAGE ~English~
~english~
~aranw\tra\english\c-aranw_cp1252.tra~ // Holds text displayed in the game, including SAY and such in the TP2 et al
~aranw\tra\english\setup_%WEIDU_OS%.tra~ // Holds text displayed during the installation: TP2, et al
BEGIN @30010
REQUIRE_PREDICATE GAME_IS ~bg2 tob bgt bg2ee~ @30002
WeiDU v 23600 Log
C:\Program Files (x86)\BeamDog\Games\00546\setup-aranw.exe
[./chitin.key] loaded, 843510 bytes
[./chitin.key] 185 BIFFs, 59857 resources
[.\weidu.conf] loaded, 17 bytes
[lang\en_us/dialog.tlk] loaded, 13498915 bytes
[lang\en_us/dialog.tlk] 116169 string entries
Using Language [English]
[English] has 2 top-level TRA files
[aranw\tra\english\c-aranw_cp1252.tra] has 13364 translation strings
[aranw\tra\english\setup_win32.tra] has 120 translation strings
Using lang\en_us/dialog.tlk
Would you like to display the readme? [Y]es [N]o
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/AREAS.BIF]
[./DATA/AREAS.BIF] 2545144 bytes, 318 files, 0 tilesets
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/25AREAS.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/25AREAS.BIF]
[./DATA/25AREAS.BIF] 659172 bytes, 85 files, 0 tilesets
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/NEERA.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/NEERA.BIF]
[./DATA/NEERA.BIF] 146175540 bytes, 1859 files, 11 tilesets
Install Component [Install Aran Whitehand for SoA and ToB]?
[I]nstall, or [N]ot Install or [Q]uit?
Installing [Install Aran Whitehand for SoA and ToB] [Beta_4]
loading 1 tra file
[aranw\tra\english\c-aranw_utf8nb.tra] has 13364 translation strings
loading 1 tra file
[aranw\tra\english\c-aranw_utf8nb.tra] has 13364 translation strings
* * * * *
WeiDU says that this game has BGII:EE content.
The version of Aran Whitehand being installed is:
Beta_4
Weidu vars on this install:
Language = english
Architecture = x86
Operating System = win32
User Directory = C:\Users\Stephen\Documents/Baldur's Gate II - Enhanced Edition
Save Game Single Player Directory = C:\Users\Stephen\Documents/Baldur's Gate II - Enhanced Edition/save
Save Game Multi Player Directory = C:\Users\Stephen\Documents/Baldur's Gate II - Enhanced Edition/mpsave
Running .exe = C:\Program Files (x86)\BeamDog\Games\00546\setup-aranw.exe
<< snip for space >>
Installing SoA dialog...
Compiling 1 dialogue file ...
[aranw/tra/english/c-aranw_utf8nb.tra] has 13364 translation strings
Processing 1 dialogues/scripts ...
Adding C-ARAN to internal list of available DLGs
Adding C-ARANJ to internal list of available DLGs
<< snip for space >>
Installing ToB dialog...
Compiling 1 dialogue file ...
[aranw/tra/english/c-aranw_utf8nb.tra] has 13364 translation strings
Processing 1 dialogues/scripts ...
Adding C-ARN25A to internal list of available DLGs
BGII:EE detected. Managing journal entries.
Processing quests and journals
[aranw/tra/english/c-aranw_utf8nb.tra] has 13364 translation strings
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/BGEEUI.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/BGEEUI.BIF]
[./DATA/BGEEUI.BIF] 77256 bytes, 3 files, 0 tilesets
Processing quests and journals
[aranw/tra/english/c-aranw_utf8nb.tra] has 13364 translation strings
[./override/bgee.sql] loaded, 49610 bytes
BGII:EE content is being installed.
Compiling 1 dialogue file ...
[aranw/tra/english/c-aranw_utf8nb.tra] has 13364 translation strings
WeiDU v 23600 Log
G:\BGII - SoA\setup-aranw.exe
[./CHITIN.KEY] loaded, 590467 bytes
[./CHITIN.KEY] 182 BIFFs, 41787 resources
[./Autorun.ini] loaded, 1452 bytes
[./baldur.ini] loaded, 3512 bytes
Possible HD/CD Path: [G:\BGII - SoA\]
Possible HD/CD Path: [G:\BGII - SoA\CD1\]
Possible HD/CD Path: [G:\BGII - SoA\CD2\]
Possible HD/CD Path: [G:\BGII - SoA\CD2\]
Possible HD/CD Path: [G:\BGII - SoA\CD3\]
Possible HD/CD Path: [G:\BGII - SoA\CD4\]
Possible HD/CD Path: [G:\BGII - SoA\CD5\]
[./Keymap.ini] loaded, 5615 bytes
[./Mplaynow.ini] loaded, 230 bytes
[./dialog.tlk] loaded, 10666500 bytes
[./dialog.tlk] 87406 string entries
Using Language [English]
[English] has 2 top-level TRA files
[aranw\tra\english\c-aranw_cp1252.tra] has 13364 translation strings
[aranw\tra\english\setup_win32.tra] has 120 translation strings
Would you like to display the readme? [Y]es [N]o
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 0 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 3 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 100 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 101 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 102 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 103 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 104 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 106 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 107 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 108 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 109 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 110 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 111 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 112 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 113 Installed
BG2FIXPACK/SETUP-BG2FIXPACK.TP2 0 114 Installed
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD5\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD4\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD3\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD2\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD2\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\CD1\/DATA/AREAS.BIF]
BIFF may be in hard-drive CD-path [G:\BGII - SoA\/DATA/AREAS.BIF]
[G:\BGII - SoA\/DATA/AREAS.BIF] 2438836 bytes, 307 files, 0 tilesets
[./override/ar6111.are] loaded, 2776 bytes
Install Component [Install Aran Whitehand for SoA and ToB]?
[I]nstall, or [N]ot Install or [Q]uit? [./override/ar6111.are] loaded, 2776 bytes
Installing [Install Aran Whitehand for SoA and ToB] [Beta_4]
[./override/ar6111.are] loaded, 2776 bytes
loading 1 tra file
[aranw\tra\english\c-aranw_cp1252.tra] has 13364 translation strings
loading 1 tra file
[aranw\tra\english\c-aranw_cp1252.tra] has 13364 translation strings
* * * * *
[./override/ar6111.are] loaded, 2776 bytes
[./override/ar6111.are] loaded, 2776 bytes
WeiDU says that this game has BGII - ToB content.
[./override/ar6111.are] loaded, 2776 bytes
[./override/ar6111.are] loaded, 2776 bytes
The version of Aran Whitehand being installed is:
Beta_4
Weidu vars on this install:
Language = english
Architecture = x86
Operating System = win32
User Directory = .
Save Game Single Player Directory = ./save
Save Game Multi Player Directory = ./mpsave
Running .exe = G:\BGII - SoA\setup-aranw.exe
* * * * *
<< snip for space>>
Installing SoA dialog...
Compiling 1 dialogue file ...
[aranw/tra/english/c-aranw_cp1252.tra] has 13364 translation strings
<< snip for space>>
Installing ToB dialog...
Compiling 1 dialogue file ...
[aranw/tra/english/c-aranw_cp1252.tra] has 13364 translation strings
etc.The install takes the path specified by AUTO_TRA for USING, no matter what I put in for tra_path.Yeah, AUTO_TRA takes precedence over all other ways of loading TRAs. Sorry, I should have made that connection right away. I'll document this behaviour.
number of sequence in Font BAM bg1 bg2 cp852 (windows-1250) (DOS) Ą 228 164 164 Ć 229 197 143 Ę 230 201 168 Ł 231 162 157 Ó 232 210 224 Ń 233 208 227 Ś 234 139 151 Ź 235 142 141 Ż 236 174 189 ą 237 184 165 ć 238 229* 134 ę 239 233* 169 ł 240 178 136 ń 241 240* 228* ó 242 242 162 ś 243 155 152 ź 244 158 171 ż 245 190 190 |
Yay, I've got Russian and Polish files for Xan! I'm going to add two new translations - RussianEE and PolishEE, so Auto_TRA can get these.I'd use a single LANGUAGE entry and use the COPY trick (described here (http://forums.pocketplane.net/index.php/topic,28771.msg333342.html#msg333342) and here (http://forums.pocketplane.net/index.php/topic,28771.msg333334.html#msg333334)).
Am I doing the right thing? Is there an easier way? (worries)
I, um, wonder: is it possible to make LANGUAGE backwards compatible with another optional pair of argumentsIt's (probably) possible, but I'd rather not do it until I've given up on a more transparent solution.
I think I'm going to pause until the end of the holidays and then decide.Maybe I'll have explained it better in the promised tutorial by then.
BACKUP ~modfolder/install/backup~
AUTHOR ~blabla~ //for bugreports
//MODDER
VERSION ~no. x~
ALWAYS
ACTION_IF GAME_IS ~bgee~ BEGIN
OUTER_SPRINT tra_path ~bg1re/tra/utf8~
END ELSE BEGIN
OUTER_SPRINT tra_path ~bg1re/tra~
END
LANGUAGE ~English~
~english~
~%tra_path%/english/setup.tra~ ~%tra_path%/english/setup_game.tra~
BEGIN @5
ALWAYS
[lots of OUTER_SPRINT definition and patching of area scripts etc.pp ]
/* Handling of correctlky formatted tra-files!! ---------------------- */
ACTION_IF GAME_IS ~bgee~ THEN BEGIN
/*
* Copies UTF8-encoded tra files over the normal ones, for use with AUTO_TRA
*/
DEFINE_ACTION_FUNCTION autotra_workaround BEGIN
COPY ~bg1re/tra/utf8/%LANGUAGE%~ ~bg1re/tra/autotra/%LANGUAGE%~
END
LAF autotra_workaround END
//TRAs declared in LANGUAGE must be reloaded
LOAD_TRA "bg1re/Tra/autotra/english/setup.tra"
LOAD_TRA "bg1re/Tra/autotra/english/setup_game.tra"
LOAD_TRA "bg1re/Tra/autotra/%LANGUAGE%/setup.tra"
LOAD_TRA "bg1re/Tra/autotra/%LANGUAGE%/setup_game.tra"
END ELSE BEGIN
/*
* Copies UTF8-encoded tra files over the normal ones, for use with AUTO_TRA
*/
DEFINE_ACTION_FUNCTION autotra_workaround BEGIN
COPY ~bg1re/Tra/classic/%LANGUAGE%~ ~bg1re/Tra/autotra/%LANGUAGE%~
END
LAF autotra_workaround END
//TRAs declared in LANGUAGE must be reloaded
LOAD_TRA "bg1re/Tra/autotra/english/setup.tra"
LOAD_TRA "bg1re/Tra/autotra/english/setup_game.tra"
LOAD_TRA "bg1re/Tra/autotra/%LANGUAGE%/setup.tra"
LOAD_TRA "bg1re/Tra/autotra/%LANGUAGE%/setup_game.tra"
END
END //ALWAYS
/* --------------------------------------------- */
AUTO_TRA ~bg1re/tra/autotra/%s~
LANGUAGE ~English~
~english~
~bg1re/tra/autotra/english/setup.tra~ ~bg1re/tra/autotra/english/setup_game.tra~
BEGIN @5
(...)
...I think I saw a tutorial where the language files(actually the single .tra file) was replaced if they were needed to be replaced after the language was declared ... that way you don't have to do the above.
BG1 NPC does not use two sets of files... BG1 NPC still utilizes only old files, and includes its own utf-8 converter... if I understand correctly.Exactly. Hawing to deal with two set of files is a nightmare for translators, even if it is only "run my Copy-AND-Convert-ANSI-UTF8.bat file before he will send files to include in official mod archive. And then he just fix missing ~ and forgot to make copy and conversion ...
When I asked about "handle this by weidu completely" what I mean is that weidu will convert all ANSI files to UTF-8 on the fly when the game will be XX:EE and without any modification to original mod.I have been looking into adding a more transparent method of dealing with this. I expect I'll present what findings I have at some point (spoiler: the outlook's bleak. Mostly due to licencing.) But mods would still have to be updated. You have to know which encoding to convert from (and no, "ANSI" is not an encoding) and this information cannot be known or inferred from mods in their current state. It has to be added.
I expect I'll present what findings I have at some point (spoiler: the outlook's bleak. Mostly due to licencing.)Okay, that's probably enough suspense.
1. Setup-oldmod.exe is executed, user selected "Polish" translation,
2. WeiDU detects XX:EE and also read folder with translated files are. Path contain "polish".
3. WeiDU reads "Conversion map:"
I saw HANDLE_CHARSETS and it's really handy. But you have to face reality that most of the old mods will never be updated due to "you can't host fixed mod archive without signed permission from the author that is absolutely beyond any way of reaching".