FEAT-14b: trait vocabulary (de.character), Gerbil/sale-ad types, Charakterbogen component

This commit is contained in:
2026-06-06 09:08:46 +02:00
parent f858a02f50
commit 5b11780074
6 changed files with 157 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/** FEAT-14: map character trait KEYS (stored) <-> German LABELS (de.character.traits). */
import { de } from '../strings/de'
export const ALL_TRAITS = de.character.traits
const LABEL_BY_KEY = new Map<string, string>(de.character.traits.map((t) => [t.key, t.label]))
export function traitLabel(key: string): string {
return LABEL_BY_KEY.get(key) ?? key
}
/** Selected keys -> German labels (for display + the AI sale-text prompt). */
export function traitLabels(keys: readonly string[] | null | undefined): string[] {
return (keys ?? []).map(traitLabel)
}