Skip to main content

Module lang_text

Module lang_text 

Source
Expand description

Human-readable literals in several languages.

Labels, comments, titles and descriptions often come in several languages ("Name"@en, "Naam"@nl). The server does not know the editor’s language, so everywhere text is shown, one language is chosen: untagged text first, then English (en, en-GB, …), then the first language found.

Structs§

LangTexts
Literals with their language tags. Insertion order is kept and duplicates are dropped.

Functions§

normalize_ws
Collapse runs of whitespace (multi-line """…""" literals) to single spaces.
term_language
Language tag of a literal term, if any.