i18n the delete component

parent 4decbe65
...@@ -3,18 +3,24 @@ ...@@ -3,18 +3,24 @@
</template> </template>
<script> <script>
import Translate from '../../../../Core/Assets/js/mixins/Translate'
export default { export default {
mixins: [Translate],
props: { props: {
deleteMessage: {default: "Are you sure you want to delete this record?"},
deleteTitle: {default: "Confirmation"},
rows: {default: null}, rows: {default: null},
scope: {default: null}, scope: {default: null},
}, },
data() {
return {
deleteMessage: '',
deleteTitle: '',
}
},
methods: { methods: {
deleteRow(event) { deleteRow(event) {
this.$confirm(this.deleteMessage, this.deleteTitle, { this.$confirm(this.deleteMessage, this.deleteTitle, {
confirmButtonText: 'OK', confirmButtonText: this.translate('core', 'button.delete'),
cancelButtonText: 'Cancel', cancelButtonText: this.translate('core', 'button.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let vm = this; let vm = this;
...@@ -38,10 +44,14 @@ ...@@ -38,10 +44,14 @@
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: 'Delete canceled' message: this.translate('core', 'delete cancelled')
}); });
}); });
} }
},
mounted() {
this.deleteMessage = this.translate('core', 'modal.confirmation-message');
this.deleteTitle = this.translate('core', 'modal.title');
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment