Skip to main content

Module texts

Module texts 

Source
Expand description

Texts every native runtime shows itself, the per-language tables of runtimes that fill Bern’s named placeholders, and the conversion of those placeholders to a platform’s positional format specifiers.

Constants§

FRAMEWORK_TEXTS
Strings the native runtimes show themselves, with built-in translations. Every runtime receives all of them. An argument is %@ in the texts the SwiftUI and Compose runtimes format, which convert it to their own specifier, and a {name} placeholder in the texts the GTK, WinUI 3 and Web runtimes fill by name.

Functions§

framework
A framework text in language, else in English.
framework_languages
Languages the runtime’s own strings are translated into.
positional
Convert Bern placeholders to positional format specifiers made by specifier from the 1-based position, escaping % as %%. Texts without parameters are not formatted, so only their braces are unescaped.
tables
(language, [(key, text)]) for every supported language, for the runtimes that fill Bern’s placeholders by name: the declared texts, the application’s name as app.name, the framework texts, and the weekday and month names, which fall back to English in a language Bern has none for. Texts with parameters keep their format and escapes for the runtime; the others are stored as they are shown.
translation
The text in language, else in the default language, else any.
unescape_braces
A text without parameters as it is shown: {{ and }} stand for one brace, and nothing is filled in at run time.