Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Wisp
« on: May 20, 2017, 06:12:11 PM »

It's less work for me to say not supported. That it works as far as it does is an artifact of the order in which the LANGUAGE variable is defined and the TRA files are loaded. It could just as well have been the other way around. Other bits of code that load the LANGUAGE TRAs need not (and do not) define the LANGUAGE variable first.
Posted by: Argent77
« on: May 20, 2017, 11:47:33 AM »

I've noticed that the LANGUAGE variable can apparently be used directly in the LANGUAGE statement where it is defined. The mod finds the right tra file and displays strings correctly. However, at the end of the installation or uninstallation process I'm getting an error message about missing translations.

The test mod consists of a tra file "TestLanguage/languages/english/setup.tra":
Code: [Select]
@1 = ~Test component~
@100 = ~A test message...~

And a tp2 file "TestLanguage/setup-TestLanguage.tp2":
Code: [Select]
BACKUP ~TestLanguage/backup~
AUTHOR ~Myself~
VERSION ~1.0~

LANGUAGE ~English~ ~english~ ~%MOD_FOLDER%/languages/%LANGUAGE%/setup.tra~

BEGIN @1  // Test component
  PRINT @100  // A test message...

Installing the mod results in the following debug log:
Code: [Select]
WeiDU v 24001 Log

 D:\Games\Baldur's Gate Siege of Dragonspear\Data\00806\setup-TestLanguage.exe
[.\chitin.key] loaded, 776244 bytes
[.\chitin.key] 95 BIFFs, 55250 resources
[.\engine.lua] loaded, 101 bytes
[.\weidu.conf] loaded, 17 bytes
[.\lang\en_us\dialog.tlk] loaded, 8665736 bytes
[.\lang\en_us\dialog.tlk] 71358 string entries
Using Language [English]
[English] has 1 top-level TRA files
[TestLanguage/languages/english/setup.tra] has 2 translation strings

Using .\lang\en_us\dialog.tlk
TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2  0  1 Installed

Install Component [Test component]?
[I]nstall, or [N]ot Install or [Q]uit?
Installing [Test component] [1.0]

A test message...


Saving This Log:
TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2  0  1 Installed
TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2  0  0 Installed ~Test component~
TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2's 1th component not found.ERROR: No translation provided for @1
Continuing despite error.

SUCCESSFULLY INSTALLED      Test component

And the WeiDU.log entry contains an undefined component name string:
Code: [Select]
~TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2~ #0 #0 // UNDEFINED STRING:   @1: 1.0