Jump to content


Photo

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

localisation l18 translation gui translation gui localisation error problems perl script issue language strings

  • Please log in to reply
13 replies to this topic

#1 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 19 August 2015 - 01:30 PM

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, 24 August 2015 - 09:17 AM.

  • Anderson likes this

#2 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 19 August 2015 - 03:07 PM

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.



#3 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8927 posts

Posted 19 August 2015 - 03:31 PM

http://wiki.thedarkm...p?title=I18N.pl


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#4 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 19 August 2015 - 05:15 PM

 

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, 19 August 2015 - 05:19 PM.


#5 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1823 posts

Posted 19 August 2015 - 10:32 PM

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.



#6 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 21 August 2015 - 05:19 PM

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, 23 August 2015 - 10:28 AM.


#7 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 23 August 2015 - 11:15 AM

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.



#8 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 23 August 2015 - 11:56 AM

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.



#9 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 24 August 2015 - 08:11 AM

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.


  • Anderson likes this

#10 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20057 posts

Posted 24 August 2015 - 08:20 AM

As Steve has a lot on his plate atm, I am happy to look into this.

 

@Petike, can I assume - 

  • your running on Windows
  • are testing using TDM 2.03
  • What version of Pearl are you using? When I did a little work with Tels I used Strawberry Perl.


#11 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 24 August 2015 - 08:35 AM

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.


  • Anderson likes this

#12 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 24 August 2015 - 08:44 AM

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, 24 August 2015 - 09:17 AM.

  • Bikerdude, nbohr1more, Anderson and 1 other like this

#13 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20057 posts

Posted 24 August 2015 - 09:34 AM

Grand, is this now in a state where it can be tested by a typical user with no technical knowldege? The idea being so we have a vew to looking at getting ti added to the mod in the current or next dev cycle.



#14 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 326 posts

Posted 25 August 2015 - 07:02 AM

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).


  • Bikerdude likes this





Also tagged with one or more of these keywords: localisation, l18, translation, gui translation, gui localisation, error, problems, perl script, issue, language strings

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users