i18n library for AutoIt 1.0.0

   (0 reviews)

About This File

Localization library, with support for arguments and printf()-like formats.

User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

  • Similar Content

    • jonson1986
      By jonson1986
      Hey I searched code on autoit forum and modify it according to my needs and try to translate text from Russian to English in return I'm getting error such as "Error 411 (Length Required)!!1"
      Both my autoit codes and error I got are given below, please help me to solve this issue, Thanks
      Autoit codes to translate text form Russian to English;
      #include <urlencode.au3> $File1 = @ScriptDir & "\russian_text.txt" $txt = FileRead($File1) ; Try to convert line breaks with .....so final URL looks simpler $txt = StringReplace($txt, @CRLF, '...........') $txt = StringReplace($txt, @LF, '.............') $txt = StringReplace($txt, @CR, '.............') FileWrite (@scriptdir & '\russian_text2.txt', $txt) $openfile = @ScriptDir & "\russian_text2.txt" $mytext = FileRead ($openfile) $encoding = urlencode ($mytext) FileWrite (@scriptdir & '\enooding.txt', $encoding) $from = "ru" $to = "en" $url = "https://translate.googleapis.com/translate_a/single?client=gtx" $url &= "&sl=" & $from & "&tl=" & $to & "&dt=t&q=" & $encoding $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("POST", $url, False) $oHTTP.Send() $sData = $oHTTP.ResponseText $sData = StringRegExpReplace($sData, '.*?\["(.*?)(?<!\\)"[^\[]*', "$1" & @crlf) FileWrite (@scriptdir & '\errorcode.txt', $sData) Msgbox(0,"", $sData) In response of above codes, I'm getting below error;
      <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"> <title>Error 411 (Length Required)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px} </style> <a href=//www.google.com/><span id=logo aria-label=Google></span></a> <p><b>411.</b> <ins>That’s an error.</ins> <p>POST requests require a <code>Content-length</code> header. <ins>That’s all we know.</ins>  
    • RTFC
      By RTFC
      CodeCrypter enables you to encrypt scripts without placing the key inside the script.
      This is because this key is extracted from the user environment at runtime by, for example:
      password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here):
      Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly.
      How the bits and pieces fit together:
      CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here:
      '?do=embed' frameborder='0' data-embedContent>>
      The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init().
      From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely:
      In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really.
      Not convinced? Check out this updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:
      BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want).
      CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for  example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples.
      You need the following additional scripts to get anything to work (now all included in the bundle):
      CodeScanner.au3 version 2.9+ (in the CodeScanner zip in the CodeScanner thread, link above) readCSdatadump.au3 (version 1.1+, in the CodeScanner zip) MCF.au3 (version 1.3+, in the MCF zip in the MCF thread, link above) MCFinclude.au3 (version 1.1+, in the MCF zip) AES.au3, by Ward (now also included in bundle, thanks to Ward), see '?do=embed' frameborder='0' data-embedContent>> As you can see, encryption currently relies on Ward excellent AES UDF, but you can replace this with any other algorithm you like; just edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry().
      Going to lie down now...
    • RTFC
      By RTFC
      MetaCode offers a way to:
      separate a script's structure from its content remove all redundant definitions (globals and UDFs) change any content (and some structure) combine (new) structure and (new) content into a new script The most useful applications implemented so far are:
      Fast language translation (not just text strings, also variable names and UDF names) Obfuscation (vars and/or UDFs) Script Encryption (conditionals, calls, and macros) Encryption is powerful because the key is not stored anywhere; you can define it to be a user password, macro, environment spec/variable, server response, something you define yourself, or a combination thereof; anything goes, as long as it's not a fixed string or fixed value. More info in the CodeCrypter thread: ?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>?do=embed' frameborder='0' data-embedContent>
      But MetaCode has more potential than that; it allows you to tinker with any type of content separately, then rebuild a new version. So for example, you can have a single script structure and numerous different language modules you just plug in to create a new version in a different language.
      The MCF library itself can be found in the CodeScannerCrypter bundle:
      And a little example how to use it for translating your GUI into a different language:
       UI_Translator.7z (new version that should work with the new version of Google Translate, see post #13 below)
      MCF.au3 is just the library plus the MCFinclude.au3 file you need to include in any script you wish to encrypt.
      There is no GUI here. However, I did write a separate front-end for it called CodeCrypter, which you can find here:
      ?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>?do=embed' frameborder='0' data-embedContent>
      MCF uses output generated by my CodeScanner version 2.8+, which you can find here:
      '?do=embed' frameborder='0' data-embedContent>>
      CodeScanner also depends on MCF.au3 now, as it can now call a few of its functions.
      I should also mention Ward's excellent AES.au3 UDFs used for the encryption and decryption calls,  which is now included in the CodeScannerCrypter bundle (thanks to Ward for allowing to include it). You can find the original (unpatched) version here:
      '?do=embed' frameborder='0' data-embedContent>>
      Note: you can replace the encryption/decryption calls with whatever algorithm you like (hint: the native <Crypt.au3> library is too slow for most purposes, better stick to machine code routines)
      So just to be clear:
      CodeScanner (v2.8+) needs MCF (earlier versions won't work!) CodeCrypter needs MCF (plus anything that MCF needs) MCF itself needs MCFinclude (part of MCF zip) MCF also needs readCSdatadump (part of the CodeScanner package, you need the latest version packaged with CodeScanner v2.8; earlier versions won't work!) both MCF and MCFinclude currently rely on AES.au3 by Ward So you basically need to download the whole bundle for any of it to work.
      If you have any questions, please start by reading the MCF Tutorial and the CodeCrypter FAQ (you can download the latter separately from the CodeCrypter thread).
      Next, read the extensive Remarks sections in MCF.au3, MCFinclude.au3, and CodeCrypter.au3
      If still no joy, then please post. However, I'm not online that often, and logged in to the forum even less, so response may take a while).
    • pinkfoyd
      By pinkfoyd
      Here is a tool coded in AutoIt to edit multiple ini files ( up to 8 at the same time) to include multilanguage support in your script.

      The script himself have multilanguage support, simply by using :
      To change language, i read my global.ini file witch inform me what ini file i had to use...
      ConsoleWrite ( _string_lang(19) ) Func _string_lang($number) $number = _StringRepeat("0",6-StringLen($number)) & $number $string = IniRead($my_ini_folder & $interface_ini_file,"STRING",$number,"NOT_FOUND") Return($string) EndFunc  
      where 19 is the 19 string in ini file witch look like this :
      Todo : Initial ini file not necessarily "english.ini"
      Feel free to use it, give me idea, critical or bug found.....
      As i am french please be gently
    • Jefrey
      By Jefrey
      I needed to create a simple i18n library for an open-source project I've worked on last week.
      So I made this simple and easy to use.
      When translating, you have two options: the first one is to use a global file on the following format:
      [language_code] text_id=Translation text_with_format=Number: %.2f text_with_parameter=Hi %s [another_language_code] text_id=Tradução ... The second option is to separate every translation into files named language_code.lng in a folder of your choice. Note that every file on this folder will have the following format:
      [language_code] text_id=Translation text_with_format=Number: %.2f text_with_parameter=Hi %s The language code can be ISO 639-1 (2 chars, like "en", "pt", "es") or culture code (including the country, like "en-US", "pt-BR", "es-ES"). You can use both these formats on the same file/project without any problem.
      Finally, use the _() function to get your translation text. It accepts the following syntax:
      _($sText_id [, $sPar1 [, $sParn ] ] ) The parameters are optional, but the maximum number of parameters is 32. If you need more than 32 parameters (sure?), please consider splitting your string into multiple ones.
      Note that everything is explained on the Example.au3 (see online) and Example.lng (see online) file.
      Interesting note (source):
      Download: AutoIt Files
      Fork me on Github