diff --git a/demo/content-blocks/CallToAction.js b/demo/content-blocks/CallToAction.js index 8c1e25b3fd..ea9b7849fd 100644 --- a/demo/content-blocks/CallToAction.js +++ b/demo/content-blocks/CallToAction.js @@ -3,8 +3,8 @@ module.exports = { label: 'CTA', fields: [ { - name: 'title', - label: 'Title', + name: 'label', + label: 'Label', type: 'input', localized: true, maxLength: 100, diff --git a/src/localization/localization.plugin.js b/src/localization/localization.plugin.js index 37a7737f9d..16c70511ec 100644 --- a/src/localization/localization.plugin.js +++ b/src/localization/localization.plugin.js @@ -149,13 +149,11 @@ export default function localizationPlugin(schema, options) { } this.fallbackLocale = fallbackLocale; this.schema.eachPath((path, schemaType) => { - const isArrayOfReferences = schemaType.options.type && schemaType.options.type[0]; - const isReference = schemaType.options.ref; - if (isArrayOfReferences) { + if (schemaType.options.type instanceof Array) { this[path].forEach(doc => doc.setLocale && doc.setLocale(locale, fallbackLocale)); } - if (isReference && this[path]) { + if (schemaType.options.ref && this[path]) { this[path].setLocale && this[path].setLocale(locale, fallbackLocale); } })