Allow unknown language
This commit is contained in:
parent
0efe605291
commit
eade891b2d
1 changed files with 1 additions and 4 deletions
|
@ -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 });
|
||||
}
|
||||
|
|
Reference in a new issue