SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 35
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Miami, FL
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simplest multilingual site management system

    Hello,

    I sprained my neck looking for indications on how to manage a multilingual site in PHP. I found plenty which may be of value to whomever knows more than <?php echo "Hello, World!"; ?> , as is my case. Unfortunatelly, I understood just little pieces from different sources, which, when put together, resulted in something I never thought I could do all by me onesy: "This program has performed an illegal operation and will be shut down." I'm good, I tell you.

    So I ask you, is there any chance anyone can spend a few minutes explaining me how I can write the following in PHP?

    -ask user to define a language, through drop down menu form element (fortunately, I'm average in HTML, so at least that shouldn't be an issue)
    -set a cookie, so the browser remembers the language for each page, unless language is changed, then set another cookie
    -if user selected language = italian, for example, then home = casa, gallery = galeria, Milan = Milano, Rome = Roma, etc.
    -if user selected language = french, then include menu_fr.php, else if, etc...

    How do I do these things? Where and how do I define the variables? How do I write the language files? I know, Google is my friend, but it speaks too fast for me. Either that, or I listen to slow.

    Any and all help is appreciated. Many thanks! See you around.

    Hallipa

  2. #2
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, set up 'english' as default language. if cookie is not set, select english content.

    if cookie is set, select content based on that language.

    let's say this is your left menu.

    <?php echo '
    <ul>
    <li>' . $lang['home'] . '</li>
    <li>' . $lang['contact'] . '</li>
    <li>' . $lang['haha'] . '</li>
    </ul>';

    if language is english, include english.php
    if language is french, include french.php

    english.php would have:

    $lang = array(
    'home' => 'Home',
    'contact' => 'Contact',
    'haha' => 'I am Popo'
    );

    french.php would have:
    $lang = array(
    'home' => 'Accueil',
    'contact' => 'Contactez-Nous',
    'haha' => 'Je suis Popo'
    );

    Hope this helps.
    asT.

  3. #3
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In addition to the above post, you could get a user selection from a drop down box like this.

    PHP Code:
     <?php
     
    if(isset($_POST['langButton']))
     {
       
    setcookie('language'$_POST['language'], time()+3600*24*5); //Set 5 year cookie with their choice of language
     
    }
     
    ?>
     <html>
     <body>
     <form method="post" action="nameofthispage.php">
     <select name="language">
     <option value='english'>English</option>
     <option value='german'>German</option>
     <option value='etc'>Etcetera</option>
     </select><br />
     <input type="submit" name='langButton' value='choose language'>
     </form>
     
     </body>
     </html>
    You need to set the cookie before headers are sent, ie, before you send any output to the browser, so it must come before the opening <html> tag. After this you can check if a language has been specified like this:
    PHP Code:
     <?php
     
    if(isset($_COOKIE['language']))
     {
      echo 
    'Your chosen language is ' $_COOKIE['language'];
      
    //Or do something useful like change the site text
     
    }
     
    ?>
    Btw, the variable $_SERVER['HTTP_ACCEPT_LANGUAGE'] might be of use. It contains the browsers language setting.(I haven't tested this thoroughly but Firefox and IE seems to send consitent values)
    mikehealy.com.au
    diigital.com art, design . Latest Work — Saturday Morning

  4. #4
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Btw, the variable $_SERVER['HTTP_ACCEPT_LANGUAGE'] might be of use. It contains the browsers language setting.(I haven't tested this thoroughly but Firefox and IE seems to send consitent values)
    Still, lot's of people have a browser which is not in their native language...

  5. #5
    SitePoint Guru Nick Carlson's Avatar
    Join Date
    Aug 2003
    Location
    Denver
    Posts
    644
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what the code for it is, but it might be best to detect what country they are coming from, and somehow have a default language for that country.
    ncarlson.net - a programmer's dystopia

  6. #6
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to install a language conversion script into a web site?

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    The Netherlands
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by optimus prime
    I'm not sure what the code for it is, but it might be best to detect what country they are coming from, and somehow have a default language for that country.
    Yes, the location can be derived from the clients IP-address. If someone knows how this can be done, I'm interested to put this into my own site too.

  8. #8
    SitePoint Addict GeertDD's Avatar
    Join Date
    Feb 2005
    Location
    Belgium
    Posts
    334
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Itīs good to store the language variable in a session. See http://de3.php.net/manual/en/ref.session.php for more details.

    Once a visitor has chosen a language it will be remembered by the script(s) on all sites.

    edit: Itīs better than using cookies because users can disallow it.

  10. #10
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oerdec
    Itīs good to store the language variable in a session. See http://de3.php.net/manual/en/ref.session.php for more details.

    Once a visitor has chosen a language it will be remembered by the script(s) on all sites.

    edit: Itīs better than using cookies because users can disallow it.
    Sessions expire though. You'd assume the user would have the same language for years. It should/can be a cross, though. If the cookie can be set, go for it - otherwise, use sessions only. Pretty easy to do, and does help for those with cookies disabled.

  11. #11
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Translation

    Quote Originally Posted by Hallipa
    So I ask you, is there any chance anyone can spend a few minutes explaining me how I can write the following in PHP?

    -ask user to define a language, through drop down menu form element (fortunately, I'm average in HTML, so at least that shouldn't be an issue)
    -set a cookie, so the browser remembers the language for each page, unless language is changed, then set another cookie
    -if user selected language = italian, for example, then home = casa, gallery = galeria, Milan = Milano, Rome = Roma, etc.
    -if user selected language = french, then include menu_fr.php, else if, etc...

    How do I do these things? Where and how do I define the variables? How do I write the language files? I know, Google is my friend, but it speaks too fast for me. Either that, or I listen to slow.
    By "define a language", I think you meant "select a language". This means you need to have a predefined selections of languages. You can keep that as a nested associative array which contains language ids (two/three-coded) and their data (name, messages, currency formats, etc.)

    For the messages and language-specific PHP files, actually they're the same. Just make a function to "translate" a "message" (or anything, actually they're language-dependent strings) to the localized message. You can look at the nested associative array before. If you don't completely define available strings for a language, make sure you define a fallback language (English usually, or your native language) that contains all messages.

    BTW internationalization and localization is so much more than just messages. You need to handle the FIRST AND FOREMOST is character encoding. For this I recommend UTF-8. Then you'll handle currencies, date formats, number formats, timezones, etc.

    If you need data for those, I recommend CLDR (really?), search that on unicode.org.

    I hope you're responding to this thread 'cause I'm in if you need further advice, you can also PM me. Good luck! :-)

  12. #12
    SitePoint Addict molder101's Avatar
    Join Date
    Apr 2004
    Location
    dorothy
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dont know if this will be of help or not but check out www.boyac.com. In the lower left hand corner you will see a number of flags that allow for changing the language.

    This is just a simple "hack" to use babelfish from astavista without the ugly frames and all of that. Try it out and check out the code to see how it's done!

    Mike
    Michael R. Sikora
    www.blue-eyedesign.com
    {redesigning web design}

  13. #13
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Miami, FL
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for the replies. I have tried your suggestions and I am now way ahead, compared to yesterday.

    I have this one snippet of code that's giving me trouble though. I want them to select their language and according to that selection to load a different menu. This is what I'm using:

    Code:
    <FORM METHOD="POST" action="index3.php">
      <select name="lang" id="lang">
        <option>Select language...</option>
        <option value="en">English</option>
        <option value="sp">Spanish</option>
        <option value="fr">French</option>
      </select>
    <INPUT TYPE="SUBMIT" VALUE="Submit Form"><BR><BR>
    </FORM>
    PHP Code:
    <?php 
    if ( $lang == en ) {
    include (
    'menu_english.php');
    }
    elseif ( 
    $lang == fr ) {
    include (
    'menu_french.php');
    }
    elseif ( 
    $lang == sp ) {
    include (
    'menu_spanish.php');

    else { 
    include (
    'english.php');

    ?>
    Not working. Anyone have any suggestions?

    Many thanks!

  14. #14
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This seems to be quite an interesting topic indeed!

    Hallipa: In your "php.ini" file is "register_globals" set to "on" or "off"? In most newer installations it is set to "off" for security purposes. If it is, use "$_POST['formElement']" instead. Also, IMO, it would be better to use "switch()...case:" statements instead of "if...else".

    Best Regards,
    Joe

    Edit: You'll also want to enclose the form values in quotes.

  15. #15
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Miami, FL
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    register_globals is set to on. I enclosed the values in quotes and it's still not working. Is the syntax incorrect?

    Let me look into this switch thing too, maybe that'll work.

    Many thanks.

  16. #16
    Non-Member Musicbox's Avatar
    Join Date
    Nov 2004
    Location
    india
    Posts
    1,331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MollyMark
    Is there a way to install a language conversion script into a web site?
    Just search google or yahoo and 1 minute there is google translator.

    Use it for free.

  17. #17
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    spain
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    the most natural way to have different language versions, to make easier management and maintenance, is storing in different directories, eg: website/english, website/french, ....

    If you use relative paths you only have to worry about how to change the language and redirect to the right page.

    In the attached file you can see a quick sample

    This is the structure proposed:
    Code:
    website      <== base path
      index.php     
      img        <== include common images here
      en         <== include english pages and subdirectories here
        img      <== include english images here
      es         <== include spanish pages and subdirectories here
        img      <== include spanish images here
      lib        <== include common routines here
    Hope that helps.
    Attached Files Attached Files

  18. #18
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit: Toooooooo sllllooooooooow....

    Why not forget the cookies? Request language preference and and send people off to language-specific addresses like:

    http://www.example.com/en/
    http://www.example.com/spanish/
    http://french.example.com/
    .... whatever.

    Let the url store the language. That way you don't have to screw with cookies and language choices will naturally be persistant, even when a link is emailed.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  19. #19
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by samsm
    Let the url store the language. That way you don't have to screw with cookies and language choices will naturally be persistant, even when a link is emailed.
    I would suggest this method as well, and mod_rewrite is the best solution in my opinion.

    Something like...

    Code:
    RewriteRule ^gallery/$ gallery.php?lang=en [L]
    RewriteRule ^galeria/$ gallery.php?lang=it [L]
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  20. #20
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Illinois, USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by momos
    Still, lot's of people have a browser which is not in their native language...
    Doesn't matter, I'd set the "Default" language to the one that they have in their browser preferences. You may find it surprising that people in other countries using Internet Explorer actually have their native language set as the 1st preference .

    Quote Originally Posted by samsm
    edit: Toooooooo sllllooooooooow....

    Why not forget the cookies? Request language preference and and send people off to language-specific addresses like:

    http://www.example.com/en/
    http://www.example.com/spanish/
    http://french.example.com/
    .... whatever.

    Let the url store the language. That way you don't have to screw with cookies and language choices will naturally be persistant, even when a link is emailed.
    This to me also seems like the best idea, although I would suggest the urls to use the ISO639 names (i.e. es instead of Spanish, de instead of German, etc)

  21. #21
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is one example solution, although it may not fit your needs.
    http://xlab6.com/examples/i18n.php

    It show both using url and cookies for language selection. PHP5 only though.

    Wei.

  22. #22
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have troubles accessing your variables, do a phpinfo on the script. This will let you know of any $_GET or $_POST or $_REQUEST variables you're missing (if your PHP version can't handle these "new" superglobals, please do yourself a favor and upgrade).

    For autodetecting the language IMHO Accept-Language is a BAD option. Nobody sets their language preference correctly, usually they'll leave it to default. And people also access using internet cafes so they can't (even if they can, they won't) change IE settings just for that.

    If you want to autodetect use IP-to-country or MaxMind's Free GeoIP Country to detect the country from IP Address, then from that you determine the language and proceed accordingly. Of course this is a bit complex. Anyway having a language selection is okay for most things.

    BTW I suggest saving the language preference in the session. That way all pages will "auto-detect" the language preference and display accordingly. Instead of checking a GET variable, you only need to check whether the session variable exists. When you switch a language you just need to set the session variable then redirect it to the referer.

    Check these out for live examples:
    - http://www.gauldong.net/lang.php?en
    - http://www.gauldong.net/lang.php?id

    It used to have a language selector in the other template. But in this template I took it off because it's not widely used (damn... all that multingual system and not used? hehehe)

  23. #23
    SitePoint Addict Jack Matier's Avatar
    Join Date
    Feb 2005
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I once did a multilingual website (136 some odd languages) and there are more things to consider then just the user language selection, which I used a cookie, a session and also carried it in the url as a variable ?lang=en , I had it initially detect the language set by the browser, and display the more "common" languages at the top in an array as links to change to the language they wanted, along with the language that they had selected (that wasn't a link).. The languages were listed in their own respective languages from an array. The "common" languages were in another array and so were compared against eachother if they wanted to see a nice listing..

    With a little bit of time this can all be done.

    There are a few more things to consider.

    One thing to consider is the ISO encoding type. You might want to see what w3c recommends for that.

    The database as well.. It's really nice that most of the multilingual characters would be translated for you into a bunch of things like & #9209; (I just made that up so bear with me), but then that also will mean that putting a limit on input in the database could cut the end part of that off.. So if I decided to have an input max of 4 characters for "& #9209; then Instead of it being a nice chinese/etc character, you get &#92. The users get to go "wtf"... if they speak english that is.

    I don't recommend getting the language from the country they are in.. A lot of contries have a minimum of 2 languages. Anyone from India here?

    Okay, then there is the direction of languages as well (research this). So pay attention to other html elements on the page and it's a wise idea to set the language in some form of meta-tag or tag for the browser (I forget what to use, but this fixes a lot of the direction problems automagically (phew))..

    Now, when it comes to displaying the language in something, you can do it also with php.. but wait just a minute, we're using php for enough already aren't we? You can try javascript if you want

    Just yeah, there is a good example with if/elses there.. you can also use includes to keep things pretty.

    Or php if you don't plan to have 100+ users at a time accessing your page and blowing it to bits. It would be nice for it to be client side stuff though. I'm evil and like to eat their resources instead.

    I think that's it. I wish I had the website to show you though, it was kind of a feat for my first php user base. I took it down and I'm making a new one. This time following XHTML 1.1 standards.

    Unfortunately I'm not giving any code because all I explained here was dealing with a few simple techniques which were arrays, sessions, cookies and a few good practices. (wait, I had some if statements in there as well)

    For all I know though, I feel like I was going about this all the wrong way.

    I think that's it.

    About the site:
    I also included a way for logged in users to select their primary language as well as any secondary language (stored in an array in a database) so they could use the chatterbox/forum and talk to others that knew the same language as them.. and see messages that they understood (that's a whole different thing to explain though).. It will also be that way in the new site.

  24. #24
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thought I might add this as well, since it's related

    Code:
    <option value="  " selected>(please select a country)
    <option value="--">none
    <option value="AF">Afghanistan 
    <option value="AL">Albania 
    <option value="DZ">Algeria 
    <option value="AS">American Samoa
    <option value="AD">Andorra 
    <option value="AO">Angola
    <option value="AI">Anguilla
    <option value="AQ">Antarctica
    <option value="AG">Antigua and Barbuda 
    <option value="AR">Argentina 
    <option value="AM">Armenia 
    <option value="AW">Aruba 
    <option value="AU">Australia 
    <option value="AT">Austria 
    <option value="AZ">Azerbaijan
    <option value="BS">Bahamas 
    <option value="BH">Bahrain 
    <option value="BD">Bangladesh
    <option value="BB">Barbados
    <option value="BY">Belarus 
    <option value="BE">Belgium 
    <option value="BZ">Belize
    <option value="BJ">Benin 
    <option value="BM">Bermuda 
    <option value="BT">Bhutan
    <option value="BO">Bolivia 
    <option value="BA">Bosnia and Herzegowina
    <option value="BW">Botswana
    <option value="BV">Bouvet Island 
    <option value="BR">Brazil
    <option value="IO">British Indian Ocean Territory
    <option value="BN">Brunei Darussalam 
    <option value="BG">Bulgaria
    <option value="BF">Burkina Faso
    <option value="BI">Burundi 
    <option value="KH">Cambodia
    <option value="CM">Cameroon
    <option value="CA">Canada
    <option value="CV">Cape Verde
    <option value="KY">Cayman Islands
    <option value="CF">Central African Republic
    <option value="TD">Chad
    <option value="CL">Chile 
    <option value="CN">China 
    <option value="CX">Christmas Island
    <option value="CC">Cocos (Keeling) Islands 
    <option value="CO">Colombia
    <option value="KM">Comoros 
    <option value="CG">Congo 
    <option value="CD">Congo, the Democratic Republic of the 
    <option value="CK">Cook Islands
    <option value="CR">Costa Rica
    <option value="CI">Cote d'Ivoire 
    <option value="HR">Croatia (Hrvatska)
    <option value="CU">Cuba
    <option value="CY">Cyprus
    <option value="CZ">Czech Republic
    <option value="DK">Denmark 
    <option value="DJ">Djibouti
    <option value="DM">Dominica
    <option value="DO">Dominican Republic
    <option value="TP">East Timor
    <option value="EC">Ecuador 
    <option value="EG">Egypt 
    <option value="SV">El Salvador 
    <option value="GQ">Equatorial Guinea 
    <option value="ER">Eritrea 
    <option value="EE">Estonia 
    <option value="ET">Ethiopia
    <option value="FK">Falkland Islands (Malvinas) 
    <option value="FO">Faroe Islands 
    <option value="FJ">Fiji
    <option value="FI">Finland 
    <option value="FR">France
    <option value="FX">France, Metropolitan
    <option value="GF">French Guiana 
    <option value="PF">French Polynesia
    <option value="TF">French Southern Territories 
    <option value="GA">Gabon 
    <option value="GM">Gambia
    <option value="GE">Georgia 
    <option value="DE">Germany 
    <option value="GH">Ghana 
    <option value="GI">Gibraltar 
    <option value="GR">Greece
    <option value="GL">Greenland 
    <option value="GD">Grenada 
    <option value="GP">Guadeloupe
    <option value="GU">Guam
    <option value="GT">Guatemala 
    <option value="GN">Guinea
    <option value="GW">Guinea-Bissau 
    <option value="GY">Guyana
    <option value="HT">Haiti 
    <option value="HM">Heard and Mc Donald Islands 
    <option value="VA">Holy See (Vatican City State) 
    <option value="HN">Honduras
    <option value="HK">Hong Kong 
    <option value="HU">Hungary 
    <option value="IS">Iceland 
    <option value="IN">India 
    <option value="ID">Indonesia 
    <option value="IR">Iran (Islamic Republic of)
    <option value="IQ">Iraq
    <option value="IE">Ireland 
    <option value="IL">Israel
    <option value="IT">Italy 
    <option value="JM">Jamaica 
    <option value="JP">Japan 
    <option value="JO">Jordan
    <option value="KZ">Kazakhstan
    <option value="KE">Kenya 
    <option value="KI">Kiribati
    <option value="KP">Korea, Democratic People's Republic of
    <option value="KR">Korea, Republic of
    <option value="KW">Kuwait
    <option value="KG">Kyrgyzstan
    <option value="LA">Lao People's Democratic Republic
    <option value="LV">Latvia
    <option value="LB">Lebanon 
    <option value="LS">Lesotho 
    <option value="LR">Liberia 
    <option value="LY">Libyan Arab Jamahiriya
    <option value="LI">Liechtenstein 
    <option value="LT">Lithuania 
    <option value="LU">Luxembourg
    <option value="MO">Macau 
    <option value="MK">Macedonia, The Former Yugoslav Republic of
    <option value="MG">Madagascar
    <option value="MW">Malawi
    <option value="MY">Malaysia
    <option value="MV">Maldives
    <option value="ML">Mali
    <option value="MT">Malta 
    <option value="MH">Marshall Islands
    <option value="MQ">Martinique
    <option value="MR">Mauritania
    <option value="MU">Mauritius 
    <option value="YT">Mayotte 
    <option value="MX">Mexico
    <option value="FM">Micronesia, Federated States of 
    <option value="MD">Moldova, Republic of
    <option value="MC">Monaco
    <option value="MN">Mongolia
    <option value="MS">Montserrat
    <option value="MA">Morocco 
    <option value="MZ">Mozambique
    <option value="MM">Myanmar 
    <option value="NA">Namibia 
    <option value="NR">Nauru 
    <option value="NP">Nepal 
    <option value="NL">Netherlands 
    <option value="AN">Netherlands Antilles
    <option value="NC">New Caledonia 
    <option value="NZ">New Zealand 
    <option value="NI">Nicaragua 
    <option value="NE">Niger 
    <option value="NG">Nigeria 
    <option value="NU">Niue
    <option value="NF">Norfolk Island
    <option value="MP">Northern Mariana Islands
    <option value="NO">Norway
    <option value="OM">Oman
    <option value="PK">Pakistan
    <option value="PW">Palau 
    <option value="PA">Panama
    <option value="PG">Papua New Guinea
    <option value="PY">Paraguay
    <option value="PE">Peru
    <option value="PH">Philippines 
    <option value="PN">Pitcairn
    <option value="PL">Poland
    <option value="PT">Portugal
    <option value="PR">Puerto Rico 
    <option value="QA">Qatar 
    <option value="RE">Reunion 
    <option value="RO">Romania 
    <option value="RU">Russian Federation
    <option value="RW">Rwanda
    <option value="KN">Saint Kitts and Nevis 
    <option value="LC">Saint LUCIA 
    <option value="VC">Saint Vincent and the Grenadines
    <option value="WS">Samoa 
    <option value="SM">San Marino
    <option value="ST">Sao Tome and Principe 
    <option value="SA">Saudi Arabia
    <option value="SN">Senegal 
    <option value="SC">Seychelles
    <option value="SL">Sierra Leone
    <option value="SG">Singapore 
    <option value="SK">Slovakia (Slovak Republic)
    <option value="SI">Slovenia
    <option value="SB">Solomon Islands 
    <option value="SO">Somalia 
    <option value="ZA">South Africa
    <option value="GS">South Georgia and the South Sandwich Islands
    <option value="ES">Spain 
    <option value="LK">Sri Lanka 
    <option value="SH">St. Helena
    <option value="PM">St. Pierre and Miquelon 
    <option value="SD">Sudan 
    <option value="SR">Suriname
    <option value="SJ">Svalbard and Jan Mayen Islands
    <option value="SZ">Swaziland 
    <option value="SE">Sweden
    <option value="CH">Switzerland 
    <option value="SY">Syrian Arab Republic
    <option value="TW">Taiwan, Province of China 
    <option value="TJ">Tajikistan
    <option value="TZ">Tanzania, United Republic of
    <option value="TH">Thailand
    <option value="TG">Togo
    <option value="TK">Tokelau 
    <option value="TO">Tonga 
    <option value="TT">Trinidad and Tobago 
    <option value="TN">Tunisia 
    <option value="TR">Turkey
    <option value="TM">Turkmenistan
    <option value="TC">Turks and Caicos Islands
    <option value="TV">Tuvalu
    <option value="UG">Uganda
    <option value="UA">Ukraine 
    <option value="AE">United Arab Emirates
    <option value="GB">United Kingdom
    <option value="US">United States 
    <option value="UM">United States Minor Outlying Islands
    <option value="UY">Uruguay 
    <option value="UZ">Uzbekistan
    <option value="VU">Vanuatu 
    <option value="VE">Venezuela 
    <option value="VN">Viet Nam
    <option value="VG">Virgin Islands (British)
    <option value="VI">Virgin Islands (U.S.) 
    <option value="WF">Wallis and Futuna Islands 
    <option value="EH">Western Sahara
    <option value="YE">Yemen 
    <option value="YU">Yugoslavia
    <option value="ZM">Zambia
    <option value="ZW">Zimbabwe
    Will save a lot of time if you go global The Ip <> Country link gives me my country of origin as the US but this is stupid as I'm from the UK? ...

  25. #25
    SitePoint Addict Jack Matier's Avatar
    Join Date
    Feb 2005
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    people,

    I'm still not content with defining a language by the country. Not only would it require another table but isn't it more reliable to use what is in the browser or system and then default to the target audience of your site if it doesn't find anything?

    Fine, it's granted that a lot of people don't have their language settings right. Heck, for all I know my computer might be set to American English and I'm Canadian English. Point is, it's english and if i needed it in another language I would have either bought the operating system in another language or set it up that way.

    The IP <> country thing is uh.. well it says I'm somewhere else on the globe anyway as well

    Although, now that I think of it.. It wouldn't hurt to use everyway possible. Right, I'm not thinking now.


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
  •