forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

course-kind.ts9 lines, 442 bytesHistoryRawDownload
1import type { MessageKey } from "@/i18n/messages";
2
3// `kind` is an open string on the wire, so a value this build has no copy for
4// falls back to itself rather than rendering a missing translation key.
5const KNOWN_KINDS = new Set(["course", "study", "club"]);
6
7export function courseKindLabel(kind: string, t: (key: MessageKey) => string): string {
8 return KNOWN_KINDS.has(kind) ? t(`courses.kind.${kind}Singular` as MessageKey) : kind;
9}