Jump to content

Search the Community

Showing results for tags 'translate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 6 results

  1. I use Chrome's 'Translate this page' functionality quite a lot at work. My workflow is usually translating the page to english so I know what it is about, finding correct lines, translating it back to the original language so I can grab the correct XPath (since translating it, updates the structure and most importantly the text displayed, obviously), and rinse and repeat. Since I do it all the time, each unnecessary click in the end amounts to quite some time I would rather be spending actually working. You have to click the translate button, it asks whether you want to translate the page, you have to click yes. Then sometimes the little window is in the way so you click it off but when you need to translate back to the original language you have to click the little icon again. How would one go about automating it? Checked the forum and it seems that the old Chrome UDF doesn't work and the best way for interacting with Chrome is the WebDriver UDF which, from what I've read and tested a bit, creates a new, different instance of Chrome. I tried using the good old MouseClick but I don't find it reliable. Also ControlClick seems to be out of the picture since the whole Chrome window is "one single control". Any ideas are appreciated.
  2. Hello I'm trying to translate few text using below code, I found it working previously couple of months ago but Now these days it's not working at all and I'm getting below errors when I run the script and Array display at the end of text also not able to show any translated text instead of value 0 & 1; --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (gt-res-data) --> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType Here is code, #include <IE.au3> #include <Array.au3> Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#auto/es") Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) _IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines)
  3. Hi, 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 Multilangue_autoit.zip
  4. Estoy traduciendo este projecto al español que esta mal traducido, son 1000 lineas de frases, para mi es mucho, si alguien que sepa español puediera ayudarme se lo agradeceria
  5. Hey, So I'm trying to create a translation script to translate text from english to spanish. It seems my program crashes if i have more than 1 child in the html.(i will highlight it via comment) I am also occasionally crashing after my 5 second, while busy, loop. Any help or insight would be greatly appreciated. $langFrom = "en" $langTo = "es" While 1 Sleep(250) Translate() Wend Func Translate() $ie = ObjCreate("InternetExplorer.Application") $ie.visible = True $toTrans = InputBox("Translate", "Enter text to translate [" & $langTo & "]") $ie.Navigate("https://translate.google.ca/?ie=UTF-8&hl=" & $langFrom & "&client=tw-ob#auto/" & $langTo & "/" & $toTrans) $result = "" While($ie.busy) Sleep(5000) WEnd ;occasionally crashing here (unsure cause) While($result = "") $result = $ie.document.getElementById("result_box").innerHTML sleep(250) WEnd $children = $ie.document.getElementById("result_box").childNodes ;suspect i did something wrong here $result = "" for $child in $children $result = $result & $child.innerHTML & " " ;crashing here Next ;cleanup $result = StringReplace($result," "," ") $result = StringReplace($result," ."," ") $ie.quit() MsgBox(0,"Translated", $result) EndFunc
  6. 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
×
×
  • Create New...