water Posted November 11, 2008 Share Posted November 11, 2008 (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 July 13, 2020 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 More sharing options...
ludocus Posted November 11, 2008 Share Posted November 11, 2008 so weres the udf??.. And I do not understand totally.. Link to comment Share on other sites More sharing options...
JRowe Posted November 11, 2008 Share Posted November 11, 2008 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 Good idea! [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
water Posted November 11, 2008 Author Share Posted November 11, 2008 (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 July 13, 2020 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 More sharing options...
kjactive Posted November 11, 2008 Share Posted November 11, 2008 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 Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now