Translate Automatically Some Pages From English To Other Languages Like German

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 23, 2009, 02:01 PM
431270 members and 298327 Topics
Latest Member: Tumyce
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Translate Automatically Some Pages From English To Other Languages Like German
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Translate Automatically Some Pages From English To Other Languages Like German  (Read 889 views)
musiktext
Translate Automatically Some Pages From English To Other Languages Like German
« on: October 31, 2007, 08:27 AM »

Hello,
I need a script to translate automatically some pages from English to other languages like Germany.
I have some pages from my site (for example see - diana-ross, george michael or gary numan). All lyrics from here i want to translate in German.

Many thanks for any suggestions.
my2cents (m)
Re: Translate Automatically Some Pages From English To Other Languages Like Germ
« #1 on: October 31, 2007, 10:29 AM »

I think your best bet is to take advantage of what (at least in JAVA) is called Resource Bundles.  There are 2 approaches to this:

1) You create the properties file for each language (in JAVA, named, for example, english_US.properties, or something like that).  In the file you have something like this: copy.hello_text:What is that?.  In your german properties file, you could then have: copy.hello_text:Vas is Das?.  When you define your bundle, one of the parameters is the locale.  The server automatically detects this parameter and substitutes the appropriate language.

2) The crude way.  You define various files (german.php, yoruba.php, etc).  In it, you assign text to variables
(example: hello = hello (in english.php), hello = hola (in spanish.php), etc.  Of course you make sure you define the variable, for strongly-typed languages once.  Then, you have icons somewhere on your page for each language.  You would then link back to the page you are on, tacking on a language name-value pair. 

So, let's say you are on the english home page and the user clicks on the german icon.  The URL could look like so: http://www.site.com/?lang=german.  Then in your code, you could have code like so (I will use pseudo code here):
if(lang == "german") {
    include german.php
}

Let's further say on your home page, you have the following snippet: <h1><% print hello %></h1>

Irrespective of language selected, the word(s) get changed out automatically.

There may be other (and better) ways to do this, but the above 2 are the ways I have typically done it.  #1 is more optimal although (detection is done automatically).  I generally prefer #2 as not all people who live in say, Germany, understand german.  In other words, I would like to be able to select another language if I wanted to.

I hope this helps.
allonym
Re: Translate Automatically Some Pages From English To Other Languages Like Germ
« #2 on: November 12, 2007, 07:57 AM »

If you only need to translate under 100 words EVER, then that approach may work.  However, I get the impression that you have a lot more that needs to be translated.

Google and Alta Vista have free translation tools for certain languages.  They can translate text or whole web pages.  If your goal is to give people the ability to view your website in another language and don't mind showing it through google or altavista, then you can use their utility.  Just provide a link.  I'm making up this example:

http://www.google.com/translate=?From-English?To-German?http://www.mypage.com

If you could post more details about what you're trying to do, we could give you better ideas on how to do it.
my2cents (m)
Re: Translate Automatically Some Pages From English To Other Languages Like Germ
« #3 on: November 12, 2007, 10:38 AM »

allonym,

From experience, your approach may not always be the best: machines don't always do the best job at translation.  A human is best when it comes to translation.  Secondly, you may be faced with a situation where you want to translate to a language which is not provided for by such services.  Again, I say this from experience.

On a project at work, we decided to go with such a program, which we ended up paying for.  The goal was to translate from english to chinese and russian.  It just so happened that we had a chinese and a russian employee, so we gave the text to them to see if it was okay.  As it turns out, they said the translations were riddled with errors.  In fact, the chinese guy said the chinese translation had some derogatory words in it.

So, in conclusion, am I saying not to use the google/altavista? Nope.  All I am saying is it is not always best.  Caution must be observed.  If you are in a situation where you know anyone who speaks the language you are translating to, it wouldn't hurt to run it by them, just to make sure.

As always, my 2 cents

 Anybody Got Da Latest Oracle Dumps For Oca And Ocp?  Any Nigerian Women In Programming?  Programming A Converter For *.wma To *.mp3 - By Sbucareer  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.