Results 1 to 3 of 3
Like Tree2Likes
  • 1 Post By GumSlone
  • 1 Post By GumSlone

Thread: language code to language name

  1. #1
    Administrator GumSlone's Avatar
    Join Date
    Mar 2005
    Location
    Mars, GumCity
    Posts
    1,505
    Thanks
    125
    Thanked 577 Times in 203 Posts
    Blog Entries
    2
    Rep Power
    10

    Default language code to language name

    this function detects users language name from browsers language code

    PHP Code:
    function gum_lc2ln()
    {
        
    $lc strtolower(substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2));
        
    $language_arr = array(
        
    "en"=>"English",
        
    "de"=>"German",
        
    "ru"=>"Russian",
        
    "ja"=>"Japanese",
        
    "es"=>"Spanish",
        
    "zh"=>"Chinese",
        
    "fr"=>"French",
        
    "it"=>"Italian",
        
    "pt"=>"Portuguese",
        
    "pl"=>"Polish",
        
    "ar"=>"Arabic",
        
    "nl"=>"Dutch",
        
    "tr"=>"Turkish",
        
    "sv"=>"Swedish",
        
    "fa"=>"Persian",
        
    "cs"=>"Czech",
        
    "ro"=>"Romanian",
        
    "ko"=>"Korean",
        
    "el"=>"Greek",
        
    "hu"=>"Hungarian",
        
    "th"=>"Thai",
        
    "vi"=>"Vietnamese",
        
    "da"=>"Danish",
        
    "hi"=>"Hindi",
        
    "id"=>"Indonesian",
        
    "fi"=>"Finnish",
        
    "no"=>"Norwegian",
        
    "bg"=>"Bulgarian",
        
    "sk"=>"Slovak",
        
    "he"=>"Hebrew",
        
    "hr"=>"Croatian",
        
    "lt"=>"Lithuanian",
        
    "sr"=>"Serbian",
        
    "ca"=>"Catalan",
        
    "sl"=>"Slovenian",
        
    "uk"=>"Ukrainian",
        
    "ms"=>"Malay",
        
    "ml"=>"Malayalam"
        
    );
        if(!empty(
    $language_arr[$lc])) return $language_arr[$lc];
        else return 
    'Unknown';

    arnage likes this.
    Advertise your mobile site for FREE with [Only registered and activated users can see links. Click Here To Register...]

    [Only registered and activated users can see links. Click Here To Register...]


  2. The Following 2 Users Say Thank You to GumSlone For This Useful Post:

    metulj (27-02-12), something else (27-02-12)

  3. #2
    Senior Member just_m3.'s Avatar
    Join Date
    Feb 2010
    Location
    Romania
    Posts
    181
    Thanks
    11
    Thanked 74 Times in 28 Posts
    Rep Power
    4

    Default

    simple and easy to code but tnx , other users would find it usefull cheers
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

  4. #3
    Administrator GumSlone's Avatar
    Join Date
    Mar 2005
    Location
    Mars, GumCity
    Posts
    1,505
    Thanks
    125
    Thanked 577 Times in 203 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    Quote Originally Posted by just_m3. [Only registered and activated users can see links. Click Here To Register...]
    simple and easy to code but tnx , other users would find it usefull cheers
    sometimes its easier to copy and paste a ready simple code than to code it.
    khan likes this.
    Advertise your mobile site for FREE with [Only registered and activated users can see links. Click Here To Register...]

    [Only registered and activated users can see links. Click Here To Register...]


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. help me what is this language
    By redrdx in forum Coding Forum
    Replies: 15
    Last Post: 15-08-11, 15:57
  2. Translate In your Language PLEASE!
    By morency in forum REQUEST FORUM
    Replies: 3
    Last Post: 10-09-10, 07:59
  3. Which Scripting Language to Use
    By marckrail in forum Coding Forum
    Replies: 0
    Last Post: 06-08-10, 14:54
  4. change language
    By brand in forum REQUEST FORUM
    Replies: 0
    Last Post: 11-05-10, 19:02
  5. language help
    By sinwapx in forum Site / Script testing and error fixing
    Replies: 8
    Last Post: 12-02-10, 10:04

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