Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters · mod_translation
  • Reference
  • Frontend developer
  • Localization and translation
  • Template filter
  • Query
  • Language code

language

Module

mod_translation

Return the language the resource (or translated text) will be displayed in.

Example:

{{ id|language }}

The languages of the resource will be fetched and using the currently selected interface language (variable z_language) the language for the resource to be displayed in will be returned.

Edit on GitHub

Related documentation

Filters

trans_languages

Return a list of all languages present in the given translated text ( #trans{} record).

Filters

media_for_language

Filter a list of media items by their medium_language property, return the best matching with the current or given language. Only visible…

Filters

translated_texts

Check all properties of a map, list or resource. Returns a list of all properties that are translated (have a #trans{} record) and their…

Filters

language_sort_localized

Sort a list of language codes or map with languages on their localized name in the currently selected language. This is useful for…

Filters

language_dir

Return rtl or ltr depening on the direction of the language.

Filters

translation

Lookup a specific translation in a translated text. If the text is not translated then the text is returned as-is.

Filters

language_sort

Sort a list of language codes or map with languages on their sort key. Return a list of {Code, LanguageProps} pairs.

Filters

set_url_language

Change the language of an URL to another language. Useful to generate alternative URLs for a page.

Filters

is_rtl

Check if the given language is a rtl or ltr language.

GitHub © 2026 Zotonic