W3Techs
advertise here
provided by
Q-Success
Home Technologies Reports API Sites Quality Users Blog Forum FAQ Search

Featured products and servicesadvertise here

Blog Categories

All

News
AddToAny
Adobe Commerce
Adobe DTM
AdRoll
Advertising Networks
Akamai
Alibaba
Amazon
Amazon Associates
Amazon CloudFront
Angular
Animate
Apache
ASP.NET
ASP.NET Ajax
Baidu Analytics
Baidu Share
Bitrix
Blogger
Bootstrap
CDNJS
CentOS
Character Encodings
China Telecom
China Unicom
Chitika
Client-side Languages
Cloudflare
Cloudflare Server
ColdFusion
Compression
Concrete CMS
Content Delivery
Content Languages
Content Management
Cookies
CSS Frameworks
Data Centers
DataLife Engine
Debian
Default Protocol Https
DigiCert
DigiCert Group
Discuz!
DNS Servers
Dojo
DoubleClick
Drupal
Elementor
Email Servers
Ensighten
Equativ
ExoClick
Facebook
Fastly
Fedora
Flash
Full Circle Studies
Gemius
Gentoo
GlobalSign
Gmail
GoDaddy Group
Google
Google +1
Google Ads
Google AdSense
Google Analytics
Google Hosted Libraries
Google Servers
Google Tag Manager
GridPane
Gunicorn
Histats
Hostinger
Hotjar
HTML
HTML5
HTTP/2
HTTP/3
IdenTrust
Image File Formats
Infolinks
IPv6
Java
JavaScript
JavaScript Libraries
Joomla
JQuery
JQuery CDN
JsDelivr
Let’s Encrypt
Liferay
LinkedIn
Linux
LiteSpeed
Lodash
Markup Languages
Matomo
Matomo Tag Manager
Meta Pixel
Microsoft
Microsoft Advertising
Microsoft-IIS
Modernizr
MooTools
New Relic
Newfold Digital Group
Nginx
Node.js
Operating Systems
OVH
PHP
Pinterest
Plesk
Plone
PNG
PopAds
PrestaShop
Prototype
Python
Quantcast
React
Red Hat
Reverse Proxies
Ruby
RunCloud
Scala
Scientific Linux
Sectigo
Server Locations
Server-side Languages
SharePoint
Shopify
Silverlight
Site Elements
Snowplow
Social Widgets
SPDY
Squarespace
SSL Certificate Authorities
Symantec Group
Tag Managers
Tailwind
Tealium
Team.blue
Tomcat
Top Level Domains
Traffic Analysis Tools
Twitter/X
TYPO3
Ubuntu
UIkit
Umeng
Underscore
United Internet
Unix
Unpkg
UTF-8
VBulletin
Web Hosting
Web Panels
Web Servers
Webflow
WhatsApp
Windows
Wix
WordPress
WordPress Jetpack
XHTML
Yandex.Direct
Yandex.Metrica
YUI Library

Content language quality alerts

Posted by Sam Soltano on 23 March 2010 in News, Content Languages

Summary:

We started analyzing the content languages of websites. It turned out that a large number of sites specify the language incorrectly, so that we introduced new types of quality alerts to indicate these problems.

Properly defining the content language of a website (that is the natural language used on the site, such as Japanese or Italian) is not as straightforward as one might think. As a matter of fact, it is a terrible mess.

Actually, in the overwhelming majority of the cases, it would be as simple as writing lang="en" in the html tag of a page. But if you start reading the corresponding standards to find out what your options are, you feel like you opened up a can of worms. It starts with the current HTML standard (4.01), being already quite aged, refers to a another document when dealing with language codes, and that other document is obsolete in the meantime, so that W3C recommends not to use it. Instead, you are expected to read W3C notes, best practice documents, study related standards and basically try to figure out yourself what would be an appropriate approach. If you read all the "further readings" on that subject, you will never have time to build a website anyway. You would read about regular and irregular codes, private use language tags, and grandfathered codes (that is not a joke, see RFC5646)

Also, it doesn't help, that the language can be defined in several places:

In the HTTP header

Content-Language: en

As attributes of HTML tags

<p lang="fr">

In various HTML meta tags, where besides the http-equiv meta tag

<meta http-equiv="content-language" content="es">

you have the rarely used Dublin Core notation meta tag

<meta name="DC.Language" content="it">

and you have the common but undefined plain language meta tag

<meta name="language" content="Russian">

If you read further, you notice that there are subtle differences, which W3C describes as "primary language" vs. "text-processing language" vs. "language of the document's intended audience". And there are un-intuitive priorities and relationships between these specifications.

If you want to be more precise in your definition of the languages, you open another Pandora's box. You learn that you may differentiate between country or region specific tags, tags that indicate dialects (take for example "sl-IT-nedis" as the specific variant of the Nadiza dialect of Slovenian that is spoken in Italy), and tags that specify scripts, which must not be confused with the character encoding of that scripts.

No wonder that some webmasters just give up and write language="português" and hope for the best. Others simply take any old code that's lying around and use it as languages code. For example, I appreciate that Switzerland is a multi-lingual country, but the number of Swiss websites supposedly written in Chamorro (language code ch) is amazing. Seems like everyone of the 47.000 people in the Mariana islands that speaks this language runs a website or two in Switzerland. Also the amount of Breton (language code br) used in Brazil and Twi (language code tw) used in Taiwan would be surprising, if we would rely on webmasters.

To be fair, natural languages are an extremely complex subject. But what web standardization bodies can make out of that is more than a typical webmaster can master.

Our new quality alerts indicate some of these problems and should help webmasters to clean up their language specifications. You find the new alerts at the end of the quality alerts overview, and, of course, on the site info page of the websites where they apply.

Share this page


About Us Disclaimer Terms of Use Privacy Policy Advertising Contact
W3Techs on   LinkedIn LinkedIn Mastodon Mastodon Bluesky Bluesky
Copyright © 2009-2025 Q-Success