Help! I want to Edite Google Translator Code to translate my forum, Simple but Useful

Discussion in 'PHP' started by FadyCoder, Feb 14, 2008.

  1. #1
    Hello, :D

    I found a good code from Donutey that translating my forum by Google Translator ..

     <form action="http://www.google.com/translate_p">
    <script type="text/javascript">
    <!-- 
     var myLocation = location.href;
    var loc = myLocation.split("http://");
    var locID = loc.length;
    var myurl = "http://"+loc[locID-1];
     document.write ("<input name='u' value='"+myurl+"' type='hidden' />");
      //-->
    </script>
    <noscript>
    <input name="u" value=" http://www.talktohost.com" type="hidden" /></noscript>
    <input name="hl" value="en" type="hidden" />
    <input name="ie" value="UTF8" type="hidden" />
    <input name="langpair" value="" type="hidden" />
    <input style="width:60px;height:20px;" name="langpair" value="ar|en" title="English" src="http://www.donutey.com/images/lang/gb.gif" align="bottom" onclick="this.form.langpair.value=this.value" type="image" />&nbsp<input style="width:60px;height:20px;" name="langpair" value="ar|ar" title="Original Language" src="http://www.donutey.com/images/lang/ar.gif" align="bottom" onclick="this.form.langpair.value=this.value" type="image" />&nbsp
    </form><!-- Add Translation to Your Site at http://www.donutey.com/translationportal.php -->
    PHP:
    I want to add styleid=3&langid=1 for the link that will be translated ( to change the language and the style for the translated page) ..

    in other way :
    my forum is in Arabic (The language and the style in the forum are Arabic) I want to change the language and the style (to be in English) when some one click (English) to translate the page by google ..
    so I want to add styleid=2&langid=1 for the link

    Do you have any solution !? :D

    Sorry my bad English ..
     
    FadyCoder, Feb 14, 2008 IP
  2. FadyCoder

    FadyCoder Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Hey people !!
    I think it's very simple but needs someone who know coding !!

    is that right to add
    var lang = "langid=1"
    var style = "styleid=2"

    and then add
    var myurl = "http://"+loc[locID-1]+var style+var lang;

    funny code !!?
    I don't know coding but I tried several times so please help me ..
     
    FadyCoder, Feb 14, 2008 IP