FEAT-14b: trait vocabulary (de.character), Gerbil/sale-ad types, Charakterbogen component
This commit is contained in:
15
gerbil-manager-web/src/format/traits.ts
Normal file
15
gerbil-manager-web/src/format/traits.ts
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user