Author Topic: Is using LANGUAGE variable in LANGUAGE statement supported by WeiDU?  (Read 457 times)

Offline Argent77

  • Planewalker
  • *****
  • Posts: 165
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~

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

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  0 Installed ~Test component~
TESTLANGUAGE/SETUP-TESTLANGUAGE.TP2's 1th component not found.ERROR: No translation provided for @1
Continuing despite error.


And the WeiDU.log entry contains an undefined component name string:
Code: [Select]

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
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.
« Last Edit: May 20, 2017, 06:16:45 PM by Wisp »


With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

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:
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)?: