Jump to content
The Dark Mod Forums

[SOLVED] Localisation scripts for TDM 2.03 not working, at all


Petike the Taffer

Recommended Posts

Recently, after spending some time giving advice to one of our forum members on how to translate the GUI and in-game text via the use of the perl scripts, I have run into some serious issues. I've tried my best to figure out the problem on my own or by discussing it with some of the developers via PMs, but at this point, I am utterly stumped at what's going on. :unsure:

 

The key issue being that, though I have changed nothing about my strawberry perl installation and the placement of the perl script and associated strings folder(s), the command I originally used for generating the GUI translation (a few months ago) is not responding anymore. Whether I used a Windows command prompt or the built-in "perl (command line)" .bat (it's basically a .bat isn't it ?), it just doesn't work.

 

I've checked and rechecked the location of the script and the structure of my folders a million times over, same with the typing in of the exact command line. I am unable to even change the directory with the "cd D:\ (...etc.)" command. I was able to do it perfectly fine before.

 

I really can't explain why this is even happening, other than either:

a.) I must be missing one little detail somewhere in the process, but am not sure what it could be...

b.) the version of the "gen_lang.pl" perl script I've been using is, simply, incompatible with version 2.03. Even though I've asked Tels about this, he was none the wiser. So I'm really unsure.

 

There's also another potential issue:

The documentation for how to do a localisation of the GUI feels... completely outdated to me. I think we'll have to do some extensive updating on this matter in the near future, as even the wiki has only very basic documentation on this stuff and it hinders further TDM development for other languages.

 

I suppose it speaks volumes that even months ago, I had to first personally contact Tels to even get the script needed for translating the GUI. Things went better after that, but ever since I updated to 2.03, I had to redo the entire translation (thankfully, only by copying the existing text). This was due to the known incompatibility issues between 2.02 and 2.03. (My translated strings for 2.02 simply wouldn't work for 2.03, so I had to start over.)

 

In hindsight, I think I should have updated to 2.03 before even starting the translation. But if the incompatibility issue with the perl script is indeed real (I'm not sure, honest), then I would have gained little with that anyway, as it wouldn't work.

 

Ultimately, this is a massive Catch-22 of sorts and I'm just completely baffled what to do at this point. :( I wanted to finish the translation/localisation of the GUI and the base package missions by now, but this problem has rendered it impossible. I'd really like to finish and test the localisation already, just because I probably won't have much additional time come September. (That, and I finally want to move on to actual mission development.)

 

Any advice, guys and gals ? :blush:

Edited by Petike the Taffer
  • Like 1
Link to comment
Share on other sites

Can you provide some details? What happens when it "doesn't work"? Do you get an error and a stack trace, or what?

 

I'm not familiar with the localization code but I'm sure it's fixable. I don't remember any changes in 2.03, other than extra translations being added to all.lang.

Link to comment
Share on other sites

 

That's for FM translations, not GUI translations. And until I get the perl script problem sorted for the GUI, I'd rather not tackle the script for FMs.

 

Can you provide some details? What happens when it "doesn't work"? Do you get an error and a stack trace, or what?

 

I'm not familiar with the localization code but I'm sure it's fixable. I don't remember any changes in 2.03, other than extra translations being added to all.lang.

 

Well, bizarrely, it tells me that the script cannot be found. This has not happened before. And I didn't move the script. I've even replaced my old copy of it with a fresh one today, but the folder structure I used before for generating the GUI translation via the script has been unchanged since then. So I really don't get what I'm doing wrong. Maybe I've forgot to import my translated strings into the strings folder that comes with the "gen_lang.pl" perl script ?

 

(Note: There is a difference between the "gen_lang.pl" package and the "I18N.pl" script. The former is for the GUI, the latter is for missions. I've only used the former up until now, as I want to finish the GUI before I try to generate translated text for missions as well.)

Edited by Petike the Taffer
Link to comment
Share on other sites

are these files in direct location folders on your computer or the pseudo folders that windows sometimes uses to hide the location of the real folder, as you can't run .bat files from a pseudo location because the path will always be wrong, and a recent update to windows seems to have blocked running .bat files that don't have a direct path to the programs. eg I used to have the java compiler in the program files directory, but a windows update stopped the .bat files I had from accessing it as the program could not be found, so I had to re-install the java compiler in another folder away from the pseudo "program files" directory so that the .bat file could directly run the java compiler.

Link to comment
Share on other sites

The perl script file (gen_lang.pl) and added strings folder I've used previously while testing my translation in 2.02 are still kept at D:\Gamefiles\gen_lang\tdm_lang_gen\. So yes, second disk, a folder called Gamefiles, and then the two folders that were unzipped from the script zip - gen_lang, tdm_lang_gen, and in it, the script and the "strings" folder. I haven't changed the location at all.

 

Also, I've created a translation-included tdm_base01 and copied it to the game folder before I tested the script, so the problem shouldn't be with that. And yeah, it's a proper PK4 tdm_base01 file, previously unpacked, strings in all.lang rewritten in the section of the language I've been translating for, then rezipped and PK4-ed again, and everything.

 

Edit: So... Any ideas on what I might be doing wrong ?

Edited by Petike the Taffer
Link to comment
Share on other sites

I open the "cmd" in "systems32" folder and start off with:

C:\Users\Myname

I have the "gen_lang" perl script file in D:\Gamefiles\gen_lang\tdm_lang_gen\. I try to change the directory by typing in:

cd D:\Gamefiles\gen_lang\tdm_lang_gen\

And all I get is, every single time:

Invalid directory

or just

C:\Users\Myname

It's all the weirder, because earlier, it didn't take me that long to figure it all out.

Link to comment
Share on other sites

It sounds like that must be a virtual path in that case... the command shell isn't finding it.

 

If you break up your cd command, at what stage does it fail?

d:

cd Gamefiles

cd gen_lang

etc

 

You could also create a folder using the command shell (so you know for sure where the command shell thinks it is) then copy+paste the contents of your tdm_lang_gen folder into it and see whether you can access it from there.

Link to comment
Share on other sites

If you break up your cd command, at what stage does it fail?

 

From the very start, regrettably. I really don't understand what failed there. It was much more responsive before, even when it took me a few minutes to figure out. Now, it just isn't working altogether, as if the command prompt was unable to even understand what the cd command means.

  • Like 1
Link to comment
Share on other sites

Windows 7 32 bit, TDM 2.03, and for the perl scripts, Strawberry Perl 5.20.1.1-32bit.

 

Sorry if I forgot to mention that already at the start. :blush: I should have thought about that.

 

 

A good bit of news: I've... somehow finally managed to get the change directory command to work. In the perl command line, curiously, I even forgot about that while working on it (as I thought I had turned on the Windows cmd instead, but no matter).

 

Currently, I've changed the file path to the one I need and I'm going to see whether the perl script will work. According to my older conversation with Tels, "perl gen_lang.pl" should be sufficient once I have the folder path set. We'll see how the generating goes... Be right back.

  • Like 1
Link to comment
Share on other sites

OK, I've tested it. It all finally worked this time around ! B) I even found a small error in the all.lang file thanks to a notification by the command prompt, but that was inconsequential to the overall procedure. I'll now test the game to see if it runs properly and whether there are any bugs (I think there won't be, but still, it's better to be sure...).

 

MAJOR EDIT: The game is working fine. Forgot a few .lang files on the first try, so I had to modify a few more things and try again. But it's working now. :smile: I'm still weirded out by the command prompt only wanting to change directories its way, but who cares. At least it all works and you can get the whole thing running and generate the new text.

 

I am soooo writing a tutorial for this whole thing. Soon. Just to diffuse any confusion that might exist over this.

 

And just for future reference, I'm adding [sOLVED] to the title of this thread.

Edited by Petike the Taffer
  • Like 3
Link to comment
Share on other sites

It will be soon, bikerdude.

As I've noted earlier, I'd prefer to have the mission translations finished as well before public testing, just to allow others to test the package all in one go. I'm trying my best with proofreading and avoiding forgetting something, but I'll be all the happier if the public test of the new lang files finds a few more errors or bugs I've overlooked in my initial testing (once I finish the basic work).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • The Black Arrow

      Any of you heard Age of Wonders 4's OST?
      https://www.youtube.com/watch?v=Q0TcoMGq4iA
      I love how after all these years, Michiel van den Bos still conserves his "Melodic" spirit.
      · 0 replies
    • nbohr1more

      Moddb article is up:  https://www.moddb.com/mods/the-dark-mod/news/the-dark-mod-212-is-here
      · 3 replies
    • Petike the Taffer

      I've been gone for a while, but now I'm back, have a new desktop and I want to get back to making missions and playing missions. And doing other contributions. Waiting for my reset password for the wiki, but I'll take a look at it soon. Hello, all.
      · 4 replies
    • snatcher

      TDM Modpack 4.0 for The Dark Mod 2.12 released!
      · 1 reply
    • nbohr1more

      Congrats to all the busy Dark Mod developers! TDM 2.12 is here!
      · 4 replies
×
×
  • Create New...