Expand description
The message format of translated texts: tr! and enum labels.
A text is plain words with placeholders, a subset of ICU MessageFormat:
{name}: the argument as text: text as it is, a number as Bern writes numbers, a labelled enum by its label.{name, plural, one {# episode} other {# episodes}}: the branch for the number’s plural category in the text’s language, or an exact=N;#in a branch is the number.{name, date, EEE, MMM d}: aCalendarDatewritten with the pattern:yyear,Mmonth,MMtwo-digit month,MMMandMMMMthe short and full month name,dandddthe day,EEEandEEEEthe short and full weekday; other characters as they are.{name, duration, m:ss}: a number of seconds ash,mandsfields, each doubled for two digits; the largest field written takes what the larger ones would hold.
{{ and }} are literal braces; in a plural branch } always ends the
branch, so a branch cannot hold a literal }. The names of weekdays and
months come from date_names, in every language Bern’s runtimes
speak.
Enums§
Constants§
- CALENDAR_
DATE - The name of the framework type of calendar dates.
Functions§
- calendar_
date_ def - The record of a calendar date: year, month 1–12, day 1–31.
- date_
names - The names of weekdays (from Monday) and months, short and full, in the
languages Bern’s runtimes speak, as framework texts:
bern.date.weekday.1….7,bern.date.weekday_long.N,bern.date.month.1….12,bern.date.month_long.N. - format
- Write a text in
languagewith its arguments.name(key)gives the framework texts for month and weekday names. - format_
date - Write a date with a checked pattern;
name(key)is a framework text. - format_
duration - Write a number of seconds with a checked pattern.
- missing_
plurals - Plural branches a text in
languagelacks: each category the language uses needs one, so every number has its form. - parse
- Parse a text into its pieces.
- plural_
categories - The plural categories a language’s numbers fall into: Chinese, Japanese and Korean use one form for every number; the languages Bern speaks otherwise tell one apart from the rest.
- plural_
category - The plural category of
numberinlanguage. - uses
- The arguments a text uses, in order of first use, with how each is used. An argument used two ways is listed with each.
- weekday
- The day of the week of a date, 0 for Monday.