Click to See Complete Forum and Search --> : Detecting a Websites primary language
Umphie
06-10-2005, 09:33 AM
Hi, I'm new to web development and I don't have any background programming for the web but I am in need of some fairly specific knowledge concerning web searches. I was curious of what ways there is to detect what language a website is written in without actually reading the page. I read that a developer can set the primary language in html using lang = .... but looking at the source of some pages I find that most of the time even if the page is written in a different language (human language) the default language of the page is english. Also, I don't know if lang pertains to all web page desining (ie xml, asp etc) or just to html. I'm sorry if what I'm saying really makes no sense I'm just getting my feet wet.
If anyone can help me out I'd be most appreciative,
Umphie
The lang (http://www.w3.org/TR/REC-html40/struct/dirlang.html) attribute can be set for a web document, but as you have found out it is not always used or used correctly.
madddidley
06-10-2005, 10:12 AM
Some servers can have different file extensions. Such as index.script so you can keep the server side language hidden from user. Well, at least thats what I hear.
www.maddDidley.com
Some servers can have different file extensions. Content negotiation (http://www.w3.org/TR/WCAG10-CORE-TECHS/#content-negotiation)
Stephen Philbin
06-10-2005, 03:16 PM
If you mean language as in English, Mandarin, Russian Spanish, American ( ;) ) etc, then as has been noted there's the lang attribute, but I think you could probably use the character encoding declaration as an implicit indicator of the language used (so long as unicode or iso-10646 isn't used) and I think you might be able to specify the intended language with a meta tag too.