Lang

On this page:

Syntax

<txp:lang />

The lang tag is a single tag. Textpattern will replace this tag with the 2-letter code of the language which is set as the site’s language preference in the Languages administration panel, according to RFC 1766.

Attributes

This tag has no attributes.

Examples

Example 1: Define a document’s language

<!DOCTYPE html>
<html lang="<txp:lang />" dir="<txp:text item="lang_dir" />">
<head>
    <meta charset="utf-8">
    <title>
        <txp:page_title />
    </title>
</head>

Why you might do this? When declaring a DTD, namespace and language that a site is served, the lang attribute is useful for ensuring translators, search engines and content parsers handle the document in the correct manner.

Other tags used: page_title, text.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.