SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get language of a page

    Hi,

    I want to get the language of a page. I know what are W3C recommendations for this and that this can be done by reading the source and parsing the HTML and META and XHTML tags.

    But the issue is, that many sites do not follow the W3C standards and therefore, they do not have any meta information about the language. In such cases, is there a free API or something that I can use to get the langauge of a website ?

    please help

    Regards
    Z

  2. #2
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,255
    Mentioned
    32 Post(s)
    Tagged
    4 Thread(s)
    Hey Z,

    Google allow you to use their translation API to do this sort of thing, but I couldn't see a free option on the web site. An alternative you could try is the Language Detection API site, which does have a free option, and they provide a client library for PHP.

  3. #3
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you ! I will try the other link you provided.


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
  •