diff --git a/src/app/Prototype/Contracts/Form/FormComponents.js b/src/app/Prototype/Contracts/Form/FormComponents.js index 40cbe03..fc5d750 100644 --- a/src/app/Prototype/Contracts/Form/FormComponents.js +++ b/src/app/Prototype/Contracts/Form/FormComponents.js @@ -162,6 +162,16 @@ export default { field.attrs.after = this.parseFieldAfter(field) } + if (field.attrs.label) { + field.attrs.label = this.$lang( + [ + `domains.${this.domain}.fields.${field.$key}.${field.attrs.label}`, + `domains.${this.domain}.${field.attrs.label}`, + field.attrs.label + ], + field.attrs.label + ) + } if (!field.parseInput) { field.parseInput = (value) => value } diff --git a/src/domains/Example/Test/Prototype/TestWithHooks.js b/src/domains/Example/Test/Prototype/TestWithHooks.js index a88294e..bc1dd72 100644 --- a/src/domains/Example/Test/Prototype/TestWithHooks.js +++ b/src/domains/Example/Test/Prototype/TestWithHooks.js @@ -34,7 +34,7 @@ export default class TestWithHooks extends Test { */ configureFields () { this.field('active') - .fieldIsCheckbox({ label: 'if checked will hide "Description"' }) + .fieldIsCheckbox({ label: 'active.label' }) .fieldFormWidth(45) .fieldFormOrder(3, true) .fieldOn('input', function ({ $event }) { diff --git a/src/domains/Example/Test/en-us.js b/src/domains/Example/Test/en-us.js index 5eb5b60..2e9d82e 100644 --- a/src/domains/Example/Test/en-us.js +++ b/src/domains/Example/Test/en-us.js @@ -19,6 +19,9 @@ export default { male: 'Male', female: 'Female' }, + active: { + label: 'if checked will hide "Description"' + }, actions: { goToTest: 'Go to Test' },