+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: [TUTORIAL] Multi-Language WebSites

  1. #11
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: [TUTORIAL] Multi-Language WebSites

    Just an update:

    Here is a code using the 'checking browser language' code to make links with the lang, so when our visitor change the page, the lang keeps on

    As example, my Portfolio link.
    Code:
    <a href="http://raphaelddl.com/?ddl=Portfolio<?php if( isset( $_GET['lang'] ) ){echo "&amp;lang=" . $_GET['lang'];}else{if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){echo "&amp;lang=en";}else{$idioma = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $idioma = substr($idioma,0,2); if( ( $idioma == "pt") or ( $idioma == "en") ) {echo "&amp;lang=" . $idioma;}else{echo "&amp;lang=en";}}} ?>"><?php echo $texto['Portfolio']; ?></a>
    so, ?ddl=portfolio - If the lang already at url, print &lang={variable of URL} if not, check the browser language, check if have any of the ones available and print &lang={the browser lang}. Else, print &lang= en (english - 'default' one).
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  2. #12
    kkenny's Avatar
    kkenny is offline Lord Of The Keys kkenny is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    I REP THE BAY. (Bay Area, CA, USA)
    Posts
    1,950

    Re: [TUTORIAL] Multi-Language WebSites

    Very Nice.
    I might need this sometime soon. :]
    kkenny - retired.
    -Made my first webpage at X10Hosting on 2/16/08
    -Became a Moderator/Staff Member for SD&D + Off-Topic on 4/23/08
    -Became Senior Mod on 8/28/08
    -Became Account Manager on 10/18/08
    -Left Staff and X10 on 1/10/09. Im coming back soon.

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Any good PHP websites?
    By soten355 in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-29-2009, 10:47 AM
  2. Web language
    By Marzy in forum Feedback and Suggestions
    Replies: 9
    Last Post: 11-07-2007, 09:09 PM
  3. site language...
    By ymca in forum Free Hosting
    Replies: 6
    Last Post: 11-10-2005, 11:26 AM
  4. Relax Language Requirements
    By Wai_Wai in forum Feedback and Suggestions
    Replies: 22
    Last Post: 09-16-2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers