Add en translations.

This commit is contained in:
Karel Vendla
2021-04-20 15:57:14 +03:00
parent 0b6be4d08c
commit fbae01cab8
40 changed files with 410 additions and 166 deletions

View File

@ -2,7 +2,7 @@
<div>
<div v-for="tax in taxes" :key="tax.id" class="col-sm-6">
<AppEditable :value="tax.label"
placeholder="Label"
:placeholder="$t('label')"
@change="updateTaxProp({ label: $event }, tax)"/>
<i class="material-icons md-18 float-right pointer" @click="removeTax(tax)">close</i>
<AppInput :value="tax.value" @change="updateTaxProp({ value: $event }, tax)"
@ -11,7 +11,7 @@
<div class="col-12">
<button class="btn btn-sm btn-secondary " @click="addNewTax">
<i class="material-icons md-18">add</i>
Tax
{{ $t('tax') }}
</button>
</div>
</div>
@ -23,6 +23,7 @@ import AppEditable from '@/components/form/AppEditable';
import { mapGetters } from 'vuex';
export default {
i18nOptions: { namespaces: 'team-taxes' },
components: {
AppEditable,
AppInput,
@ -37,17 +38,17 @@ export default {
this.$store.dispatch('taxes/addNewTax');
},
async removeTax(field) {
const confirmed = await this.$bvModal.msgBoxConfirm(`Delete tax ${field.label}?`, {
okTitle: 'Delete',
const confirmed = await this.$bvModal.msgBoxConfirm(`${this.$t('delete_modal.title')} ${field.label}?`, {
okTitle: this.$t('delete_modal.ok_title'),
okVariant: 'danger',
cancelTitle: 'Dismiss',
cancelTitle: this.$t('delete_modal.cancel_title'),
cancelVariant: 'btn-link',
contentClass: 'bg-base dp--24',
});
if (confirmed) {
await this.$store.dispatch('taxes/deleteTax', field.id);
try {
NotificationService.success('Deleted');
NotificationService.success(this.$t('notification_deleted'));
} catch (err) {
NotificationService.error(err.message);
}