none
How to make a notepad with change text to decrypt language

Answers

  • Normally people use the Google Translation API.  You can search the web for some code.  I have code that I in VBA.  I create a simple html file as a front end to interface with the google api.  See code below


    Insert this code into a text file called c:\temp\translate.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Google Translate API</title>
    </head>
    <body>
    <form name="f" id="f" action="#" onsubmit="translate(); return false;">
    <textarea name="foreign_text" id="foreign_text" rows="4"
    cols="60"></textarea>
    <br />
    <br />
    <input type="submit" id="submit_button" value="Translate into English"
    onfocus="this.blur();" />
    <br />
    <br />
    <textarea name="translation" id="translation" rows="4" cols="60"
    onfocus="this.select();" readonly="true"></textarea></form>
    <br />
    <script type="text/javascript" originalsrc="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
    google.load("language", "1");
    function translate() {var
    originaltext=document.forms["f"].foreign_text.value;
    google.language.translate(originaltext, "", "en", function(result) {
    document.forms["f"].translation.value = (result.error)?("Error:
    "+result.error.message):result.translation; }); }
    </script>
    </body>
    </html>

    Then run this code as an excel macro.

    Sub translate()
    Dim objIE As Object
    Dim strServAcct As String
    URL = "c:\temp\working\translation.html"
    'Open Internet Explorer
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    IE.Navigate URL
    Do While IE.Busy = True Or IE.readystate <> 4
    DoEvents
    Loop
    Set ForeignCells = Range("A1:B1")
    For Each cell In ForeignCells
    Set ForeignText = IE.document.getElementById("foreign_text")
    Set submit = IE.document.getElementById("submit_button")
    ForeignText.innertext = cell.Value
    submit.Select
    submit.Click
    Do While IE.Busy = True Or IE.readystate <> 4
    DoEvents
    Loop
    Set Translation = IE.document.getElementById("Translation")
    Translation.innertext = cell.Offset(1, 0).Value
    Next cell
    End Sub


    jdweng

    • Marked as answer by KKS21199 Wednesday, August 29, 2012 8:27 AM
    Thursday, August 23, 2012 10:50 AM