SRL Archive - Research & Development Lounge

SCAR Babelfish Translator!


Sandstorm

2009-03-05 23:35:26

Bonjour, c'est mon traducteur de Babelfish ! Il n'est pas parfait, en raison de Babelfish ne pouvant pas fournir des traductions parfaitement précises !

Hallo, ist dieses mein Babelfish Übersetzer! Es ist nicht vollkommen, wegen Babelfish, das nicht in der Lage ist, tadellos genaue Übersetzungen zur Verfügung zu stellen!

Ciao, questo è il mio traduttore di Babelfish! Non è perfetto, dovuto Babelfish che non può da fornire le traduzioni perfettamente esatte!

¡Hola, éste es mi traductor de Babelfish! ¡No es perfecto, debido a Babelfish que no puede proporcionar traducciones perfectamente exactas!

Olá!, este é meu tradutor de Babelfish! Não é perfeito, devido a Babelfish que não pode fornecer traduções perfeitamente exatas!

Hello, is dit mijn vertaler Babelfish! Het is niet perfect, wegens Babelfish kunnend volkomen geen nauwkeurige vertalingen verstrekken!

This basically rips the translation off Babelfish :P. The wording, spelling, and output is not 100% perfect, as Babelfish cannot provide a perfect translation yet.

Suggestions for use:

Do NOT use contractions. They will return &#039, and will not work properly!

Credits:

Bullzeye95, for getting me the link I needed (to get the correct translations).
Senrath, for explaining how to use the variables.

Currently only supports English to other languages, but I will be adding more as I find time to do it (so probably as many as Babelfish can give out tonight xD).

program New;

var
EndItemForm : Boolean;
ItemIdform : TForm;
ComboBox1 : TComboBox;
GroupBox1, GroupBox2 : TGroupBox;
Edit2, Edit1 : TMemo;
Button1 : TButton;

procedure ItemFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if (not(ItemIdform.ModalResult = 1)) then
EndItemForm := True;
end;

Procedure Translate(Sender : TObject);
Var
C, H : String;
Begin
Case ComboBox1.text Of
'English to Chinese simplified' : C := 'en_zh';
'English to French' : C := 'en_fr';
'English to German' : C := 'en_de';
'English to Greek' : C := 'en_el';
'English to Dutch' : C := 'en_nl';
'English to Italian' : C := 'en_it';
'English to Japanese' : C := 'en_ja';
'English to Korean' : C := 'en_ko';
'English to Portuguese' : C := 'en_pt';
'English to Russian' : C := 'en_ru';
'English to Spanish' : C := 'en_es';
End;
H := Replace(Edit1.Text, ' ', '%20');
If C <> '' Then
Edit2.Text := Between('6em;">', '</div>', GetPage('http://babelfish.yahoo.com/translate_txt?ei=UTF-8&doit=done&fr=bf-home&intl=1&tt=urltext&trtext=' + H + '&lp=' + C + '&btnTrTxt=Translate'))
Else
Edit2.Text := 'Please choose a valid language to translate from and to!';
End;

procedure ItemForm;
var
TimeItemForm : Integer;
begin
TimeItemForm := GetSystemTime;
ItemIdform := CreateForm;
with ItemIdform do
begin
OnClose := @ItemFormOnClose;
Position := poScreenCenter;
BorderIcons := [biMinimize,biSystemMenu];
ClientWidth := 435;
ClientHeight := 215;
Caption := 'frmDesign';
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
end;
ComboBox1 := TComboBox.Create(ItemIdform);
with ComboBox1 do
begin
Parent := ItemIdform;
Left := 8;
Top := 9;
Width := 305;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Choose a to/from translation language!';
With ComboBox1.items Do
Begin
Add('English to Chinese simplified');
Add('English to Dutch');
Add('English to French');
Add('English to German');
Add('English to Greek');
Add('English to Italian');
Add('English to Japanese');
Add('English to Korean');
Add('English to Portuguese');
Add('English to Russian');
Add('English to Spanish');
End;
end;
Edit1 := TMemo.Create(GroupBox1);
with Edit1 do
begin
Parent := ItemIdform;
Left := 8;
Top := 35;
Width := 201;
Height := 169;
TabOrder := 0;
Text := 'Type the text to be translated';
end;
Edit2 := TMemo.Create(GroupBox2);
with Edit2 do
begin
Parent := ItemIdform;
Left := 225;
Top := 35;
Width := 201;
Height := 169;
TabOrder := 0;
Text := 'Translated text is here!';
end;
Button1 := TButton.Create(ItemIdform);
with Button1 do
begin
Parent := ItemIdform;
Left := 320;
Top := 8;
Width := 75;
Height := 25;
Caption := 'Translate!';
TabOrder := 3;
OnClick := @Translate;
end;
WriteLn('ItemForm compiled in ' + IntToStr(GetSystemTime - TimeItemForm) + ' milliseconds!');
end;

procedure SafeItemForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ItemForm', V);
end;

procedure ShowItemFormModal;
begin
ItemIdform.ShowModal;
end;

procedure SafeShowItemFormModal;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowItemFormModal', V);
end;

procedure MainItemForm;
begin
try
SafeItemForm;
SafeShowItemFormModal;
finally
FreeForm(ItemIdform);
except
WriteLn('An error seems to have occurred in: ItemForm');
end;
end;

begin
ClearDebug;
MainItemForm;
if (EndItemForm) then
TerminateScript;
end.

~Sandstorm

senrath

2009-03-05 23:49:41

Okiday, the Japanese, Chinese, Korean, Greek and Russian options don't work, and I'm not sure if you'll be able to fix them or not. They don't use the standard character set.

Sandstorm

2009-03-05 23:51:29

Yea, I don't think I can do anything about those :/. I'll try though.

~Sandstorm

Hobbit

2009-03-05 23:57:33

First off… Babelfish fails

The french grammar is horrible.

Any online translator is horrible.

But I like the functions and code, Good work :)

Sandstorm

2009-03-06 00:01:40

Thanks. If you can point me to a better one that I can actually get the answers from (I couldn't find the code for it in the page source of google translator, and I assume it's not the only one like that), I'll be happy to modify it to use that.

I agree though, all online translators fail.

~Sandstorm

Dan Cardin

2009-03-06 07:04:50

to spanish seems to not translate anything for me

jakeyboy29

2009-03-06 07:31:14

ik houd van mensen.

Sandstorm

2009-03-06 10:23:12

From: Can Dardin
to spanish seems to not translate anything for me


Eso es impar. Trabaja muy bien para mí.

Jakeyboy, what?

~Sandstorm

jakeyboy29

2009-03-06 10:24:59

acording to your script, its 'i love men'

Sandstorm

2009-03-06 10:26:44

Rofl. Nice I guess?

~Sandstorm

Smarter Child

2009-03-07 11:35:01

The code is great! Though, translators usually suck.

GJ!

wanna rep+?

Sandstorm

2009-03-07 11:39:21

I don't need it, no. If you feel you have to though, go ahead.

Thanks for the compliment on the code. Unfortunately, there's nothing I can do about the translators :/.

~Sandstorm

ShowerThoughts

2009-03-07 11:56:41

From: jakeyboy29
ik houd van mensen.


orly? I don't

hartford10

2010-08-06 13:02:05

I agree to that many different languages have problem with their pronunciation, character set,grammer etc. It is really trouble to the users while translating them.

CX gamer

2010-08-11 09:44:48

I will re-translate dutch to give you an idea how bad it is;

Hello, is dit mijn vertaler Babelfish! Het is niet perfect, wegens Babelfish kunnend volkomen geen nauwkeurige vertalingen verstrekken!
'Hello', is my translator Babelfish! It is not perfect, because of Babelfish being able to fully not accurate translations getting hold of.


French is not that bad, but german is waaay off too.

Nice little project, but not very usefull in my eyes.

kayleemiller

2010-08-27 00:10:46

I have read the information which you have mentioned here. And I am really very glad after hearing this news. I was totally unknown from this. And came to know after reading your this post.

Rich

2010-08-27 06:40:57

^ Erm…what?

CX gamer

2010-08-30 06:58:05

A typical spambot.. Here is what to look for;
  • Low postcount
  • No avatar
  • A link in either the post, sig, or website (they can go REALLY far with this)
  • The post is usually pretty universal so it suits a lot of threads

Rich

2010-08-30 07:10:13

I suppose so. His other posts seem fairly robotic as well.

Shuttleu

2010-08-30 07:31:15

if this acctually still works
    'English to Chinese simplified' : C := 'en_zh';
'English to Chinese traditional' : C := 'en_zt';
'English to Dutch' : C := 'en_nl';
'English to French' : C := 'en_fr';
'English to German' : C := 'en_de';
'English to Greek' : C := 'en_el';
'English to Italian' : C := 'en_it';
'English to Japanese' : C := 'en_ja';
'English to Korean' : C := 'en_ko';
'English to Portuguese' : C := 'en_pt';
'English to Russian' : C := 'en_ru';
'English to Spanish' : C := 'en_es';
'Chinese simplified to English' : C := 'zh_en';
'Chinese simplified to Chinese traditional' : C := 'zh_zt';
'Chinese traditional to English' : C := 'zt_en';
'Chinese traditional to Chinese simplified' : C := 'zt_zh';
'Dutch to English' : C := 'nl_en';
'Dutch to French' : C := 'nl_fr';
'French to Dutch' : C := 'fr_nl';
'French to English' : C := 'fr_en';
'French to German' : C := 'fr_de';
'French to Greek' : C := 'fr_el';
'French to Italian' : C := 'fr_it';
'French to Portuguese' : C := 'fr_pt';
'French to Spanish' : C := 'fr_es';
'German to English' : C := 'de_en';
'German to French' : C := 'de_fr';
'Greek to French' : C := 'el_fr';
'Greek to English' : C := 'el_en';
'Italian to English' : C := 'it_en';
'Italian to French' : C := 'it_fr';
'Japanese to English' : C := 'ja_en';
'Korean to English' : C := 'ko_en';
'Portuguese to English' : C := 'pt_en';
'Portuguese to French' : C := 'pt_fr';
'Russian to English' : C := 'ru_en';
'Spanish to English' : C := 'es_en';
'Spanish to French' : C := 'es_fr';




Add('English to Chinese simplified');
Add('English to Chinese traditional');
Add('English to Dutch');
Add('English to French');
Add('English to German');
Add('English to Greek');
Add('English to Italian');
Add('English to Japanese');
Add('English to Korean');
Add('English to Portuguese');
Add('English to Russian');
Add('English to Spanish');
Add('Chinese simplified to English');
Add('Chinese simplified to Chinese traditional');
Add('Chinese traditional to English');
Add('Chinese traditional to Chinese simplified');
Add('Dutch to English');
Add('Dutch to French');
Add('French to Dutch');
Add('French to English');
Add('French to German');
Add('French to Greek');
Add('French to Italian');
Add('French to Portuguese');
Add('French to Spanish');
Add('German to English');
Add('German to French');
Add('Greek to French');
Add('Greek to English');
Add('Italian to English');
Add('Italian to French');
Add('Japanese to English');
Add('Korean to English');
Add('Portuguese to English');
Add('Portuguese to French');
Add('Russian to English');
Add('Spanish to English');
Add('Spanish to French');
if it doesnt then owell :o

~shut

WT-Fakawi

2010-08-30 07:50:56

From: kayleemiller
I have read the information which you have mentioned here. And I am really very glad after hearing this news. I was totally unknown from this. And came to know after reading your this post.


Lets ban him. Last thing we want here are "intelligent" spambots, gha!

CX gamer

2010-09-03 08:20:03

I have admin'd a forum for a few years, a typical spambot never even tries to login a second time. Here is what you can do;
  • More moderators, so faster removal
  • Harder capcha, we are experienced in image-analising ourselves, so we should know it's crackable
  • Adding a simple math question to the register, so it would break the standard layout
  • Ban millions and millions of IP's from online IP lists of spambots
  • Prevent people with a postcount lower than 5 to post links
Even with all of this, spambots will remain an issue, as some indians make it their job to register at forums.