10 lines
422 B
TypeScript
10 lines
422 B
TypeScript
import type { CharacterConfig, i18nID } from "~/types/character";
|
|
import characterConfig from '#shared/character-config.json';
|
|
import type { Localized } from "~/types/general";
|
|
|
|
const config = characterConfig as CharacterConfig;
|
|
|
|
export function getText(id?: i18nID, lang?: keyof Localized): string
|
|
{
|
|
return id ? (config.texts.hasOwnProperty(id) ? (config.texts[id] as Localized)[lang ?? "default"] ?? '' : '') : '';
|
|
} |