DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   Favorites   Watched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help me!

 
   Reply to topic       DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
hongthu
Member


Joined: 28 Apr 2005
Posts: 4

PostPosted: 28/04/05 12:57    Post subject: Help me! Reply with quote

Have You source code of delphi for The change one langue to second langue program (ex: change english to france). Help me! Thanks.
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 90
Location: Belgium, Antwerp

PostPosted: 28/04/05 14:01    Post subject: Reply with quote

Hi,

Try searching the Delphi help for:
"Internationalizing applications".

That explains exactly how to accomplish this.

Stefan
Back to top
View user's profile Send e-mail
hongthu
Member


Joined: 28 Apr 2005
Posts: 4

PostPosted: 28/04/05 16:17    Post subject: Thank Stefan Reply with quote

Thanks!
I'm Vietnamese and speak English not good so I hope You show it to me! if I was wrong.
Stefan dear! I want to write program change text (The document type *.txt, *.doc, ex English to French) for Delphi. Can You show source code for me!
Back to top
View user's profile
Radagast
Member


Joined: 01 May 2005
Posts: 17
Location: Poland

PostPosted: 01/05/05 21:40    Post subject: Reply with quote

You mean you want to write context translator? I think it's not easy. My idea is:
1. Build database of all words with part of speach specificated.
2. Try to write all possible sentence constructions (I think in English it's quite possible, but I don't know how it is in French or Vietnamese).
3. Write a parser that will recognize sentence construction, find apropriate construction in the other languge, and then translate all the words.
It's easier to say than do, so I can only wish you good luck.
PS. I saw program translating from English to Polish and it was very poor (didn't see the difference beetwen spending time and spending money Smile )
Back to top
View user's profile Visit poster's website
hongthu
Member


Joined: 28 Apr 2005
Posts: 4

PostPosted: 07/05/05 10:59    Post subject: Thank you! Reply with quote

Thank you about your counsel for me! The truth was very difficult but i'm trying, when have good result I will an inform to you. Thank you very much.
Back to top
View user's profile
Radagast
Member


Joined: 01 May 2005
Posts: 17
Location: Poland

PostPosted: 07/05/05 11:21    Post subject: Reply with quote

You're welcome. I'd like to know whether my idea was right. I think you could post your problems here, so we would learn something new.
As your project is quite ambitious I wish you good luck and look forward to some news.
Back to top
View user's profile Visit poster's website
hongthu
Member


Joined: 28 Apr 2005
Posts: 4

PostPosted: 13/05/05 06:38    Post subject: Help me! Reply with quote

Can you help me!
I have source code for Visual Basic as following:
====================================
Dim vn_words(1 To 1000)
Dim en_words(1 To 1000)
Dim dotime As String
Dim strings As String
Dim check_verbs As Integer
Dim check_pharses As Integer
Dim englishwo, vietnamwo
---------------------------------------------------------------
Private Sub Form_Load()
Form1.Show
t_1.Enabled = False
t_2.Enabled = True
listwords = 1

Open (App.Path & "\pharses.txt") For Input As #1
Do While Not EOF(1)
Input #1, englishwo, vietnamwo
en_words(listwords) = englishwo
vn_words(listwords) = vietnamwo
listwords = listwords + 1
Loop
Close #1
check_pharses = listwords

Open (App.Path & "\verbs.txt") For Input As #1
Do While Not EOF(1)
Input #1, englishwo, vietnamwo
en_words(listwords) = englishwo
vn_words(listwords) = vietnamwo
listwords = listwords + 1
Loop
Close #1
check_verbs = listwords - check_pharses

Open (App.Path & "\words.txt") For Input As #1
Do While Not EOF(1)
Input #1, englishwo, vietnamwo
en_words(listwords) = englishwo
vn_words(listwords) = vietnamwo
listwords = listwords + 1
Loop
Close #1

End Sub

---------------------------------------------------------------------
Private Sub t_1_Timer()
If txtvietnam.Text = "" Then Exit Sub
If dotime = txtvietnam.Text Then Exit Sub
txtenglish.Text = ""
whereareweat = 1
dotime = txtvietnam.Text
strings = txtvietnam.Text
For i = 1 To 13
strings = Replace(strings, vn_words(i), en_words(i) & " ")
Next i
For i = 1 To 1000
strings = Replace(strings, vn_words(i), en_words(i) & " ")
Next i
txtvietnam.Text = strings
End Sub
---------------------------------------------------------------
Private Sub t_2_Timer()
If txtenglish.Text = "" Then Exit Sub
If dotime = txtenglish.Text Then Exit Sub
txtvietnam.Text = ""
whereareweat = 1
dotime = txtenglish.Text
strings = txtenglish.Text
For i = 1 To check_pharses
strings = Replace(strings, vn_words(i), en_words(i) & " ")
Next i
For i = check_pharses To check_verbs
strings = Replace(strings, vn_words(i), en_words(i) & " ")
Next i
For i = 1 To 1000
strings = Replace(strings, en_words(i), vn_words(i) & " ")
Next i
txtvietnam.Text = strings
End Sub
===============================================

But I'm not good Visual Basic Language, Can you show me source code for Delphi the same.
Back to top
View user's profile
Radagast
Member


Joined: 01 May 2005
Posts: 17
Location: Poland

PostPosted: 03/06/05 06:36    Post subject: Reply with quote

I'm not good at VisualBasic either (if I were I would be at VBArea.com ) but as nobody else replies I'll try. I'm half guessing so don't expect much result. Here comes my proposition of code:
Code:
var
vn_words, en_words: array [1..1000] of String; (???)
dotime, strings: String;
check_verbs, check_pharses: integer;
englishwo, vietnamwo: string;

Procedure Form1.OnCreate;
begin
 Timer1.Enabled:=false;
 Timer2.Enabled:=true;
 listwords:=1;

 AssignFile(In1,Application.Path+'\pharses.txt');
 Reset(In1);
 While not eof(In1) do
  begin
   readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
   inc(listwords);
  end;
 CloseFile(In1);
 Check_pharses:=listwords;

 AssignFile(In1,Application.Path+'\verbs.txt');
 Reset(In1);
 While not eof(In1) do
  begin
   readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
   inc(listwords);
  end;
 CloseFile(In1);
 Check_verbs:=listwords-check_pharses;

 AssignFile(In1,Application.Path+'\words.txt');
 Reset(In1);
 While not eof(In1) do
  begin
   readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
   inc(listwords);
  end;
 CloseFile(In1);

end;


procedure Timer1.OnTimer;
begin
If txtvietnam.Text='' then exit;
if dotime=txtvietnam.Text then exit;
txtenglish.Text:='';
whereareweat:=1;
dotime:=txtvietnam.text;
strings:=txtvietnam.text;
for i:= 1 to 13 do
strings:=Replace(strings,vn_words[i],enwords[i] and ');
for i:=1 to 1000 do
strings:=Replace(strings,vn_words[i],enwords[i] and ');
txtvietnam.text:=strings;
end;

Timer2.OneTimer;
//identycznie jak Timer1, tylko trzeba zamienić miejscami English i Vietnam

As I already told you I'm not sure whether it works or not. And I don't know what "Replace" function is, so it may not compile. If so we may try to write it, but I still don't know wheter it works. Could you attach here compiled and working version of this program?
Hope it will be useful.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
   Reply to topic       DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group