Jump to content

Write language independant AU3 scripts


water
 Share

Recommended Posts

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:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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:

Link to comment
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
 Share

  • Recently Browsing   0 members

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