Allow unknown language

This commit is contained in:
Ondřej 2024-02-22 02:01:37 +01:00
parent 0efe605291
commit eade891b2d

View file

@ -59,9 +59,6 @@ export function renderText(
): string {
const nameParts = [firstName, lastName].filter(Boolean);
const name = nameParts.length > 0 ? nameParts.join(" ") : "Jana Novák";
const templateFn = templates[lang];
if (!templateFn) {
throw new Error(`WIP: Language ${lang} is not implemented`);
}
const templateFn = templates[lang] ?? templates.cs!;
return templateFn({ name, variant, gender });
}