Jump to content
Sign in to follow this  
water

Write language independant AU3 scripts

Recommended Posts

water

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 defendant 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?

Thomas

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
ludocus

so weres the udf??.. And I do not understand totally..

Share this post


Link to post
Share on other sites
JRowe

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! :(

Share this post


Link to post
Share on other sites
water

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=british line in MsgTest.ini. After restarting MsgTest.au3 all messages will be displayed in british.

Thomas


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
kjactive

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:

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.