Results 1 to 5 of 5

Thread: Translating a site from another language

  1. #1
    thomasc is offline Unknown Net Builder
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Translating a site from another language

    Hello,
    This script is very good, I use it ever sicne I've found it on the digitalpoint forum thread.

    I'd like to know what easiest steps should be taken in order to use this script from a site in another language?

    Let's say, my site is in french, and I'd like the script to work for english and all other languages in much the same way as it does for english sites.

    Cheers,

  2. #2
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,329 Times in 1,259 Posts
    I haven't done this, but it should be fairly simple to accomplish.

    You would have to edit translate.php to replace "en" with "fr":

    Before
    Code:
    //Define translation engines here
    $engines = array(
            'g'     => array(               'trans_url'             => 'http://translate.google.com/translate_c?hl=en&langpair=en%7C$lang&u=$url',
                                                    'timeout'               => 180,
                                                    'max_redir'             => 3,
                                                    'check_func'    => 'GoogleCheck',       //This function should determine if the translation was successful
                                                    'fixup_func'    => 'GoogleFixup'
                                            ),
    //TODO: Yahoo translation requires an IP hostname, should code a workaround for this
            'y'     => array(               'trans_url'             => 'http://72.30.186.56/babelfish/translate_url_content?lp=en_$lang&trurl=$url',
                                                    'timeout'               => 180,
                                                    'max_redir'             => 3,
                                                    'check_func'    => 'YahooCheck',
                                                    'fixup_func'    => 'YahooFixup'
                                            )
    After
    Code:
    //Define translation engines here
    $engines = array(
            'g'     => array(               'trans_url'             => 'http://translate.google.com/translate_c?hl=fr&langpair=fr%7C$lang&u=$url',
                                                    'timeout'               => 180,
                                                    'max_redir'             => 3,
                                                    'check_func'    => 'GoogleCheck',       //This function should determine if the translation was successful
                                                    'fixup_func'    => 'GoogleFixup'
                                            ),
    //TODO: Yahoo translation requires an IP hostname, should code a workaround for this
            'y'     => array(               'trans_url'             => 'http://72.30.186.56/babelfish/translate_url_content?lp=fr_$lang&trurl=$url',
                                                    'timeout'               => 180,
                                                    'max_redir'             => 3,
                                                    'check_func'    => 'YahooCheck',
                                                    'fixup_func'    => 'YahooFixup'
                                            )
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  3. #3
    thomasc is offline Unknown Net Builder
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, thank you for your fast reply.
    If everything is concentrated into this part of code, then yes it's easy, I thought maybe the english language as a base was hardcoded in other parts of the script.

    Well of course the flags links need to be changed so that english simply becomes another language and the site's original language becomes the main one.

  4. #4
    nomanzia is offline Unknown Net Builder
    Join Date
    Aug 2011
    Location
    Turkey
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks i am looking the same in Turkish language.

  5. #5
    jason12 is offline Newbie Net Builder
    Join Date
    Mar 2012
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Simple, use Google Chrome browser to translate the page into what ever language you needed.

Similar Threads

  1. How to stop translating...
    By CyberWizard in forum Translation Script Support
    Replies: 2
    Last Post: 5 August, 2010, 07:54 AM
  2. Translating text in PHP code into another Language
    By harunkaraman in forum Programming
    Replies: 11
    Last Post: 26 September, 2009, 22:12 PM
  3. Only Home is translating
    By webdevtech in forum Translation Script Support
    Replies: 1
    Last Post: 22 September, 2009, 17:43 PM
  4. only home page is translating
    By autotech234 in forum Translation Script Support
    Replies: 3
    Last Post: 24 May, 2009, 09:43 AM
  5. Seems to be working... but not translating anything
    By quikned in forum Translation Script Support
    Replies: 5
    Last Post: 26 March, 2009, 21:28 PM

Tags for this Thread

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
  •