Auto Translator

Platform:  mIRC
Published  Nov 17, 2009
Updated  Nov 12, 2011
This is a translator for your bot that will detect when someone is not speaking your target language and attempt to translate what they said automatically.
Using this is pretty simple. Just load it and turn it on from Right Click Channel window. As soon as someone types something that isn't english the bot will react Quickly.

Example:
21:39:41 <@Administrator Compromesso al Senato: gestione privata proprietà pubblica La rete idrica è allo sfascio e ora si rischia di penalizzare i comuni virtuosi Repubblica.it: il quotidiano online con tutte le notizie in tempo reale.
21:39:42 <MyMulez> Administrator may not be speaking English!! Translation it-en Compromise to the Senate: privately owned proprietpubblica The water network in shambles and now threatens to penalize municipalities virtuous Repubblica.it: Newspapers online with all the news in real time.

Ok Pretty big update for this script.
It's no longer just for English. You can now select a target language.
I also changed it for multi-channel/multi-network configuration.

After loading, just right click the channel window and select autotrans - autotrans setup.



Echo will echo back to the channel the text originated.
.Msg will message the channel. (for bot use)
.Notice will notice the client the script is loaded to.

If you have any problems with missing characters in your translations, please review your utf8 settings before posting your problem.

Under mIRC Options - Irc - Messages. It should look like this.


If you right click the channel on the treebar and click font, the utf8 should say display and encode. It is necessary to check this for each channel you are using the translator in.


**Update**
Added:

  • Exclusions Manager & Exclusion System
  • A \\L2 Translation trigger for responding
  • A Right click Hotlink for responding using the reverse of [L1]-[L2]


The Exclusion Manager

It's a simple dialog so you can add WORDS(not phrases) to be somewhat excluded from translation.
The words are not excluded from translation, but they are excluded from the algorithm that is used to determine if a translation will be returned or not.
To add WORDS, right click the channel and select Exclusions Manager from the menu.

I'll add a Trigger system to this later.

The \\L2 Trigger
This is very simple to use, just type \\L2 where L2 is the language code for the language you want your text translated into. Your text will be translated to the window you are typing into.
Example: \\fr some words to translate here.
**Note** This is not a bot trigger. This is a On input routine and must be typed from the
client with the script loaded.

The Hotlink
This works Right clicking on this part -->> [L1]-[L2] <<-- of a language translation.
You will be prompted to decide.

And then prompted for some text.

**Note** Your text will be translated to the reverse of what you clicked.
clicking [de]-[en] , will translate your text from english to german.
**Also** This script must be loaded in the client that you are typing in for this to work. ;Auto Translator by Ford_Lawnmower irc.GeekShed.net #Script-Help
menu Channel {
.$iif($gettok($hget(autotrans,$+($network,$chan)),3,32) == On && $group(#AutoTrans) == On,$style(1)) AutoTrans
..$iif($group(#AutoTrans) == On,$style(1)) Auto Trans Master On/Off: $iif($group(#AutoTrans) == On,.disable,.enable) #AutoTrans
..Auto Trans Setup:dialog $iif($dialog(auto_translator),-v,-m) auto_translator auto_translator
..Manage Exclusions:dialog $iif($dialog(auto_translator_exclude),-v,-m) auto_translator_exclude auto_translator_exclude
}
#AutoTrans On
On *:Text:*:#: {
if (!$timer($+(AutoTrans,$network,$nick))) {
.timer $+ $+(AutoTrans,$network,$nick) 1 1 noop
if ($gettok($hget(autotrans,$+($network,$chan)),3,32) == On) && (!$regex($1,/^[!.@.#.+./.:.-.+]/S)) {
var %text $urlencode($utfdecode($utfencode($exclude($1-))))
tokenize 32 $hget(autotrans,$+($network,$chan))
AutoTrans $2 $iif($2 == .Msg,$chan,$iif($2 == Echo,$chan,$me)) $iif($4,$+(09[04,$nick,09]),0) $langpair($1),1,32)) %text 0
}
}
}
On *:Action:*:#: {
if (!$timer($+(AutoTrans,$network,$nick))) {
.timer $+ $+(AutoTrans,$network,$nick) 1 1 noop
if ($gettok($hget(autotrans,$+($network,$chan)),3,32) == On) {
var %text $urlencode($exclude($1-))
tokenize 32 $hget(autotrans,$+($network,$chan))
AutoTrans $2 $iif($2 == .Msg,$chan,$iif($2 == Echo,$chan,$me)) $iif($4,$+(09[04,$nick,09]),0) $langpair($1),1,32)) %text 0
}
}
}
#AutoTrans End
On *:input:*: {
if ($left($strip($1),2) == \\) && (!$ctrlenter) {
haltdef
var %text $inputencode($2-)
AutoTrans msg $iif($chan,$chan,$active) $me $remove($1,\\) %text 1
}
}
on ^$*:Hotlink:/\[([a-zA-Z]{2})\]-\[([a-zA-Z]{2})\]/:#,?:{
if ($mouse.key == 16) && ($input(Respond through translator $+($regml(2),-,$regml(1)),yn)) {
if ($?="Please Input your text to be translated") {
AutoTrans msg $iif($chan,$chan,$nick) $me $regml(1) $urlencode($!) 1
}
}
halt
}
alias EchoAutoTrans { AutoTrans echo -a $1- }
alias -l AutoTrans {
var %sockname $+(AutoTrans,$network,$3,$ticks,$r(1,$ticks))
sockopen %sockname translate.google.com 80
sockmark %sockname $1-2 $+(/translate_t?langpair=auto|,$4,&text=,$5) $3 $6
}
On *:sockopen:AutoTrans*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.1
sockwrite -n $sockname Host: translate.google.com
sockwrite -n $sockname Referer: $+(http://,$ip)
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:AutoTrans*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %AutoTrans | sockread &AutoTrans
%autotrans = $bvar(&autotrans,1-4000).text
if ($regex(lan,%AutoTrans,/id=headingtext\sclass="">(.*?)\sto\s(.*?)\stranslation<\/h3>/i)) noop
if ($regex(%AutoTrans,/backgroundColor='#fff'">(.*?)<\/span>/i)) {
var %country $langpair($+([,$regml(lan,1),]-[,$regml(lan,2),],)), %text $replace($fixhtml($regml(1)),quot;,")
if ($gettok($sock($sockname).mark,5,32)) { $gettok($sock($sockname).mark,1-2,32) %text | sockclose $sockname | return }
elseif ($matches(%text,$recode($mid($gettok($gettok($sock($sockname).mark,3,32),-2,38),3-)))) {
$gettok($sock($sockname).mark,1-2,32) 06Translation07 %country $&
$iif($gettok($sock($sockname).mark,4,32),$gettok($sock($sockname).mark,4,32)) %text
sockclose $sockname
return
}
}
}
}
alias -l inputencode { return $regsubex($strip($1-),/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2)) }
alias -l exclude { return $regsubex($strip($1-),/(http:\/\/[\S]{1,}|www\.[\S]{1,})/g,$null) }
alias -l urlencode { return $regsubex($1-,/([^a-z0-9])/ig,$urlpairs($asc(\t))) }
alias -l recode { return $regsubex($1-,/%([A-Fa-f0-9]{2})/g,$chr($base(\t,16,10))) }
alias -l fixhtml { return $replace($remove($regsubex($remove($regsubex($1-,/#([\d][\d][\d]?);/g,$chr(\t)),&amp;,gt;,lt;),/\\u([A-Fa-f0-9]{4})/g,$chr($base(\t,16,10))),&amp;,&),&quot;,") }
alias -l notrans { return $iif($hfind(notrans,$1),1,0) }
alias -l matches {
var %w $numtok($1,32),%x 1,%y 0,%z $numtok($2,32)
while (%x <= %z) {
if ($istok($1,$gettok($2,%x,32),32)) || ($notrans($gettok($2,%x,32))) { inc %y }
inc %x
}
return $iif($calc(%y / %w * 100) >= 80,0,1)
}
alias -l UrlPairs {
if ($1 < 255) { return $+(%,$base($1,10,16)) }
if ($1 >= 256) && ($1 < 2048) { return $+(%,$base($calc(192 + $div($1,64)),10,16),%,$base($calc(128 + $mod($1,64)),10,16)) }
if ($1 >= 2048) && ($1 < 65536) { return $+(%,$base($calc(224 + $div($1,4096)),10,16),%,$base($calc(128 + $mod($div($1,64),64)),10,16),%,$base($calc(128 + $mod($1,64)),10,16)) }
}
alias -l div { return $int($calc($1 / $2)) }
alias -l mod {
var %int $int($calc($1 / $2))
return $calc($1 - (%int * $2))
}
dialog Auto_Translator {
title "Auto Translator Setup"
size -1 -1 118 126
option dbu
text "Target Language:", 1, 4 9 45 8, right
text "Network:", 2, 4 25 45 8, right
text "Channel:", 3, 4 42 45 8, right
text "Output Type:", 4, 4 59 45 8, right
combo 5, 51 8 62 11, drop
combo 6, 51 24 62 11, drop
combo 7, 51 41 62 11, drop
combo 8, 51 58 62 11, drop
combo 9, 51 77 62 11, drop
text "Status:", 10, 4 78 45 8, right
button "Accept", 11, 78 110 34 12
button "Cancel", 12, 39 110 34 12, cancel
check "Show Nickname", 13, 63 97 50 10
}
dialog Auto_Translator_Exclude {
title "Auto Translator Exclusion Manager"
size -1 -1 144 144
option dbu
text "Exclusion:", 1, 4 7 27 8, right
text "Exclusions", 2, 1 21 142 8, center
edit "", 3, 33 6 72 10, autohs
list 4, 6 33 131 94, vsbar
button "Add", 5, 107 5 29 12
button "Delete", 6, 50 130 37 12
button "Close", 7, 97 130 37 12, cancel
}
On *:dialog:Auto_Translator_Exclude:Sclick:5,6: {
if ($did == 5) && ($did($dname,3).text) { hadd -m notrans $v1 | did -r $dname 3 }
if ($did == 6) && ($did($dname,4).seltext) { hdel notrans $v1 }
did -r $dname 4
didtok $dname 4 32 $regsubex($str(.,$hget(notrans,0).item),/./g,$hget(notrans,\n).item $+ $chr(32))
}
On *:dialog:Auto_Translator_Exclude:init:*: {
didtok $dname 4 32 $regsubex($str(.,$hget(notrans,0).item),/./g,$hget(notrans,\n).item $+ $chr(32))
}
on *:dialog:Auto_Translator:Sclick:6,7,11: {
if ($did == 11) {
tokenize 32 $did($dname,6).seltext $did($dname,7).seltext $did($dname,5).seltext $did($dname,8).seltext $did($dname,9).seltext
hadd -m autotrans $+($1,$chr(35),$2) $3- $did($dname,13).state
dialog -x $dname
}
if ($did == 6) {
did -r $dname 7
didtok $dname 7 35 $chans($did($dname,6).seltext)
did -fc $dname 7 1
}
if ($hget(autotrans,$+($did($dname,6).seltext,$chr(35),$did($dname,7).seltext))) {
var %match $v1
did -c $dname 5 $didwm($dname,5,$gettok(%match,1,32))
did -c $dname 8 $didwm($dname,8,$gettok(%match,2,32))
did -c $dname 9 $didwm($dname,9,$gettok(%match,3,32))
did $iif($gettok(%match,4,32),-c,-u) $dname 13
}
}
on *:dialog:Auto_Translator:init:*: {
didtok $dname 5 44 AFRIKAANS,ALBANIAN,AMHARIC,ARABIC,ARMENIAN,AZERBAIJANI,BASQUE,BELARUSIAN,BENGALI,BIHARI,BULGARIAN,BURMESE,CATALAN,CHEROKEE
didtok $dname 5 44 CHINESE,CHINESE_SIMPLIFIED,CHINESE_TRADITIONAL,CROATIAN,CZECH,DANISH,DHIVEHI,DUTCH,ENGLISH,ESPERANTO,ESTONIAN,FILIPINO
didtok $dname 5 44 FINNISH,FRENCH,GALICIAN,GEORGIAN,GERMAN,GREEK,GUARANI,GUJARATI,HEBREW,HINDI,HUNGARIAN,ICELANDIC,INDONESIAN,INUKTITUT
didtok $dname 5 44 IRISH,ITALIAN,JAPANESE,KANNADA,KAZAKH,KHMER,KOREAN,KURDISH,KYRGYZ,LAOTHIAN,LATVIAN,LITHUANIAN,MACEDONIAN,MALAY,MALAYALAM
didtok $dname 5 44 MALTESE,MARATHI,MONGOLIAN,NEPALI,NORWEGIAN,ORIYA,PASHTO,PERSIAN,POLISH,PORTUGUESE,PUNJABI,ROMANIAN,RUSSIAN,SANSKRIT,SERBIAN
didtok $dname 5 44 SINDHI,SINHALESE,SLOVAK,SLOVENIAN,SPANISH,SWAHILI,SWEDISH,TAJIK,TAMIL,TAGALOG,TELUGU,THAI,TIBETAN,TURKISH,UKRAINIAN
didtok $dname 5 44 URDU,UZBEK,UIGHUR,VIETNAMESE,WELSH,YIDDISH
did -c $dname 5 $didwm($dname,5,ENGLISH)
var %nets $scon(0)
while (%nets) { scon %nets did -a $dname 6 $!network | dec %nets }
did -c $dname 6 $didwm($dname,6,$network)
didtok $dname 7 35 $chans($network)
did -c $dname 7 $didwm($dname,7,$mid($active,2-))
didtok $dname 8 44 Echo,.Msg,.Notice
did -c $dname 8 1
didtok $dname 9 44 On,Off
did -c $dname 9 2
if ($hget(autotrans,$+($network,$active))) {
var %match $v1
did -c $dname 5 $didwm($dname,5,$gettok(%match,1,32))
did -c $dname 8 $didwm($dname,8,$gettok(%match,2,32))
did -c $dname 9 $didwm($dname,9,$gettok(%match,3,32))
did $iif($gettok(%match,4,32),-c,-u) $dname 13
}
}
alias -l LangPair {
var %return $replace($1-,AFRIKAANS,af,ALBANIAN,sq,AMHARIC,am,ARABIC,ar,ARMENIAN,hy,AZERBAIJANI,az,BASQUE,eu,BELARUSIAN,be,BENGALI,bn,$&
BIHARI,bh,BULGARIAN,bg,BURMESE,my,CATALAN,ca,CHEROKEE,chr,CHINESE,zh,CHINESE_SIMPLIFIED,CN,CHINESE_TRADITIONAL,TW,$&
CROATIAN,hr,CZECH,cs,DANISH,da,DHIVEHI,dv,DUTCH,nl,ENGLISH,en,ESPERANTO,eo,ESTONIAN,et,FILIPINO,tl,FINNISH,fi,FRENCH,fr,$&
GALICIAN,gl,GEORGIAN,ka,GERMAN,de,GREEK,el,GUARANI,gn,GUJARATI,gu,HEBREW,iw,HINDI,hi,HUNGARIAN,hu,ICELANDIC,is,$&
INDONESIAN,id,INUKTITUT,iu,IRISH,ga,ITALIAN,it,JAPANESE,ja,KANNADA,kn,KAZAKH,kk,KHMER,km,KOREAN,ko,KURDISH,ku,KYRGYZ,ky)
return $replace(%return,LAOTHIAN,lo,LATVIAN,lv,LITHUANIAN,lt,MACEDONIAN,mk,MALAY,ms,MALAYALAM,ml,MALTESE,mt,MARATHI,mr,MONGOLIAN,mn,NEPALI,ne,$&
NORWEGIAN,no,ORIYA,or,PASHTO,ps,PERSIAN,fa,POLISH,pl,PORTUGUESE,pt,PUNJABI,pa,ROMANIAN,ro,RUSSIAN,ru,SANSKRIT,sa,$&
SERBIAN,sr,SINDHI,sd,SINHALESE,si,SLOVAK,sk,SLOVENIAN,sl,SPANISH,es,SWAHILI,sw,SWEDISH,sv,TAJIK,tg,TAMIL,ta,TAGALOG,tl,$&
TELUGU,te,THAI,th,TIBETAN,bo,TURKISH,tr,UKRAINIAN,uk,URDU,ur,UZBEK,uz,UIGHUR,ug,VIETNAMESE,vi,WELSH,cy,YIDDISH,yi)
}
alias -l chans { scon $netid($1) return $!regsubex($str(.,$chan(0)),/./g,$chan(\n)) }
alias -l netid {
var %netcount $scon(0)
while %netcount {
if ($scon(%netcount).network == $1) { return %netcount }
dec %netcount
}
}
On *:Start:{
hmake AutoTrans 5
hmake NoTrans 5
if ($exists(AutoTrans.hsh)) { hload AutoTrans AutoTrans.hsh }
if ($exists(NoTrans.hsh)) { hload NoTrans NoTrans.hsh }
}
On *:Disconnect:{
if ($hget(AutoTrans)) { hsave AutoTrans AutoTrans.hsh }
if ($hget(NoTrans)) { hsave NoTrans NoTrans.hsh }
}
On *:Exit:{
if ($hget(AutoTrans)) {
hsave AutoTrans AutoTrans.hsh
hfree AutoTrans
}
if ($hget(NoTrans)) {
hsave NoTrans NoTrans.hsh
hfree NoTrans
}
}
On *:Unload:{ hfree AutoTrans | hfree NoTrans }

Comments

Sign in to comment.
Bri1977   -  Nov 24, 2012
 Respond  
Bri1977   -  Nov 24, 2012
ok, i replaced the detectlanguage version with the test edit version and neither seem to be working fully, every now and again i will get a translation come up, but a lot of the time i get absolutely nothing, i really hope you can sort something out, my guess would be some change on googles end, i will have to give the debug version a test run and see what happens
 Respond  
Bri1977   -  Nov 22, 2012
@FordLawnmower im having issues with the detectlanguage version of the script, the other edit version you did works fine tho, i was using 7 different keys with the detectlanguage, which seemed to be just enough to keep the script ticking over, ive only noticed it not working today, but according to the usage stats, its not been getting hits for 2 days, i tried resetting my keys, but its still not working, so i might have to switch to the other edit, but i prefer the detectlanguage version, it gives better results
 Respond  
chicken-   -  Oct 30, 2012
Working ok for me, couple of issues with it going off when it shouldn't. I'm an admin for some pickup game channels for Unreal Tournament, it is triggered by the pickup bot listing the player names, and so far "haha" goes off every time.

I'm no coder or scripter, but to me it seems like the easiest way to fix a lot of these is to not return the text when it doesn't actually translate at least 2-3 words out of the whole line. It's just returning the exact text it "translated" so it should detect that the words were unchanged and not send it as a translation.

A way to ignore certain nicknames would help too so I could ignore the pickup bots.

07:11:23 <@L> [» CTF-ProMod «][» [4/10] «][» 1) Kappa 2) z0rf 3) Slayer 4) mintek «]
Translation []-[] [»CTF ProMod«] [»[4/10]«] [»1) Coat 2) z0rf 3) Slayer 4) MINTEK«]

07:20:08 <+NecroNinja> no nhl
Translation []-[] no nhl

07:11:59 <+mintek> haha
Translation []-[] haha
 Respond  
Dr.MonaLisa   -  Aug 02, 2012
I've installed the latest version of script (http://pastebin.com/JDpYVQQN) But it's still not working for me. It just don't translate any text... I'm using mIRC 7.22
Is it a script issue, or I do something wrong?
 Respond  
Bri1977   -  Jul 26, 2012
looks better, the first edit had no issues on 6.31, none that i could see anyway, so i will update my bot to 6.31 later
 Respond  
FordLawnmower   -  Jul 26, 2012
Fixed and updated a bit : http://pastebin.com/JDpYVQQN
 Respond  
Bri1977   -  Jul 26, 2012
* /if: invalid format (line 73, AutoTranslateTest.mrc)
-#-#-
* /if: invalid format (line 73, AutoTranslateTest.mrc)

lol ^^ 6.21
 Respond  
FordLawnmower   -  Jul 26, 2012
Most of that looks like the responses are identical to the original.
This edit will suppress them: http://pastebin.com/JDpYVQQN
 Respond  
Bri1977   -  Jul 26, 2012
the latest version seems too sensitive...

[11:03:35] <Mac|away> hi Bri
[11:03:37] <DonCow> Translation [pl]-[en] [Mac|away] Hi Bri
[11:03:44] <Bri_Away> hi
[11:03:46] <DonCow> Translation [pl]-[en] [Bri_Away] hi

[10:36:05] <Phosphorus> ISP: Paul Bunyan Telephone.
[10:36:06] <DonCow> Translation [id]-[en] [Phosphorus] ISP: Paul Bunyan Telephone.
[10:36:06] <Phosphorus> Domain: paulbunyan.net
[10:36:08] <Phosphorus> ZIP Code: 56601
[10:36:09] <DonCow> Translation [it]-[en] [Phosphorus] ZIP Code: 56601

[10:18:10] <Macros> lol
[10:18:11] <DonCow> Translation [nl]-[en] [Macros] lol

[10:17:02] <keops> hi mac
[10:17:03] <DonCow> Translation [pl]-[en] [keops] hi mac
[10:17:19] <Macros> ok hun ?
[10:17:20] <DonCow> Translation [pl]-[en] [Macros] ok hun?
 Respond  
Bri1977   -  Jul 25, 2012
that one works :p except for it not translating yah anymore lol so its win-win i hope lol will check it on a more upto date mIRC 2moro, when my key stops working :p
 Respond  
FordLawnmower   -  Jul 25, 2012
Yea, the 6.21 is a problem because it has a very small variable limit. I would use at least 6.35 for testing any current scripts.
Anyway, I edited it to use a smaller variable size: http://pastebin.com/JDpYVQQN
 Respond  
Bri1977   -  Jul 25, 2012
I unloaded the one from earlier today, its mIRC 6.21, i havn't loaded it onto my main mIRC(7.22) yet, cos im using another key on that one lol
 Respond  
FordLawnmower   -  Jul 25, 2012
Strange it's working fine for me.
What is your mIRC version ?
Did you unload all other versions of this script ?
 Respond  
Bri1977   -  Jul 25, 2012
nope, still the same, im testing 'yah' cos it thinks its indonesian and its giving 4 lines in status
 Respond  
FordLawnmower   -  Jul 25, 2012
Hmm, that's pretty odd, but I did just edit the pastebin. Try it now http://pastebin.com/JDpYVQQN
 Respond  
Bri1977   -  Jul 25, 2012
I tried 2 translations and got this in status...
[02:52:07am] Ping? Pong!
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
[02:54:45am] Ping? Pong!
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
-#-#-
* Line too long: $bvar (line 247, AutoTranslateTest.mrc)
 Respond  
FordLawnmower   -  Jul 25, 2012
That sucks ;/
I just got in from work and put this together quickly but you are welcome to try it.
http://pastebin.com/JDpYVQQN
I won't get around to testing it for a few days so please let me know how it works.
 Respond  
Bri1977   -  Jul 25, 2012
roughly 10 hours after setting up my account...

Hello!

Your access to detectlanguage.com API is temporary suspended because usage exceeded current "Free" plan limits.

You can track your usage statistics and upgrade your plan here:

http://detectlanguage.com/private

Best regards,
detectlanguage.com team
 Respond  
amclay   -  Jul 25, 2012
Took me about 40 minutes till the "Warning: detectlanguage.com API access temporary suspended" email :(
 Respond  
Bri1977   -  Jul 25, 2012
seems to be working ok so far, but not sure how long the 5,000 requests a day will last me lol after 7hrs of usage, im already hitting 3,500 requests
 Respond  
amclay   -  Jul 25, 2012
It's working, I seem to be averaging 175 to 200 requests per minute, so that limit is pretty low :/
 Respond  
FordLawnmower   -  Jul 24, 2012
Okay , after looking in to this a bit , they are basing this on MY api key. As a result everyone using this script is counted on my limit. So.. Try this: Goto http://detectlanguage.com/ and sign up for a free key.
Take the new key and edit this version of the script: http://pastebin.com/c6JG5q4p
Edit line 238:

Code

 

To

Code

 


Please let me know how this works out.
 Respond  
FordLawnmower   -  Jul 24, 2012
Nah, the language detection api added a limit ;/

Quote

{"error":{"code":3,"message":"Your access is temporary suspended because usage exceeded current plan limits. You can track your usage statistics and upgrade your plan at http://detectlanguage.com/private"}}


I'll start searching around and see if I can find a different one to use.
 Respond  
Bri1977   -  Jul 24, 2012
@FordLawnmower I think the script is broken/google changed page layout, heres a lil chunk of the debug script output....

[23:51:24] <[MrsTrout]> bonjour mon ami Bri_Away :))
[23:51:24] HTTP/1.1 200 OK
[23:51:24] Date: Tue, 24 Jul 2012 22:51:24 GMT
[23:51:24] Expires: Fri, 01 Jan 1990 00:00:00 GMT
[23:51:24] Cache-Control: no-cache, must-revalidate
[23:51:24] Pragma: no-cache
[23:51:24] X-Frame-Options: SAMEORIGIN
[23:51:24] Content-Type: text/html; charset=ISO-8859-1
[23:51:25] Content-Language: en
[23:51:25] Set-Cookie: PREF=ID=505ccdfe1474ead3:TM=1343170284:LM=1343170284:S=Wd3TpaiRHbpWImTa; expires=Thu, 24-Jul-2014 22:51:24 GMT; path=/; domain=.google.com
[23:51:25] Set-Cookie: NID=62=secrtcYCmXCtZhYiDx6nz01_I0bB4NfM0JmCvC2aB2wRcE1zy-RczPAZwf2lTGiMzLKViEStrAMdWPZe6zxRPLqaBMYQACDZ3taD54bxjpNm8aADFC2f-4JejoNSW7s1; expires=Wed, 23-Jan-2013 22:51:24 GMT; path=/; domain=.google.com; HttpOnly
[23:51:25] P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
[23:51:25] X-Content-Type-Options: nosniff
[23:51:25] Server: HTTP server (unknown)
[23:51:25] X-XSS-Protection: 1; mode=block
[23:51:25] Transfer-Encoding: chunked
[23:51:25] 1000
[23:51:25] <!DOCTYPE html><html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><meta name=keywords content="translate, translations, translation, translator, machine translation, online translation"><meta name=description content="Google&#39;s free online language translation service instantly translates text and web pages. This translator supports: English, Afrikaans, Albanian, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Kannada, Korean, Latin, Latvian, Lithuanian, Macedonian, Malay, Maltese, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese, Welsh, Yiddish"><meta name=robots content=noodp><meta name=google content=notranslate><link rel="canonical" href="http://translate.google.com/?q=bonjour+mon+ami+Bri_Away+:))"><title>Google Translate</title><link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml?hl=en" title="Google Translate"><script>function _gtErr(e){var i=new Image();i.src='/gen204?jserr='+encodeURIComponent(e+": "+e.stack).substr(0,2000);i.onload=function(){i.onload=null;};}window.onerror=_gtErr;</script><script>(function(){var ti_a=function(b){this.t={};this.tick=function(b,c,a){a=void 0!=a?a:(new Date).getTime();this.t[b]=[a,c]};this.tick("start",null,b)},ti_b=new ti_a;window.jstiming={Timer:ti_a,load:ti_b};if(window.performance&&window.performance.timing){var ti_c=window.performance.timing,ti_d=window.jstiming.load,ti_e=ti_c.navigationStart,ti_f=ti_c.responseStart;0<ti_e&&ti_f>=ti_e&&(ti_d.tick("_wtsrt",void 0,ti_e),ti_d.tick("wtsrt_","_wtsrt",ti_f))}
[23:51:25] try{var ti_=null;window.chrome&&window.chrome.csi&&(ti_=Math.floor(window.chrome.csi().pageT));null==ti_&&window.gtbExternal&&(ti_=window.gtbExternal.pageT());null==ti_&&window.external&&(ti_=window.external.pageT);ti_&&(window.jstiming.pt=ti_)}catch(ti_g){};})()
[23:51:25] </script><link rel=stylesheet href="/translate/static/7JyLYZcZfKM/css/desktop_ltr.css"><style>#clir {margin-top: 18px;text-align: left;}#middle_body {margin-left: 10em;border-left: 1px solid #c9d7f1;padding-left: 1.4em;zoom: 1;;}</style><style>#gb{font:13px/27px Arial,sans-serif;height:30px}#gbz,#gbg{position:absolute;white-space:nowrap;top:0;height:30px;z-index:1000}#gbz{left:0;padding-left:4px}#gbg{right:0;padding-right:5px}#gbs{background:transparent;position:absolute;top:-999px;visibility:hidden;z-index:998}.gbto #gbs{background:#fff}#gbx3,#gbx4{background-color:#2d2d2d;background-image:none;_background-image:none;background-position:0 -138px;background-repeat:repeat-x;border-bottom:1px solid #000;font-size:24px;height:29px;_height:30px;opacity:1;filter:alpha(opacity=100);position:absolute;top:0;width:100%;z-index:990}#gbx3{left:0}#gbx4{right:0}#gbb{position:relative}#gbbw{right:0;left:0;position:absolute;top:30px;width:100%}.gbtcb{position:absolute;visibility:hidden}#gbz .gbtcb{right:0}#gbg .gbtcb{left:0}.gbxx{display:none !important}.gbxo{opacity:0 !important;filter:alpha(opacity=0) !important}.gbm{position:absolute;z-index:999;top:-999px;visibility:hidden;text-align:left;border:1px solid #bebebe;background:#fff;-moz-box-shadow:-1px 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2)}.gbrtl .gbm{-moz-box-shadow:1px 1px 1px rgba(0,0,0,.2)}.gbto .gbm,.gbto #gbs{top:29px;visibility:visible}#gbz .gbm,#gbz #gbs{left:0}#gbg .gbm,#gbg #gbs{right:0}.gbxms{background-color:#ccc;display:block;position:absolute;z-index:1;top:-1px;left:-2px;right:-2px;bottom:-2px;opacity:.4;-moz-border-radius:3px;filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=5);*opacity:1;*top:-2px;*left:-5px;*right:5px;*bottom:4px;-ms-filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";opacity:1\0/;top:-4px\0/;left:-6px\0/;right:5px\0/;bottom:
[23:51:25] 1000
 Respond  
Bri1977   -  Jul 17, 2012
greek is tricky to get translated, if its written in greek font its fine, but when you get greek written in standard ascii, it needs double translation, but i think a way to set a default language to translate from per channel would be good and also an exception language to never translate from, with the default for translating from being auto-detect, including PM translations would also be good and something like if source = translation add source/translation to exceptions list, cos sometimes it still translates English into English
 Respond  
gicon   -  Jul 17, 2012
is there anyway to force what language it's being translated from? I have a greek server I run .. and don't speak a lick of greek.. however the translater thinks what they are saying is everything from italian, french, eu, and many others. only once in a blue moon does it realize it's actually the greek language.
 Respond  
amclay   -  Jun 01, 2012
That helped, it now shows the languages being translated. I made a quick workaround using

Code

 
It isn't the best, but it *works*. I may try to work something in like using if the confidence interval in between a set range, to check for exclusions, and then determine to run based off those two factors.
 Respond  
FordLawnmower   -  May 30, 2012
@amclay Please get the code from here: http://pastebin.com/c6JG5q4p
This script is in the process of being edited due to changes in googles api.
The exception portion of the script does not work at this time, but I will rewrite it when I find some time.
Languages will show with the code from my pastebin.
While you may find the use of variables easier to edit, setting a variable for each channel would make your vars list really messy.

To see the settings for a channel type this in the channel editbox:

Code

 

To edit or add settings for a channel type this in the channel editbox:

Code

 


Keep in mind that $network and $chan will be converted based on where you are typing and the settings I used in the example are generic. You could alternately use "NetworkName#ChannelName" where I have $+($network,$chan)

For more information on the code in the pastebin, please read about the last 10 comments. The discussions above are about the updated code.
 Respond  
amclay   -  May 30, 2012
This code. Is. Amazing. Seriously, it is the most helpful code I've seen so far, and you put a lot of time into it. That being said...

1) none of the exceptions I've added seem to work ("haha" still triggers on that exact text).
2) It doesn't add in the language codes (just returns []-[])
3) Setup would be easier if done with variables and not a hashtable. I want to be able to copy paste my channel list somewhere, not go to each one and click a bunch.

Still, VERY impressive code, and I'm just nitpicking (and hoping for the fix!) :)

Thanks a TON
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.