Display native language of country

Discussion in 'PHP' started by msgh, Apr 28, 2012.

  1. #1
    Hi Friends,

    I want to make script in php when user open my website in his browser then website automatic show his native language of country. I all ready translate some country languages webpages. please give example, tutorial links.

    Thanks
     
    msgh, Apr 28, 2012 IP
  2. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #2
    I'm looking for this solution too. And this is what I found:

    http://api.hostip.info/country.php

    More info at: http://www.hostip.info/use.html
     
    kids, Apr 29, 2012 IP
  3. Technary

    Technary Member

    Messages:
    429
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    33
    #3
    Technary, Apr 29, 2012 IP
  4. msgh

    msgh Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Till i've not got no solution. There is no any expert here which tell me solution.
     
    msgh, Apr 29, 2012 IP
  5. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #5
    I think I show you what you need, and "how to do it" is no need to say more for a PHP programmer. If you know where users from, you will set cookie or session with lang_var. Or the second method, you create a table with visitors(visitor_id, visitor_ip, visitor_time_in, visitor_lang)

    Do you want to say more about it?
     
    kids, Apr 30, 2012 IP
  6. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #6
    No, that's not my blog. My Blog is ResetCounter
     
    kids, Apr 30, 2012 IP
  7. msgh

    msgh Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    I try to according given links. Also change all neccessary data from files but not working.....
     
    msgh, May 11, 2012 IP
  8. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #8
    yes i also spend hours working with above solution but no luck
    i was just looking for country of user however this will be good start as when you detect country of visitor you can redirect it to specific lang

    here is how it will work

    first detect country use ip2nation.com
    now you can easily select language

    like
    $usercountryisocode="query that selects country iso code based on IP"
    include($usercountryisocode.php);
    your language file names should be country iso code . php like
    in.php for hindi
    cn.php for china
    pk.php for Pakistani visitors/users

    if you still un successful drop me a pm as i have done it spending more then 5 days.
    for you i will do it within less then hour
    don't hesitate to contact thinking i may charge for it
    NO NO
     
    MrPJH, May 11, 2012 IP