html5 – ISO Language Code Table – Language Culture Names

html5-badge-h-css3Web Development might become real challenge when it comes to creating documents in languages other your native. I can cause quite a pain to both front- and back-end developers and administrators to make sure content is being displayed correctly.

Language declaration

Language declaration is specification for full HTML document or chunk of HTML storing some content. Keep in mind it doesn’t provide any information on character encoding or  text direction (right to left or left to right), which have to be added additionally. Language declaration is often stated for:

  • Language processing
  • Text to speech converters (to localize language)
  • Selecting the right fonts
  • Selecting the spell-check dictionaries

Language in HTML Document

HTML5 standard makes Content-Language obsolete, If used, W3C’s HTML5 validator will report error as follows: “Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.”.

Right now there are other three methods to declare the language.

Pragma directive

As part of header in HTTP response, e.g. below:

Example from W3C article on Internationalization Best Practices

Lang attribute

It can be added to HTML element as lang  or a xml:lang attribute on XML documents used for example in SVG as shown below.

It could be also use on other tags, which is useful especially for content displayed in two languages next to each other.

Few language codes could also be assign to one tag being comma separated.

ISO Language Code Table / Language Culture

 

Freelance developer, IT enthusiast, blogger with entrepreneurial spirit and passion for making games

Tagged with:
, ,
Posted in
Technical, Web development
Categories