Jump to content

Recommended Posts

Posted (edited)

Hi AU3-Gurus,

What do you do to write language independant scripts?

Programs are full with literals used in GUIs, error messages and so on.

Is there already a solution for this problem?

If not: I' ve written an UDF that can read language dependant literals from a file, replace placeholders with variable data and return the string to the script.

English Example:

$asArray = _MsgInit("English Message File") ; Example message line: "001 : The OSType is & and the OSVersion is &"

$sMsgText = _MsgGet($asArray,"001",@OSType & " " & @OSVersion) ; Would return: "The OSType is WIN32_NT and the OSVersion is WIN_XP"

The same for German:

$asArray = _MsgInit("German Message File") ; Example message line: "001 : Der OSType ist & und die OSVersion ist &"

$sMsgText = _MsgGet($asArray,"001",@OSType & " " & @OSVersion) ; Would return: "Der OSType ist WIN32_NT und die OSVersion ist WIN_XP

Does this sound interesting to anyone?

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

He means he set up language files for different regions, so that german users could set their language to german and have the macros and other stuff appear in german, without doing it by hand :mellow:

Good idea! :(

Posted (edited)

Here you'll find the UDF and an example script.

The advantage of this approach is you can easily use your scripts in different regions simply by changing one line in an ini-file.

In the attachement you'll find:

  • MSG.AU3 - The UDF
  • MsgTest.english - The languagefile with english messages
  • MsgTest.german - Then languagefile with german messages
  • MsgTest.au3 - The example script
  • MsgTest.ini - The configuration file

Run the Script and all messages will be displayed in German. Activate the language=English line in MsgTest.ini. After restarting MsgTest.au3 all messages will be displayed in English.

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Project Manager scripting preprocessor has an auto generate and include Terratec language script support, Translate tool included

Writes the language script and preprocess the nodes right at all spots, the beaty is that sevel nodes is semilare and reused, as that the application language handle is simplified and auto generated too...

kjactive :mellow:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...