Computers Automatic Translation Bookmarklet

Discussion in 'Computers' started by MamiyaOtaru, Jul 2, 2001.

  1. MamiyaOtaru

    MamiyaOtaru President Bushman

    Joined:
    Feb 14, 2001
    Messages:
    2,372
    Likes Received:
    36
    Ok, here is my latest Javascript amalgamation. If you have the Opera browser, you can add a command button to use it, otherwise, make a bookmark out of it. Make a new bookmark, name it something meaningful like MOs Translation script, and paste the crud below into the address field.

    javascript:void(tld=window.location.hostname.substr(window.location.hostname.lastIndexOf(".")+1,7));if(tld == "ru"){q=location.href;if(q)location.href='http://babelfish.altavista.com/raging/translate.dyn?lin=ru&lout=en&translate_me=yes';}else{q=location.href;if(q)location.href='http://tran slate.google.com/translate_c?hl=en&u='+escape(q);}

    Then, when you are on a foreign language page, click that bookmark, and it will translate the page to english.

    It originally was one I copied off the net that sent you to babelfish, where you had to select the language. Then I found and copied one that used google's translation. Google automatically detects the language, so all was good, until I found it doesn't translate Russian, like babelfish does.

    So, I combined the two scripts, and added stuff. Now, it checks to see if it is a .ru domain. If so, it sends you to babelfish, telling it the language is russian, so all remains automatic. Otherwise, it goes to google, likewise automatic. Hurrah. (note, this would be a problem if you were on a say, Korean, language page hosted on a .ru server. Oh well. In that case, go use babelfish and manually enter the language)

    Japanese translation is hilarious. Try http://pillows.gr.jp what a riot.
    -----------------
    the bookmarklet of hugeness

    [This message has been edited by MamiyaOtaru (edited 07-06-2001).]
     
    #1
  2. JimiSpandex

    JimiSpandex New Member

    Joined:
    Feb 8, 2001
    Messages:
    48
    Likes Received:
    0
    cool, you rock
    That'll come in handy
     
    #2
  3. MamiyaOtaru

    MamiyaOtaru President Bushman

    Joined:
    Feb 14, 2001
    Messages:
    2,372
    Likes Received:
    36
    ah crap.. I just noticed that the script isn't presesnted right in my last post.. so, it is updated now, and should be correct. Anyone who tried it and found it didn't work, of course it didn't. sorry. It has been corrected, lemme know if it really is please

    [This message has been edited by MamiyaOtaru (edited 07-06-2001).]
     
    #3

Share This Page