Results 1 to 4 of 4

Thread: Website Language Translation

  1. #1
    Join Date
    Nov 2010
    Posts
    115
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default Website Language Translation

    Hi All,

    My website content is written in english. As soon as user enters my website it show options of translating into other languages, especially Indian Local Languages(Hindi,Tamil,Telugu). I have checked google translator and others also. But i did not get what i needed exactly. If anyone know how to get this, please help me

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'll keep my first reply here short. If you want more info, just ask about any sub-topic.

    First, there are two very different components:
    1. Translating the words (language)
    2. Displaying the translations and showing options to select a language (programming)

    I'm a PhD student in Linguistics, so I can tell you (generally) everything you need to know about translation. The most important part is that using machine translation (eg, google translate) is almost always a very bad idea. Computers just can't translate in a smooth way. They are useful for understanding the basic idea of something (for example, "what is this book about?"), but your website will look completely unprofessional if you use google translate (or any other translator) to present the text.
    Of course if you want to use google translate as an option, only as a helpful tool, maybe in a popup window, then your visitors might appreciate the quick help. But don't present it as "View this website in Hindi".

    The best way to translate a website is to hire a translator, or to do it yourself. It's hard, it's slow, and it seems difficult, but it really will be a better result. Honestly if you don't do that, then you should just leave it all in English-- translating with a computer won't get you any more business than just leaving it as-is.
    Depending on the nature of your site, you could also ask visitors if they want to help translate. This makes sense for a "community" type site, but not for a business.

    Let me know if you have any other questions about translation.


    The second component is the programming. There are a lot of ways to do this. You could create two independent copies of your site. That's a lot of work, but some companies want truly specialized websites for several countries or languages. For example, if the culture differs, using a red background might be better than the green background you have for the main site. And you might even want to change the layout.

    But in general, the most common method (especially for small sites) is to translate the content but keep the presentation. To do that, it's usually much easier to create a PHP translation system rather than changing it by hand on each page, especially when the content changes.

    There are a few ways to use PHP to generate translations. First, you will need to create a list of all of your phrases (titles, sentences, or even paragraphs). You need to entirely remove all formatting and just use text. Then place this text into your layout. Sometimes you might need a little formatting, such as bold or italics, but try to keep that limited.
    Next, you need to decide how to store and access this list. You could use flat files (for example, xml) if you have a list for each page. Or you could use a database (MySQL?) if you want to be able to search many translations at one time and share them between pages.
    Finally, you need to create a function that finds the translation and displays it. For example, translate('Hello',$language);. You might want to use words like that (based on English or whatever default language you have), or you might want to use numbers, such as translate(12,$language);, where 12 is the ID in the database for that phrase.
    Remember, you will need to have every phrase translated in the database if it will display. One option for partial translations is to show the English (or other language) by default if the translation is missing. So you can only translate the title and "hello", but leave the rest of the content in English, at least until you have more time to finish the translation.

    The last part will be to create a system to select a language. There are a few ways to do this:
    1. If you have separate websites, then you could just use that to select the language. You could use different domains, subdomains or directories. yoursite.com/english or english.yoursite.com, etc.
    2. If you are doing this dynamically, then you probably will want to create a language variable. You can use the same page URL but allow the user to set their language and store it using a cookie.
    3. You could use a similar setup to (1), but use the URL to determine what language to show. One way to do this is to set *.yoursite.com (all subdomains) to be the same, but then display different content based on the language. That's a little complicated, but it's possible. Of course if a nonexistent language is set, you would redirect them back to the default.


    I'm working on a project involving a complicated translation system, and I could send you a link to that via PM if you want. It's not ready to be posted publicly yet.


    You should also search for more information. There are lots of resources for translation, although it is confusing and complicated, but maybe you'll find some things you like. Here's some information on wikipedia:
    http://en.wikipedia.org/wiki/Interna...d_localization
    Search for i18n for more information.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    hemi519 (01-11-2012)

  4. #3
    Join Date
    Nov 2010
    Posts
    115
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the info, i will try to choose one of the way that you suggested, even though it takes time and requires lot of work

  5. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    By the way, if you're going to be dynamically changing the language, then you should be using UTF8 (unicode) text encoding on all of your pages. Use that from the beginning so you don't run into problems later. Hindi (and other Indian characters) will require unicode to exist with other languages at the same time.

    Secondly, if you will be using Urdu or any language that runs right-to-left, then you need to include text-direction information in the page, and that can be complicated. It's possible, but not too easy.

    Good luck, and post here with any specific questions.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •