Pottery Posted May 2, 2010 Share Posted May 2, 2010 Is there any way to change the language of text in AutoIt scripts? For example changing a GUI label from Password to Пароль (russian), is this possible? When I do it it comes out as ?????? Link to comment Share on other sites More sharing options...
logmein Posted May 2, 2010 Share Posted May 2, 2010 (edited) Yes! Try This : First, you must download this file : http://www.mediafire.com/?mjzjt3klymy and save it to your desktop. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form = GUICreate("Form1", 633, 447, 192, 124) $Label = GUICtrlCreateLabel(_getlanguage("Username"), 16, 8, 52, 17) $Label = GUICtrlCreateLabel(_getlanguage("Password"), 16, 25, 52, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _getlanguage ($text);this fuction is used to retrieving traslated text from original text $readtext = IniRead (@DesktopDir & '\Language.ini','Russian',$text,'error') If Not @error Then Return $readtext Else MsgBox (16,'AutoIT','Language file not found!','',$form) Exit EndIf EndFunc Edited May 2, 2010 by logmein [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
MvGulik Posted May 2, 2010 Share Posted May 2, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
jchd Posted May 2, 2010 Share Posted May 2, 2010 @Exhalt, Follow MvGulik advice and save your source file(s) in UTF-8 encoding. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
logmein Posted May 2, 2010 Share Posted May 2, 2010 (edited) Is there any way to change the language of text in AutoIt scripts? Depends on the editor you use to save your source file. In case of Scite or Scite4autoit. goto menu:file->encoding->(pick your code), then save. (before you add any none ansi characters) changing a GUI label from Password to Пароль (russian), is this possible? Yes. Provide you did save the source correctly(encoding).(not sure about possible font issues here)GUICreate('ÀÁÂÃÄÅÆ') GUICtrlCreateLabel('ẀẁẂẃẄẅ฿',10,10) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = -3 ;; $GUI_EVENT_CLOSE When I do it it comes out as ?????? Than the UTF code did not make it into the final code that was executed. Probably because your source was saved in ansi. --- First, you must download this file : http://www.mediafire.com/?mjzjt3klymy and save it to your desktop. Whats with the need to download anything? -How about a multi-language program? Use GUICtrlSetData? Can't! With many of controls, it need a complex loop. -Each time your want to change your language is a big problem. See what I did with my multi-language program : Total USB Security. It can easily change language only by click and restart it. -With 'ÀÁÂÃÄÅÆ' and 'ẀẁẂẃẄẅ฿' in your script is very hard to know what is that ? -Hmm... http://www.mediafire.com/?mjzjt3klymy : This is the language file for your script. Very useful and easy to edit. -Sorry for my bad English! Edited May 2, 2010 by logmein [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
jchd Posted May 2, 2010 Share Posted May 2, 2010 logmein The OP is asking how to have non-codepage characters display correctly. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) 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