Results 1 to 2 of 2

Thread: Language Translation (For your site)

  1. #1
    Senior Member kiss's Avatar
    Join Date
    Jan 2006
    Posts
    292
    Thanks
    3
    Thanked 125 Times in 29 Posts
    Rep Power
    0

    Lightbulb Language Translation (For your site)

    1. Create new file, name it test.php and add this code:
    PHP Code:
    <?php
     
    if ( isset( $_SERVER["HTTP_ACCEPT_ENCODING"] ) && substr_count$_SERVER["HTTP_ACCEPT_ENCODING"], "gzip" ) ) ob_start"ob_gzhandler" ) ;
     else  
    ob_start() ;
     
    session_start() ;
     
    $lang $_GET["lang"] ;
     if ( isset( 
    $lang ) ) {
      
    setcookie"language"$langtime() - 1800"/"".YourSite.Com") ;
      
    setcookie"language"$langtime() + 1800"/"".YourSite.Com") ;
     } else {
      if ( isset( 
    $_COOKIE["language"] ) ) {
       
    $lang $_COOKIE["language"] ;
       
    setcookie"language"$langtime() - 1800"/"".YourSite.Com") ;
       
    setcookie"language"$langtime() + 1800"/"".YourSite.Com") ;
      } else {
       
    $lang substr$_SERVER["HTTP_ACCEPT_LANGUAGE"], 0) ;
       
    setcookie"language"$langtime() + 1800"/"".YourSite.Com") ;
      }
     }
     include ( 
    "./lang/test.php" ) ;
     echo 
    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" ;
     echo 
    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n" ;
     echo 
    "<head>\n" ;
     echo 
    "<title>" $test_title "</title>\n" ;
     echo 
    "<meta name=\"description\" content=\"" $test_description "\"/>\n" ;
     echo 
    "<meta name=\"keywords\" content=\"" $test_keywords "\"/>\n" ;
     echo 
    "</head>\n" ;
     echo 
    "<body>\n" ;
     echo 
    "<center>\n" ;
     echo 
    $test_choose "\n" ;
     echo 
    "<br/>\n" ;
     if ( 
    $lang == "ro" ) {
      echo 
    "Ro | <a href=\"?lang=en\">En</a>\n" ;
     } else
      if ( 
    $lang == "en" ) {
       echo 
    "<a href=\"?lang=ro\">Ro</a> | En\n" ;
      }
     echo 
    "</center>\n" ;
     echo 
    "</body>\n" ;
     echo 
    "</html>\n" ;
     
    ob_end_flush() ;
    ?>
    2. Create new directory, with name lang (permission 777) then create inside a file test.php and add this code:
    PHP Code:
    <?php
     
    if ( $lang == "en" ) {
      
    $test_title "Title of page" ;
      
    $test_description "Describe the page" ;
      
    $test_keywords "Keywords of page" ;
      
    $test_choose "Choose language:" ;
     } else {
      
    $test_title "Titlul paginii" ;
      
    $test_description "Descrierea paginii" ;
      
    $test_keywords "Cuvintele cheie ale paginii" ;
      
    $test_choose "Alege limba:" ;
     }
    ?>
    3. This code it copied from [Only registered and activated users can see links. Click Here To Register...] but i'm not using anymore. Good luck
    [Only registered and activated users can see links. Click Here To Register...]Your mobile portal pocket

  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default

    please make it in zip so that i download this in my ph0ne..tnx

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. language code to language name
    By GumSlone in forum Snippets, Functions and Classes
    Replies: 2
    Last Post: 27-02-12, 16:11
  2. help with translation
    By frostymarvelous in forum Site / Script testing and error fixing
    Replies: 11
    Last Post: 06-01-11, 09:39
  3. Translation help
    By slowy in forum Translation
    Replies: 11
    Last Post: 13-07-10, 10:52
  4. Please Help In Translation
    By tkreturns in forum Coding Forum
    Replies: 1
    Last Post: 25-04-09, 18:59
  5. Translation
    By metulj in forum Coding Forum
    Replies: 27
    Last Post: 08-07-08, 21:32

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
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19