Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

language (sopken) translation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
colin - 29 Feb 2008 15:48 GMT
Hi,
I need to translate some text messages wich are in a file wich
is in windows .ini format,
eg:-

[Info]
Title=haunted church
[Message1]
NewMessage=do not enter

from czech to english,
there are quite a few translation websites wich do online translations,
but only 1 ive found wich can take czech,
http://www.tranexp.com/
its not that good but is at least a start.

but if I pass it the whole .ini file it makes a mess of the headings etc,
I could use the c# webservices to access the website and pass it each
message at a time
rather than doing it by hand, but is there an easy way of doing this ?

ive only a limited number of files to do so I dont realy want anything
costly.

thanks

Colin =^.^=
Nicholas Paldino [.NET/C# MVP] - 29 Feb 2008 17:52 GMT
Colin,

   Well, you can call the GetPrivateProfile* functions in the Win32 API to
get the values for the various items in the INI file and then pass those to
your web service to get translations that don't involve the headers of the
INI file and whatnot.

   You should be able to find the definition of the functions at
http://www.pinvoke.net

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi,
> I need to translate some text messages wich are in a file wich
[quoted text clipped - 23 lines]
>
> Colin =^.^=
colin - 29 Feb 2008 18:08 GMT
thanks, but the hard part isnt geting the data from the .ini file,
as I create that anyway, but accessing a web translater from within c#.

Colin =^.^=

> Colin,
>
[quoted text clipped - 33 lines]
>>
>> Colin =^.^=
Nicholas Paldino [.NET/C# MVP] - 29 Feb 2008 18:23 GMT
Colin,

   Well, the translators might not offer a web service interface, but you
should be able to mimic going through a browser with an
HttpWebRequest/HttpWebResponse class.  You just need to look at the traffic
that is sent on a request (use something like Fiddler to see what is sent)
and then replicate that.  On return, you can parse the response to get the
translated result.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> thanks, but the hard part isnt geting the data from the .ini file,
> as I create that anyway, but accessing a web translater from within c#.
[quoted text clipped - 39 lines]
>>>
>>> Colin =^.^=
colin - 29 Feb 2008 18:31 GMT
yeah thanks, thats what I was thinking I could do as a last resort,
I was looking for examples of doing automated translations but so
much of it is to do with translating the computer language eg java<->c#.

it might not be too dificult but ive not used the httweb* classes yet,
but il give fiddler a look ...

Colin =^.^=

> Colin,
>
[quoted text clipped - 48 lines]
>>>>
>>>> Colin =^.^=
colin - 29 Feb 2008 20:56 GMT
thanks, ive managed to get it working exept for the urlencoding,
the string "prokletého podzemí" gets converted to proklet%E9ho+podzem%ED
looking in fiddler,
but when I use System.Web.HttpUtility.UrlEncode(string) it converts it to
proklet%c3%a9ho+podzem%c3%ad
wich isnt right, im not sure what I need to use, ive tried a few
alternatives such as encoding optional parameters,
but only makes it worse, any ideas ?
(apart from doing the conversion myself ofc lol)

Colin =^.^=

> Colin,
>
[quoted text clipped - 4 lines]
> is sent) and then replicate that.  On return, you can parse the response
> to get the translated result.
colin - 29 Feb 2008 21:04 GMT
ah its ok I found a few examples of using it and seems the
System.Text.Encoding doesnt contain the entry I need.
System.Web.HttpUtility.UrlEncode(textIn,
System.Text.Encoding.GetEncoding("Windows-1252"));
using this it works now :)
Colin =^.^=

> thanks, ive managed to get it working exept for the urlencoding,
> the string "prokletého podzemí" gets converted to proklet%E9ho+podzem%ED
[quoted text clipped - 16 lines]
>> is sent) and then replicate that.  On return, you can parse the response
>> to get the translated result.
Fredo - 29 Feb 2008 18:16 GMT
I would warn you that using automated translations is going to give you VERY
poorly translated text. Translation involves a lot more than simply
translating individual words. Even translations by someone who speaks both
languages will generally be pretty bad if the person isn't very fluent in
both languages.

If the text to be translated is technical (like software related
terminology), that adds further difficulty if the person translating isn't
familiar with the terminology in both languages in question.

Translations, even by some of the better automated translation systems (like
Babelfish) do a pretty poor job overall. The can do enough that the reader
can generally decipher the meaning, but they rarely translate into something
that sounds natural.

I speak from experience as both a developer who has worked with professional
translators to localize applications and as someone who has actually done
translations (translating contracts from Spanish to English, English being
my native tongue). Translation is both an art and an acquired skill. I have
acquired some of the skill, but I don't have the art and my translations are
pretty weak, but they're FAR better than anything an automated system can
do.

I don't mean to discourage you, but simply to let you know the reality of
the situation.

> Hi,
> I need to translate some text messages wich are in a file wich
[quoted text clipped - 23 lines]
>
> Colin =^.^=
colin - 29 Feb 2008 18:23 GMT
yeah, like I said its not that good but its at least a start,
I have tried it and I can decipher some of it and make it into better
sentances,
but even then a significant proportion is still un inteligable,
but it would then make less work for someone who knew the language,
or tried to work out the meaning from the situation context,
fortunatly its not specifically technical.

Colin =^.^=

>I would warn you that using automated translations is going to give you
>VERY poorly translated text. Translation involves a lot more than simply
[quoted text clipped - 49 lines]
>>
>> Colin =^.^=

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.