#LANG displays the language code taken from the element that is closest to the tag. If the tag is located within a loop, #LANG will return the SQL "lang" field from the loop if it exists, otherwise it will return that of the (#ENV{lang}) environment, and failing that the language code for the site’s main language (#CONFIG{langue_site}).

#LANG* is used to return only the language of the loop or the environment. If none is defined, then the tag doesn’t return anything (that is, it doesn’t even return the site’s main language).


Define the language in the HTML tag for the page:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" lang="#LANG" dir="#LANG_DIR">

Define the language in an RSS feed (an example from squelettes-dist/backend.html) :

<rss version="2.0"
<channel[ xml:lang="(#LANG)"]>
	<generator>SPIP - www.spip.net</generator>

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français, Nederlands