Spreadsheet-UX op een echte relationele engine
Deze repository wordt als momentopname gepubliceerd: een clone bevat de volledige inhoud, maar geen commitgeschiedenis.
import type { Locale } from '@wellformed/shared';
/**
* One message in every language Wellformed speaks, side by side.
*
* A message is a string, or — where a language needs to count, reorder or
* inflect — a function returning one. The function form is the whole plural
* system: `(n) => n === 1 ? 'row' : 'rows'` needs no grammar engine, and each
* language writes its own arithmetic, because "1 bestand, 2 bestanden" and
* "1 file, 2 files" do not have to agree on anything but the argument.
*
* Keeping the languages beside each other in one entry, rather than one file
* per language, is deliberate: a key cannot exist half-translated, the
* compiler enforces it, and a reviewer sees both texts in one glance.
*/
export type MessageText = string | ((...args: never[]) => string);
export type MessageEntry = Readonly<Record<Locale, MessageText>>;
export type MessageCatalog = Record<string, MessageEntry>;