UNPKG

@paroicms/server

Version:
15 lines 740 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 fields = siteSchema.l10n[options.language]?.nodeTypes?.[options.typeName]?.fields; if (typeof fields === "string" || !fields) return options.fieldName; const translations = fields[options.typeName]; if (typeof translations === "string" || !translations) return options.fieldName; const label = translations.label; return typeof label === "string" ? label : options.fieldName; } //# sourceMappingURL=label-translator.helper.js.map