UNPKG

@paroicms/server

Version:
16 lines 729 B
export function getNodeTypeLabel(siteSchema, options) { const label = siteSchema.l10n[options.language]?.nodeTypes[options.typeName]?.label; return typeof label === "string" ? label : options.typeName; } export function getFieldLabel(siteSchema, options) { const { name } = options.fieldType; const fields = siteSchema.l10n[options.language]?.nodeTypes?.[options.typeName]?.fields; if (typeof fields === "string" || !fields) return name; const translations = fields[name]; if (typeof translations === "string" || !translations) return name; const label = translations.label; return typeof label === "string" ? label : name; } //# sourceMappingURL=label-translator.helper.js.map