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
  • Transform
  • Collection
  • Language code

language_sort

Module

mod_translation

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

LanguageProps is a map:

#{
    fallback => [],
    language => <<"nl">>,
    language_atom => nl,
    name => <<"Nederlands">>,
    name_en => <<"Dutch">>,
    sort_key => <<"dutch">>,
    sublanguages => [
    ]
}

Edit on GitHub

Related documentation

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

set_url_language

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

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

make_list

Forces the value to a list.

Filters

vsplit_in

This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying…

Filters

reversed

Reverse a list.

Filters

language_dir

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

Filters

menu_expand

Takes a menu, or a menu resource id, and adds all haspart objects connected to the menu ids.

GitHub © 2026 Zotonic