Polyglots (multi tags)

A <multi> tag (in the HTML sense of the word), usable both for templates and in content written by editors, makes it possible to select a particular piece of text based on the requested (or currently default) language.

It’s syntax is:

<multi>[fr]en français[en]in english</multi>

This means that multilingual elements can easily be written within templates without needing to use language codes and strings as discussed in previous articles in this section.

Usage by content editors

This syntax is mostly used by content editors (or through means of a data-entry plugin that does the work automatically!) to translate a site when there are only a few (2 or 3) languages to be translated. <multi> is therefore more generally used on the content creation side rather than in construction of the templates. If such a <multi> block does not contain an entry for a specified language, then the first entry within that block will be used as the default.

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

Translations : English, français