Go to main content

Lang

Contents

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 website’s language in the Languages panel, according to RFC 1766.

Attributes

This tag has no attributes of its own. It accepts only the global 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>

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.

If you notice any kind of problem with this page’s construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)