diff --git a/src/app/Prototype/Prototype.js b/src/app/Prototype/Prototype.js index fd59b6e..08fb2c3 100644 --- a/src/app/Prototype/Prototype.js +++ b/src/app/Prototype/Prototype.js @@ -40,6 +40,15 @@ export default class Prototype extends Skeleton { .finally(callback) } + /** + * @param {String|Array} key + * @param {string} [fallback] + * @returns {String|Object} + */ + $lang (key, fallback = '') { + return lang(key, fallback) + } + /** * @override */ @@ -203,21 +212,21 @@ export default class Prototype extends Skeleton { this.action('add') .actionScopes(['index']) .actionPositions(['table-top']) - .actionLabel(lang('prototype.action.add.label')) + .actionLabel(this.$lang('prototype.action.add.label')) .actionIcon('add') .actionColor('primary') this.action('back') .actionScopes(['index', 'create', 'read', 'update']) .actionPositions(['form-footer']) - .actionLabel(lang('prototype.action.back.label')) + .actionLabel(this.$lang('prototype.action.back.label')) .actionIcon('reply') this.action('cancel') .actionFloatRight() .actionScopes(['index', 'create', 'read', 'update']) .actionPositions(['form-footer']) - .actionLabel(lang('prototype.action.cancel.label')) + .actionLabel(this.$lang('prototype.action.cancel.label')) .actionIcon('close') this.action('refresh') @@ -231,7 +240,7 @@ export default class Prototype extends Skeleton { .actionScopes(['create', 'update']) .actionPositions(['form-footer']) .actionFloatRight() - .actionLabel(lang('prototype.action.save.label')) + .actionLabel(this.$lang('prototype.action.save.label')) .actionIcon('save') .actionColor('primary') .actionOn('click', function () { @@ -249,20 +258,20 @@ export default class Prototype extends Skeleton { this.action('view') .actionScopes(['index']) .actionPositions(['table-top', 'table-cell']) - .actionLabel(lang('prototype.action.view.label')) + .actionLabel(this.$lang('prototype.action.view.label')) .actionIcon('visibility') this.action('edit') .actionScopes(['index']) .actionPositions(['table-top', 'table-cell']) - .actionLabel(lang('prototype.action.edit.label')) + .actionLabel(this.$lang('prototype.action.edit.label')) .actionColor('primary') .actionIcon('edit') this.action('destroy') .actionScopes(['index']) .actionPositions(['table-top', 'table-cell']) - .actionLabel(lang('prototype.action.destroy.label')) + .actionLabel(this.$lang('prototype.action.destroy.label')) .actionColor('negative') .actionIcon('delete') }