Language Translation (For your site)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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 InBuzunar.Mobi - Internetul mai aproape de tine, acum si pe mobil but i'm not using anymore. Good luck
    www.inbuzunar.mobi - Your mobile portal pocket

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

    Comment

    Working...
    X