The environment’s language

SPIP passes the language requested by the site visitor to the first template, which can be retrieved by using the #ENV{lang} function within a template. By default, this will be the main language of the site, but it can be changed using the #MENU_LANG form, which lists the predetermined languages for your site’s multilingual content.

Whenever you use the #MENU_LANG form, the language selected is saved in a cookie and a redirection is made for the current page with the lang URL parameter assigned to the selected language. The lang parameter that is passed will then be accessible by SPIP. It will then also be possible to use the cookie later to force the display language.

The language may otherwise be specified explicitly within a template file, by using the lang criterion:

<INCLURE{fond=A}{lang=en} />

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

Translations : English, français, Nederlands