DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Boomerang still not working  (Read 15,294 times)

apollyon094

  • Participant
  • Joined in 2020
  • *
  • Posts: 1
Boomerang still not working
« on: May 04, 2020, 05:06 AM »
Is Mouser ever going to patch this? It was a really fun program and useful but due to new API changes it broke. I have fond memories of this piece of software and it's a pain to manually translate through a bunch of languages.

hornet

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 29
Re: Boomerang still not working
« Reply #1 on: May 05, 2020, 07:15 AM »
As an Aussie, all I can say is "just throw it" and it should come back to you. :-[

ridhmax

  • Participant
  • Joined in 2020
  • *
  • Posts: 2
Re: Boomerang still not working
« Reply #2 on: May 05, 2020, 11:48 AM »
I think its time to move on with better available alternatives boomerang is classic now

lyra

  • Participant
  • Joined in 2020
  • *
  • Posts: 1
Re: Boomerang still not working
« Reply #3 on: August 12, 2020, 02:55 AM »
I think its time to move on with better available alternatives boomerang is classic now

What available alternatives are there? I tried looking and I couldn't find a program that does exactly what Boomerang does

kunkel321

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 626
    • Participated in NANY Challenge Once
Re: Boomerang still not working
« Reply #4 on: August 12, 2020, 03:51 PM »
What available alternatives are there? I tried looking and I couldn't find a program that does exactly what Boomerang does

You can try this if you're comfortable with AHK:

I actually used Boomerang at work to check the validity of things that I converted to Spanish.  My theory is that if it still makes sense when it's converted back to English, then the grammar must be pretty close.  When Boomerang stopped working I found this:
https://www.autohotkey.com/boards/viewtopic.php?f=5&t=40876
You can see my correspondence with Teadrinker, who wrote the actual working parts of the code.  It's actually Java code, but I use it inside of AHK. 


Code: ( autohotkey)
#NoEnv
#SingleInstance force
;############## https://autohotkey.com/boards/viewtopic.php?f=5&t=40876

clipboard =
Send, ^c
ClipWait, 2
if ErrorLevel
{
    MsgBox, There is nothing on the clipboard to translate.  Please select some text with the mouse, then try again.
    return
} 

asEsp := GoogleTranslate(Clipboard, "en", "es")
asEng := GoogleTranslate(asEsp, "es", "en")

MsgBox, ~~~~~~~~ As Spanish ~~~~~~~~`n%asEsp%`n`n`~~~~~~~ Back to English ~~~~~~~`n%asEng%`n`n~~~~~~~~~~~~~~~~~~~~~~~~~`n[Esc] to Cancel.`n[OK] to send translation to clipboard; then paste as needed via Ctrl+v 
Clipboard := asEsp

GoogleTranslate(str, from := "auto", to := "es")  {
   static JS := GetJScripObject(), _ := JS.( GetJScript() ) := JS.("delete ActiveXObject; delete GetObject;")
   
   json := SendRequest(JS, str, to, from, proxy := "")
   oJSON := JS.("(" . json . ")")

   if !IsObject(oJSON[1])  {
      Loop % oJSON[0].length
         trans .= oJSON[0][A_Index - 1][0]
   }
   else  {
      MainTransText := oJSON[0][0][0]
      Loop % oJSON[1].length  {
         trans .= "`n+"
         obj := oJSON[1][A_Index-1][1]
         Loop % obj.length  {
            txt := obj[A_Index - 1]
            trans .= (MainTransText = txt ? "" : "`n" txt)
         }
      }
   }
   if !IsObject(oJSON[1])
      MainTransText := trans := Trim(trans, ",+`n ")
   else
      trans := MainTransText . "`n+`n" . Trim(trans, ",+`n ")

   from := oJSON[2]
   trans := Trim(trans, ",+`n ")
   Return trans
}

SendRequest(JS, str, tl, sl, proxy) {
   ComObjError(false)
   http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
   ( proxy && http.SetProxy(2, proxy) )
   http.open( "POST", "https://translate.google.com/translate_a/single?client=t&sl="
      . sl . "&tl=" . tl . "&hl=" . tl
      . "&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=3&tsel=3&pc=1&kc=2"
      . "&tk=" . JS.("tk").(str), 1 )

   http.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")
   http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
   http.send("q=" . URIEncode(str))
   http.WaitForResponse(-1)
   Return http.responsetext
}

URIEncode(str, encoding := "UTF-8")  {
   VarSetCapacity(var, StrPut(str, encoding))
   StrPut(str, &var, encoding)

   While code := NumGet(Var, A_Index - 1, "UChar")  {
      bool := (code > 0x7F || code < 0x30 || code = 0x3D)
      UrlStr .= bool ? "%" . Format("{:02X}", code) : Chr(code)
   }
   Return UrlStr
}

GetJScript()
{
   script =
   (
      var TKK = ((function() {
        var a = 561666268;
        var b = 1526272306;
        return 406398 + '.' + (a + b);
      })());

      function b(a, b) {
        for (var d = 0; d < b.length - 2; d += 3) {
            var c = b.charAt(d + 2),
                c = "a" <= c ? c.charCodeAt(0) - 87 : Number(c),
                c = "+" == b.charAt(d + 1) ? a >>> c : a << c;
            a = "+" == b.charAt(d) ? a + c & 4294967295 : a ^ c
        }
        return a
      }

      function tk(a) {
          for (var e = TKK.split("."), h = Number(e[0]) || 0, g = [], d = 0, f = 0; f < a.length; f++) {
              var c = a.charCodeAt(f);
              128 > c ? g[d++] = c : (2048 > c ? g[d++] = c >> 6 | 192 : (55296 == (c & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ?
              (c = 65536 + ((c & 1023) << 10) + (a.charCodeAt(++f) & 1023), g[d++] = c >> 18 | 240,
              g[d++] = c >> 12 & 63 | 128) : g[d++] = c >> 12 | 224, g[d++] = c >> 6 & 63 | 128), g[d++] = c & 63 | 128)
          }
          a = h;
          for (d = 0; d < g.length; d++) a += g[d], a = b(a, "+-a^+6");
          a = b(a, "+-3^+b+-f");
          a ^= Number(e[1]) || 0;
          0 > a && (a = (a & 2147483647) + 2147483648);
          a `%= 1E6;
          return a.toString() + "." + (a ^ h)
      }
   )
   Return script
}

GetJScripObject()  {
   VarSetCapacity(tmpFile, (MAX_PATH := 260) << !!A_IsUnicode, 0)
   DllCall("GetTempFileName", Str, A_Temp, Str, "AHK", UInt, 0, Str, tmpFile)
   
   FileAppend,
   (
   <component>
   <public><method name='eval'/></public>
   <script language='JScript'></script>
   </component>
   ), % tmpFile
   
   JS := ObjBindMethod( ComObjGet("script:" . tmpFile), "eval" )
   FileDelete, % tmpFile
   Return JS
}

Set it to a hotkey.  Once it's running, select some text, then use the hotkey.  It shows the text as Spanish, then converted back to English. 

Here is what it shows for the above top post.

---------------------------
Transpan.ahk
---------------------------
~~~~~~~~ As Spanish ~~~~~~~~
Mouser está cada vez va a arreglar esto? Fue un programa muy divertido y útil, pero debido a la nueva API cambia se rompió. Tengo buenos recuerdos de esta pieza de software y es un dolor de traducir de forma manual a través de un montón de idiomas.

~~~~~~~ Back to English ~~~~~~~
Mouser is ever going to fix this? It was a fun and useful program, but because of the new API changes broke. I have fond memories of this piece of software and it is a pain to translate manually through a lot of languages.

~~~~~~~~~~~~~~~~~~~~~~~~~
[Esc] to Cancel.
[OK] to send translation to clipboard; then paste as needed via Ctrl+v
---------------------------
OK 
---------------------------

Hopefully I'm not jinxing to whole darn thing by sharing, but [fingers crossed] it's worked flawlessly for 5 years! 

treefrog

  • Participant
  • Joined in 2005
  • *
  • Posts: 5
Re: Boomerang still not working
« Reply #5 on: April 15, 2021, 08:25 PM »
Is Mouser ever going to patch this? It was a really fun program and useful but due to new API changes it broke. I have fond memories of this piece of software and it's a pain to manually translate through a bunch of languages.

Translator Boomerang was an excellent utility.  I still have v1.09 from 2010 and, what a pity, it isn't working.  If it's not going to be updated then is there anything else like it?

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • Participated in NANY Challenge Four Times
    • Coding Snacks
Re: Boomerang still not working
« Reply #6 on: April 16, 2021, 11:28 AM »
I do not know yet if I should release my Replica of Boomerang.
beta.png
Thats how it look so far, begun yesterday to code it.

kunkel321

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 626
    • Participated in NANY Challenge Once
Re: Boomerang still not working
« Reply #7 on: April 16, 2021, 01:56 PM »
I do not know yet if I should release my Replica of Boomerang.
[attachment 1 not found]
Thats how it look so far, begun yesterday to code it.
Awesome! 

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • Participated in NANY Challenge Four Times
    • Coding Snacks
Re: Boomerang still not working
« Reply #8 on: April 16, 2021, 03:33 PM »
The problem will be how my app interact with translation api.
Screenshot - 16_04.png
Those are the settings within my app that control the workflow.
But users will need to make a) Windows Live ID to make b) Bing API AppID. (my app need the Bing)
Further more, users must find out on own hows a good mix of shown options. (shown are my defaults)

...translation api is free for a few calls, not endless fun except you pay (not me! do not misunderstand that point!)

I guess in the end I have more problems to reply "how-to" "dont work" "what now" "why is it slow" etc questions than it is worth publishing.

At least the app works legal, I do not harm any TOS.

BTW I do have more fun listening "text-to-speak" than to actual translate ;-)
Example: English Text with Arabic vocals, so much fun hehehe

I might make a game of that feature "Guess the text" played at random vocals  :P
« Last Edit: April 16, 2021, 03:47 PM by KodeZwerg »

Original address: https://www.donationcoder.com/forum/index.php?topic=49879.0