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

@ -0,0 +1,9 @@
{
"title": "Bank account",
"bank_name": "Bank name",
"account_no": "Bank account details",
"loading": "Loading",
"done": "Done",
"create": "Create",
"notification_updated": "Updated"
}

View File

@ -0,0 +1,6 @@
{
"loading": "Loading",
"bank": "Bank",
"bank_account_details": "Bank account details",
"add_bank_account": "Add bank account"
}

View File

@ -0,0 +1,10 @@
{
"label": "Label",
"field": "Field",
"delete_modal": {
"title": "Delete field",
"ok_title": "Delete",
"cancel_title": "Dismiss"
},
"notification_deleted": "Deleted"
}

View File

@ -0,0 +1,34 @@
{
"title": "Client",
"delete": "Delete",
"done": "Done",
"create": "Create",
"loading": "Loading",
"general": {
"title": "General",
"company_name": "Company name",
"invoice_email": "Email"
},
"invoicing": {
"title": "Invoicing",
"currency": "Currency",
"rate": "Hourly rate",
"has_tax": "Apply taxes",
"bank_account": "Bank account"
},
"address": {
"title": "Address",
"company_address": "Company address",
"company_postal_code": "Postal code",
"company_city": "City",
"company_county": "County/State",
"company_country": "Country"
},
"delete_modal": {
"title": "Delete client",
"ok_title": "Delete",
"cancel_title": "Dismiss"
},
"notification_deleted": "Deleted",
"notification_updated": "Updated"
}

View File

@ -0,0 +1,6 @@
{
"client": "Client",
"create": "Create",
"new": "new",
"suggest_placeholder": "Search client"
}

View File

@ -0,0 +1,3 @@
{
"content": "Nothing here yet"
}

View File

@ -0,0 +1,6 @@
{
"title": "Import data",
"warning": "Your current data will be erased and overwritten with the imported data!",
"button_text": "Select import file",
"import-error": "Invalid JSON format"
}

View File

@ -0,0 +1,5 @@
{
"bank_name": "Add bank",
"bank_account_no": "Add bank details",
"bank_account_modal_title": "Choose bank account"
}

View File

@ -0,0 +1,8 @@
{
"client_address": "Address",
"client_postal_code": "Postal code",
"client_city": "City",
"client_county": "County/State",
"client_country": "Country",
"client_email": "Client's email"
}

View File

@ -0,0 +1,9 @@
{
"your_company_name": "Your company name",
"address": "Address",
"postal_code": "Postal code",
"city": "City",
"county": "County/State",
"country": "Country",
"your_email": "Your email"
}

View File

@ -0,0 +1,5 @@
{
"add_website": "Add website",
"add_email": "Add email",
"add_phone": "Add phone"
}

View File

@ -0,0 +1,19 @@
{
"back": "Back",
"book": "Book",
"download_pdf": "Download PDF",
"delete": "Delete",
"delete_modal": {
"title": "Delete client",
"ok_title": "Delete",
"cancel_title": "Dismiss"
},
"statuses": {
"draft": "draft",
"booked": "booked",
"sent": "sent",
"paid": "paid",
"cancelled": "cancelled"
},
"notification_deleted": "Deleted"
}

View File

@ -0,0 +1,3 @@
{
"insert_note": "Insert note"
}

View File

@ -0,0 +1,10 @@
{
"invoice_title": "Invoice ",
"invoice_number": "No.",
"issued_at": "Issued at: ",
"due_at": "Due at",
"late_fee": "Late fee:",
"add_late_fee": "Add late fee",
"modal_issued_at_title": "Issued at"
}

View File

@ -0,0 +1,10 @@
{
"label": "Label",
"field": "Field",
"delete_modal": {
"title": "Delete field",
"ok_title": "Delete",
"cancel_title": "Dismiss"
},
"notification_delete": "Deleted"
}

View File

@ -0,0 +1,27 @@
{
"title": "Team",
"done": "Done",
"updated": "Updated",
"loading": "Loading",
"general": {
"title": "General",
"company_name": "Company Name",
"contact_email": "Email",
"contact_phone": "Phone",
"website": "Website"
},
"invoicing": {
"title": "Invoicing",
"invoice_late_fee": "Late fee (%)",
"invoice_due_days": "Payment terms, days",
"currency": "Default currency"
},
"address": {
"title": "Address",
"company_address": "Company Address",
"company_postal_code": "Postal code",
"company_city": "City",
"company_county": "County/State",
"company_country": "Country"
}
}

View File

@ -0,0 +1,7 @@
{
"modal_title": "Choose logo",
"button_text": "Select from files",
"logo_url": "Insert web url",
"logo_url_err": "Logo has to be under 512kb.",
"or": "or"
}

View File

@ -0,0 +1,10 @@
{
"label": "Label",
"tax": "Tax",
"delete_modal": {
"title": "Delete tax",
"ok_title": "Delete",
"cancel_title": "Dismiss"
},
"notification_deleted": "Deleted"
}

View File

@ -0,0 +1,8 @@
{
"lights": "Lights",
"title": "All your data is saved in your browser and not on any server.\n This application is truly serverless and only you have access to your data.",
"what_about_my_data": "What about my data? ",
"made_with": "Made with",
"by": "by",
"upgrade": "Upgrade"
}

View File

@ -1,6 +1,6 @@
<template> <template>
<div :class="`col-12 text-muted text-${align}`"> <div :class="`col-12 text-muted text-${align}`">
<small>{{ content }}</small> <small>{{ content || $t('content') }}</small>
<h4 class="mt-2">¯\_()_/¯</h4> <h4 class="mt-2">¯\_()_/¯</h4>
<slot></slot> <slot></slot>
</div> </div>
@ -8,9 +8,10 @@
<script> <script>
export default { export default {
i18nOptions: { namespaces: 'empty-state' },
props: { props: {
content: { content: {
default: 'Nothing here yet', default: null,
}, },
align: { align: {
default: 'center', default: 'center',

View File

@ -2,15 +2,15 @@
<BModal v-model="isOpen" <BModal v-model="isOpen"
centered centered
hide-footer hide-footer
title="Import data" :title="$t('title')"
size="md" size="md"
content-class="bg-base dp--24 text-center"> content-class="bg-base dp--24 text-center">
<p> <p>
<AppFileInput @selected="onSelected" button-text="Select import file"/> <AppFileInput @selected="onSelected" :button-text="$t('button_text')"/>
<AppError :errors="errors" field="file"/> <AppError :errors="errors" field="file"/>
</p> </p>
<p> <p>
<small>Your current data will be erased and overwritten with the imported data!</small> <small>{{ $t('warning') }}</small>
</p> </p>
</BModal> </BModal>
</template> </template>
@ -22,6 +22,7 @@ import Errors from '../utils/errors';
import AppError from './form/AppError'; import AppError from './form/AppError';
export default { export default {
i18nOptions: { namespaces: 'import-modal' },
components: { components: {
AppError, AppError,
AppFileInput, AppFileInput,
@ -54,7 +55,7 @@ export default {
this.close(); this.close();
} catch (e) { } catch (e) {
return this.errors.set({ return this.errors.set({
file: ['Invalid JSON format'], file: [this.$t('on-select-error')],
}); });
} }
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<footer class="col-12 d-flex justify-content-between align-items-center text-secondary px-0 mt-3 d-print-none"> <footer class="col-12 d-flex justify-content-between align-items-center text-secondary px-0 mt-3 d-print-none">
<button class="btn btn-sm text-secondary" @click="toggleTheme"> <button class="btn btn-sm text-secondary" @click="toggleTheme">
Lights {{ theme === 'dark' ? 'on' : 'off' }} {{ $t('lights') }}{{ theme === 'dark' ? 'on' : 'off' }}
<i class="material-icons material-icons-round md-14 align-text-bottom ml-1"> <i class="material-icons material-icons-round md-14 align-text-bottom ml-1">
{{ theme === 'dark' ? 'wb_sunny' : 'brightness_2' }} {{ theme === 'dark' ? 'wb_sunny' : 'brightness_2' }}
</i> </i>
@ -9,15 +9,14 @@
<LanguageSwitcher/> <LanguageSwitcher/>
<div> <div>
<small v-b-tooltip.hover <small v-b-tooltip.hover
title="All your data is saved in your browser and not on any server. :title="$t('title')"
This application is truly serverless and only you have access to your data."
class="pointer"> class="pointer">
What about my data? {{ $t('what_about_my_data') }}
</small> </small>
<small class="pl-2"> <small class="pl-2">
Made with {{ $t('made_with') }}
<i class="material-icons material-icons-round md-14 align-text-bottom">favorite</i> <i class="material-icons material-icons-round md-14 align-text-bottom">favorite</i>
by {{ $t('by') }}
<a href="https://mokuapp.io/" class="text-secondary" target="_blank">Moku</a>. <a href="https://mokuapp.io/" class="text-secondary" target="_blank">Moku</a>.
</small> </small>
<a href="https://github.com/mokuappio/serverless-invoices" <a href="https://github.com/mokuappio/serverless-invoices"
@ -32,7 +31,7 @@
</a> </a>
<a href="https://app.mokuapp.io/" <a href="https://app.mokuapp.io/"
class="btn btn-sm btn-primary ml-2" class="btn btn-sm btn-primary ml-2"
target="_blank">Upgrade</a> target="_blank">{{ $t('upgrade') }}</a>
</div> </div>
</footer> </footer>
</template> </template>
@ -43,6 +42,7 @@ import { VBTooltip } from 'bootstrap-vue';
import LanguageSwitcher from './LanguageSwitcher'; import LanguageSwitcher from './LanguageSwitcher';
export default { export default {
i18nOptions: { namespaces: 'the-footer' },
components: { LanguageSwitcher }, components: { LanguageSwitcher },
directives: { directives: {
'b-tooltip': VBTooltip, 'b-tooltip': VBTooltip,

View File

@ -2,38 +2,38 @@
<div> <div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h4>Bank account</h4> <h4>{{ $t('bank_account') }}</h4>
</div> </div>
</div> </div>
<div v-if="bankAccount" class="row"> <div v-if="bankAccount" class="row">
<AppInput :value="bankAccount.bank_name" <AppInput :value="bankAccount.bank_name"
@change="updateProp({ bank_name: $event })" @change="updateProp({ bank_name: $event })"
label="Bank name" :label="$t('bank_name')"
field="bank_name" field="bank_name"
:errors="errors" :errors="errors"
class="col-sm-10"/> class="col-sm-10"/>
<AppTextarea :value="bankAccount.account_no" <AppTextarea :value="bankAccount.account_no"
@change="updateProp({ account_no: $event })" @change="updateProp({ account_no: $event })"
label="Bank account details" :label="$t('account_no')"
field="account_no" field="account_no"
:errors="errors" :errors="errors"
class="col-12"/> class="col-12"/>
</div> </div>
<div v-else class="row"> <div v-else class="row">
<div class="col-12 pt-3"> <div class="col-12 pt-3">
<p>Loading..</p> <p>{{ $t('loading') }} ..</p>
</div> </div>
</div> </div>
<div class="row mt-3 text-right"> <div class="row mt-3 text-right">
<div class="col-12"> <div class="col-12">
<button v-if="!isNew" class="btn btn-primary" <button v-if="!isNew" class="btn btn-primary"
@click="$emit('done')">Done @click="$emit('done')">{{ $t('done') }}
</button> </button>
<button v-if="isNew" class="btn btn-primary ml-2" <button v-if="isNew" class="btn btn-primary ml-2"
:disabled="loading" :disabled="loading"
@click="createBankAccount">Create @click="createBankAccount">{{ $t('create') }}
</button> </button>
</div> </div>
</div> </div>
@ -47,6 +47,7 @@ import AppTextarea from '@/components/form/AppTextarea';
import Errors from '@/utils/errors'; import Errors from '@/utils/errors';
export default { export default {
i18nOptions: { namespaces: 'bank-account-form' },
components: { components: {
AppInput, AppInput,
AppTextarea, AppTextarea,
@ -74,7 +75,7 @@ export default {
return this.$store.dispatch('bankAccounts/updateBankAccount', props) return this.$store.dispatch('bankAccounts/updateBankAccount', props)
.then(() => { .then(() => {
NotificationService.success('Updated'); NotificationService.success(this.$t('notification_updated'));
}) })
.catch(err => this.errors.set(err.errors)); .catch(err => this.errors.set(err.errors));
}, },

View File

@ -1,37 +1,37 @@
<template> <template>
<div> <div>
<div v-if="!bankAccounts">Loading</div> <div v-if="!bankAccounts">{{ $t('loading') }}</div>
<div v-else-if="bankAccounts && bankAccounts.length > 0"> <div v-else-if="bankAccounts && bankAccounts.length > 0">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th>Bank</th> <th>{{ $t('bank') }}</th>
<th>Bank account details</th> <th>{{ $t('bank_account_details') }}</th>
<th class="text-right"></th> <th class="text-right"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="account in bankAccounts" :key="account.id" <tr v-for="account in bankAccounts" :key="account.id"
@click="onSelect(account)" :class="{pointer: $listeners.select }"> @click="onSelect(account)" :class="{pointer: $listeners.select }">
<td>{{ account.bank_name }}</td> <td>{{ account.bank_name }}</td>
<td>{{ account.account_no }}</td> <td>{{ account.account_no }}</td>
<td class="text-right"> <td class="text-right">
<i class="material-icons md-18 p-1 pointer" <i class="material-icons md-18 p-1 pointer"
@click.stop="openBankAccountModal(account)"> @click.stop="openBankAccountModal(account)">
edit edit
</i> </i>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<button class="btn btn-sm btn-link" @click="createNewAccount">Add bank account</button> <button class="btn btn-sm btn-link" @click="createNewAccount">{{ $t('add_bank_account') }}</button>
</div>
<EmptyState v-else>
<template v-slot>
<button class="btn btn-sm btn-link" @click="createNewAccount">{{ $t('add_bank_account') }}</button>
</template>
</EmptyState>
</div> </div>
<EmptyState v-else>
<template v-slot>
<button class="btn btn-sm btn-link" @click="createNewAccount">Add bank account</button>
</template>
</EmptyState>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -39,6 +39,7 @@ import { formatDate } from '@/filters/date.filter';
import EmptyState from '@/components/EmptyState'; import EmptyState from '@/components/EmptyState';
export default { export default {
i18nOptions: { namespaces: 'bank-accounts-list' },
components: { components: {
EmptyState, EmptyState,
}, },

View File

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

View File

@ -2,50 +2,51 @@
<div> <div>
<div class="row"> <div class="row">
<div class="col-12 d-flex justify-content-between"> <div class="col-12 d-flex justify-content-between">
<h4>Client</h4> <h4>{{ $t('title') }}</h4>
<div v-if="client"> <div v-if="client">
<div v-if="!isNew"> <div v-if="!isNew">
<b-dropdown variant="link" size="sm" no-caret right> <b-dropdown variant="link" size="sm" no-caret right>
<template slot="button-content"> <template slot="button-content">
<i class="material-icons">more_vert</i> <i class="material-icons">more_vert</i>
</template> </template>
<b-dropdown-item-button @click="deleteClient">Delete</b-dropdown-item-button> <b-dropdown-item-button @click="deleteClient">{{ $t('delete') }}</b-dropdown-item-button>
</b-dropdown> </b-dropdown>
<button class="btn btn-sm btn-primary" <button class="btn btn-sm btn-primary"
@click="$emit('done')">Done @click="$emit('done')">{{ $t('done') }}
</button> </button>
</div> </div>
<button v-else class="btn btn-primary ml-2" <button v-else class="btn btn-primary ml-2"
:disabled="loading" :disabled="loading"
@click="createClient">Create @click="createClient">{{ $t('create') }}
</button> </button>
</div> </div>
</div> </div>
</div> </div>
<b-tabs v-if="client" nav-class="nav-tabs--simple mb-4" active-tab-class="active" class="row"> <b-tabs v-if="client" nav-class="nav-tabs--simple mb-4" active-tab-class="active" class="row">
<b-tab title="General" class="col-12"> <b-tab :title="$t('general.title')" class="col-12">
<div class="row"> <div class="row">
<AppInput :value="client.company_name" @change="updateProp({ company_name: $event })" <AppInput :value="client.company_name" @change="updateProp({ company_name: $event })"
label="Company Name" field="company_name" :errors="errors" class="col-12"/> :label="$t('general.company_name')" field="company_name" :errors="errors" class="col-12"/>
<AppInput :value="client.invoice_email" @change="updateProp({ invoice_email: $event })" <AppInput :value="client.invoice_email" @change="updateProp({ invoice_email: $event })"
label="Email" field="invoice_email" :errors="errors" class="col-sm-7"/> :label="$t('general.invoice_email')" field="invoice_email" :errors="errors"
class="col-sm-7"/>
</div> </div>
<ClientFields class="row" :client="client"/> <ClientFields class="row" :client="client"/>
</b-tab> </b-tab>
<b-tab title="Invoicing" class="col-12"> <b-tab :title="$t('invoicing.title')" class="col-12">
<div class="row"> <div class="row">
<AppInput :value="client.currency" @change="updateProp({ currency: $event })" <AppInput :value="client.currency" @change="updateProp({ currency: $event })"
label="Currency" field="currency" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.currency')" field="currency" :errors="errors" class="col-sm-4"/>
<AppInput :value="client.rate" @change="updateProp({ rate: $event })" <AppInput :value="client.rate" @change="updateProp({ rate: $event })"
label="Hourly rate" field="rate" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.rate')" field="rate" :errors="errors" class="col-sm-4"/>
<AppCheckbox :value="client.has_tax" @input="updateProp({ has_tax: $event })" <AppCheckbox :value="client.has_tax" @input="updateProp({ has_tax: $event })"
label="Apply taxes" field="has_tax" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.has_tax')" field="has_tax" :errors="errors" class="col-sm-4"/>
<AppSelect :value="client.bank_account" <AppSelect :value="client.bank_account"
track-by="id" track-by="id"
label="Bank account" :label="$t('invoicing.bank_account')"
label-field="bank_name" label-field="bank_name"
:options="bankAccounts || []" :options="bankAccounts || []"
@input="bankAccountChanged" @input="bankAccountChanged"
@ -53,27 +54,30 @@
</div> </div>
</b-tab> </b-tab>
<b-tab title="Address" class="col-12"> <b-tab :title="$t('address.title')" class="col-12">
<div class="row"> <div class="row">
<AppInput :value="client.company_address" @change="updateProp({ company_address: $event })" <AppInput :value="client.company_address" @change="updateProp({ company_address: $event })"
label="Company Address" field="company_address" :errors="errors" :label="$t('address.company_address')" field="company_address" :errors="errors"
class="col-12"/> class="col-12"/>
<AppInput :value="client.company_postal_code" <AppInput :value="client.company_postal_code"
@change="updateProp({ company_postal_code: $event })" @change="updateProp({ company_postal_code: $event })"
label="Postal code" field="company_postal_code" :errors="errors" :label="$t('address.company_postal_code')" field="company_postal_code" :errors="errors"
class="col-sm-5"/> class="col-sm-5"/>
<AppInput :value="client.company_city" @change="updateProp({ company_city: $event })" <AppInput :value="client.company_city" @change="updateProp({ company_city: $event })"
label="City" field="company_city" :errors="errors" class="col-sm-7"/> :label="$t('address.company_city')" field="company_city" :errors="errors"
class="col-sm-7"/>
<AppInput :value="client.company_county" @change="updateProp({ company_county: $event })" <AppInput :value="client.company_county" @change="updateProp({ company_county: $event })"
label="County/State" field="company_county" :errors="errors" class="col-sm-6"/> :label="$t('address.company_county')" field="company_county" :errors="errors"
class="col-sm-6"/>
<AppInput :value="client.company_country" @change="updateProp({ company_country: $event })" <AppInput :value="client.company_country" @change="updateProp({ company_country: $event })"
label="Country" field="company_country" :errors="errors" class="col-sm-6"/> :label="$t('address.company_country')" field="company_country" :errors="errors"
class="col-sm-6"/>
</div> </div>
</b-tab> </b-tab>
</b-tabs> </b-tabs>
<div v-if="!client">Loading</div> <div v-if="!client">{{ $t('loading') }}</div>
</div> </div>
</template> </template>
<script> <script>
@ -89,6 +93,7 @@ import AppCheckbox from '@/components/form/AppCheckbox';
import ClientFields from '@/components/clients/ClientFields'; import ClientFields from '@/components/clients/ClientFields';
export default { export default {
i18nOptions: { namespaces: 'client-form' },
components: { components: {
ClientFields, ClientFields,
AppCheckbox, AppCheckbox,
@ -135,7 +140,7 @@ export default {
clientId: this.client.id, clientId: this.client.id,
}) })
.then(() => { .then(() => {
NotificationService.success('Updated'); NotificationService.success(this.$t('notification_updated'));
}) })
.catch(err => this.errors.set(err.errors)); .catch(err => this.errors.set(err.errors));
}, },
@ -164,10 +169,10 @@ export default {
}); });
}, },
async deleteClient() { async deleteClient() {
const confirmed = await this.$bvModal.msgBoxConfirm(`Delete client ${this.client.company_name}?`, { const confirmed = await this.$bvModal.msgBoxConfirm(`${this.$t('delete_modal.title')} ${this.client.company_name}?`, {
okTitle: 'Delete', okTitle: this.$t('ok_title'),
okVariant: 'danger', okVariant: 'danger',
cancelTitle: 'Dismiss', cancelTitle: this.$t('cancel_title'),
cancelVariant: 'btn-link', cancelVariant: 'btn-link',
contentClass: 'bg-base dp--24', contentClass: 'bg-base dp--24',
}); });
@ -175,7 +180,7 @@ export default {
this.$emit('done'); this.$emit('done');
await this.$store.dispatch('clients/deleteClient', this.client.id); await this.$store.dispatch('clients/deleteClient', this.client.id);
try { try {
NotificationService.success('Deleted'); NotificationService.success(this.$t('notification_deleted'));
} catch (err) { } catch (err) {
NotificationService.error(err.message); NotificationService.error(err.message);
} }

View File

@ -5,7 +5,7 @@
ref="button" ref="button"
:tabindex="tabindex" :tabindex="tabindex"
@click="toggleOpen"> @click="toggleOpen">
<span v-if="!value">Client</span> <span v-if="!value">{{ $t('client') }}</span>
<span v-else>{{ value }}</span> <span v-else>{{ value }}</span>
</div> </div>
<div class="search-popover__overlay" v-if="isOpen" @click="toggleOpen"></div> <div class="search-popover__overlay" v-if="isOpen" @click="toggleOpen"></div>
@ -13,7 +13,7 @@
class="search-popover__select" class="search-popover__select"
v-show="isOpen" v-show="isOpen"
ref="suggest" ref="suggest"
:input-props="{placeholder: 'Search client', class: 'form-control'}" :input-props="{placeholder: $t('suggest_placeholder'), class: 'form-control'}"
:suggestions="suggestions" :suggestions="suggestions"
:value="query" :value="query"
:get-suggestion-value="getSuggestionValue" :get-suggestion-value="getSuggestionValue"
@ -35,7 +35,7 @@
@click="createNewClient" @click="createNewClient"
@keydown.up="returnToSuggestions"> @keydown.up="returnToSuggestions">
<i class="material-icons material-icons-round md-18">add</i> <i class="material-icons material-icons-round md-18">add</i>
Create {{this.query ? `"${this.query}"` : 'new'}} {{ $t('create') }} {{this.query ? `"${this.query}"` : $t('new')}}
<code class="ml-2 badge badge-secondary">ctrl + enter</code> <code class="ml-2 badge badge-secondary">ctrl + enter</code>
</button> </button>
</template> </template>
@ -47,6 +47,7 @@
import { VueAutosuggest } from 'vue-autosuggest'; import { VueAutosuggest } from 'vue-autosuggest';
export default { export default {
i18nOptions: { namespaces: 'client-selector' },
components: { components: {
VueAutosuggest, VueAutosuggest,
}, },

View File

@ -6,7 +6,7 @@
:errors="errors" :errors="errors"
:disabled="true" :disabled="true"
field="bank_name" field="bank_name"
placeholder="Add bank" :placeholder="$t('bank_name')"
class="break-line"/> class="break-line"/>
</strong> </strong>
<AppEditable :value="invoice.bank_account_no" <AppEditable :value="invoice.bank_account_no"
@ -14,11 +14,11 @@
:errors="errors" :errors="errors"
:disabled="true" :disabled="true"
field="bank_account_no" field="bank_account_no"
placeholder="Add bank details" :placeholder="$t('bank_account_no')"
class="break-line"/> class="break-line"/>
<BModal id="bank_account_no" <BModal id="bank_account_no"
centered centered
title="Choose bank account" :title="$t('bank_account_modal_title')"
hide-footer hide-footer
size="lg" size="lg"
content-class="bg-base dp--24"> content-class="bg-base dp--24">
@ -32,6 +32,7 @@ import BankAccountsList from '@/components/bank-accounts/BankAccountsList';
import AppEditable from '@/components/form/AppEditable'; import AppEditable from '@/components/form/AppEditable';
export default { export default {
i18nOptions: { namespaces: 'invoice-bank-details' },
props: ['invoice', 'errors'], props: ['invoice', 'errors'],
components: { components: {
AppEditable, AppEditable,

View File

@ -6,10 +6,10 @@
</div> </div>
<AppEditable :value="invoice.client_address" <AppEditable :value="invoice.client_address"
suffix=", " suffix=", "
placeholder="Address" :placeholder="$t('client_address')"
@change="updateProp({ client_address: $event })"/> @change="updateProp({ client_address: $event })"/>
<AppEditable :value="invoice.client_postal_code" <AppEditable :value="invoice.client_postal_code"
placeholder="Postal code" :placeholder="$t('client_postal_code')"
class="break-line" class="break-line"
@change="updateProp({ client_postal_code: $event })"/> @change="updateProp({ client_postal_code: $event })"/>
<AppError :errors="errors" field="client_address"/> <AppError :errors="errors" field="client_address"/>
@ -17,14 +17,14 @@
<AppEditable :value="invoice.client_city" <AppEditable :value="invoice.client_city"
suffix=", " suffix=", "
placeholder="City" :placeholder="$t('client_city')"
@change="updateProp({ client_city: $event })"/> @change="updateProp({ client_city: $event })"/>
<AppEditable :value="invoice.client_county" <AppEditable :value="invoice.client_county"
suffix=", " suffix=", "
placeholder="County/State" :placeholder="$t('client_county')"
@change="updateProp({ client_county: $event })"/> @change="updateProp({ client_county: $event })"/>
<AppEditable :value="invoice.client_country" <AppEditable :value="invoice.client_country"
placeholder="Country" :placeholder="$t('client_country')"
class="break-line" class="break-line"
@change="updateProp({ client_country: $event })"/> @change="updateProp({ client_country: $event })"/>
<AppError :errors="errors" field="client_city"/> <AppError :errors="errors" field="client_city"/>
@ -37,7 +37,7 @@
:errors="errors" :errors="errors"
field="client_email" field="client_email"
class="break-line" class="break-line"
placeholder="Client's email" :placeholder="$t('client_email')"
@change="updateProp({ client_email: $event })"/> @change="updateProp({ client_email: $event })"/>
</div> </div>
</template> </template>
@ -48,6 +48,7 @@ import ClientSelector from '@/components/clients/ClientSelector';
import InvoiceClientFields from '@/components/invoices/InvoiceClientFields'; import InvoiceClientFields from '@/components/invoices/InvoiceClientFields';
export default { export default {
i18nOptions: { namespaces: 'invoice-client-details' },
props: ['invoice', 'errors'], props: ['invoice', 'errors'],
components: { components: {
AppError, AppError,

View File

@ -4,16 +4,16 @@
<AppEditable :value="invoice.from_name" <AppEditable :value="invoice.from_name"
:errors="errors" :errors="errors"
field="from_name" field="from_name"
placeholder="Your company name" :placeholder="$t('your_company_name')"
@change="updateProp({ from_name: $event })"/> @change="updateProp({ from_name: $event })"/>
<i class="material-icons md-18 ml-2 pointer d-print-none" @click="editTeam">edit</i> <i class="material-icons md-18 ml-2 pointer d-print-none" @click="editTeam">edit</i>
</strong> </strong>
<AppEditable :value="invoice.from_address" <AppEditable :value="invoice.from_address"
suffix=", " suffix=", "
placeholder="Address" :placeholder="$t('address')"
@change="updateProp({ from_address: $event })"/> @change="updateProp({ from_address: $event })"/>
<AppEditable :value="invoice.from_postal_code" <AppEditable :value="invoice.from_postal_code"
placeholder="Postal code" :placeholder="$t('postal_code')"
class="break-line" class="break-line"
@change="updateProp({ from_postal_code: $event })"/> @change="updateProp({ from_postal_code: $event })"/>
<AppError :errors="errors" field="from_address"/> <AppError :errors="errors" field="from_address"/>
@ -21,14 +21,14 @@
<AppEditable :value="invoice.from_city" <AppEditable :value="invoice.from_city"
suffix=", " suffix=", "
placeholder="City" :placeholder="$t('city')"
@change="updateProp({ from_city: $event })"/> @change="updateProp({ from_city: $event })"/>
<AppEditable :value="invoice.from_county" <AppEditable :value="invoice.from_county"
suffix=", " suffix=", "
placeholder="County/State" :placeholder="$t('county')"
@change="updateProp({ from_county: $event })"/> @change="updateProp({ from_county: $event })"/>
<AppEditable :value="invoice.from_country" <AppEditable :value="invoice.from_country"
placeholder="Country" :placeholder="$t('country')"
class="break-line" class="break-line"
@change="updateProp({ from_country: $event })"/> @change="updateProp({ from_country: $event })"/>
<AppError :errors="errors" field="from_city"/> <AppError :errors="errors" field="from_city"/>
@ -40,7 +40,7 @@
<AppEditable :value="invoice.from_email" <AppEditable :value="invoice.from_email"
:errors="errors" :errors="errors"
field="from_email" field="from_email"
placeholder="Your email" :placeholder="$t('your_email')"
@change="updateProp({ from_email: $event })"/> @change="updateProp({ from_email: $event })"/>
</div> </div>
</template> </template>
@ -50,6 +50,7 @@ import InvoiceTeamFields from '@/components/invoices/InvoiceTeamFields';
import AppEditable from '../form/AppEditable'; import AppEditable from '../form/AppEditable';
export default { export default {
i18nOptions: { namespaces: 'invoice-company-details' },
props: ['invoice', 'errors'], props: ['invoice', 'errors'],
components: { components: {
AppEditable, AppEditable,

View File

@ -3,19 +3,19 @@
<AppEditable :value="invoice.from_website" <AppEditable :value="invoice.from_website"
:errors="errors" :errors="errors"
field="from_website" field="from_website"
placeholder="Add website" :placeholder="$t('add_website')"
class="break-line" class="break-line"
@change="updateProp({ from_website: $event })"/> @change="updateProp({ from_website: $event })"/>
<AppEditable :value="invoice.from_email" <AppEditable :value="invoice.from_email"
:errors="errors" :errors="errors"
field="from_email" field="from_email"
placeholder="Add email" :placeholder="$t('add_email')"
class="break-line" class="break-line"
@change="updateProp({ from_email: $event })"/> @change="updateProp({ from_email: $event })"/>
<AppEditable :value="invoice.from_phone" <AppEditable :value="invoice.from_phone"
:errors="errors" :errors="errors"
field="from_phone" field="from_phone"
placeholder="Add phone" :placeholder="$t('add_phone')"
@change="updateProp({ from_phone: $event })"/> @change="updateProp({ from_phone: $event })"/>
</div> </div>
</template> </template>
@ -23,6 +23,7 @@
import AppEditable from '../form/AppEditable'; import AppEditable from '../form/AppEditable';
export default { export default {
i18nOptions: { namespaces: 'invoice-contact-details' },
props: ['invoice', 'errors'], props: ['invoice', 'errors'],
components: { components: {
AppEditable, AppEditable,

View File

@ -2,25 +2,26 @@
<div class="row" v-if="invoice"> <div class="row" v-if="invoice">
<div class="col-12 mb-4 d-flex justify-content-between align-items-start"> <div class="col-12 mb-4 d-flex justify-content-between align-items-start">
<router-link class="btn btn-sm btn-light btn--icon-left" <router-link class="btn btn-sm btn-light btn--icon-left"
:to="{name: 'invoices'}"> :to="{name: 'invoices'}">
<i class="material-icons">arrow_back</i> <i class="material-icons">arrow_back</i>
<span class="d-inline-block">Back</span> <span class="d-inline-block">{{ $t('back') }}</span>
</router-link> </router-link>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<AppSelect :value="invoice.status" <AppSelect :value="getStatusObj"
class="mb-0 mr-2 text-capitalize multiselect--capitalize" class="mb-0 mr-2 text-capitalize multiselect--capitalize"
:options="['draft', 'booked', 'sent', 'paid', 'cancelled']" :options="invoiceStatuses"
@input="updateProp({status: $event})"/> label-field="name"
@input="updateProp({status: $event.value})"/>
<button class="btn btn-sm btn-outline-dark" <button class="btn btn-sm btn-outline-dark"
v-if="invoice.status === 'draft'" v-if="invoice.status === 'draft'"
@click="bookInvoice">Book @click="bookInvoice">{{ $t('book') }}
</button> </button>
<b-dropdown variant="link" size="sm" no-caret right> <b-dropdown variant="link" size="sm" no-caret right>
<template slot="button-content"> <template slot="button-content">
<i class="material-icons">more_vert</i> <i class="material-icons">more_vert</i>
</template> </template>
<b-dropdown-item-button @click="print">Download PDF</b-dropdown-item-button> <b-dropdown-item-button @click="print">{{ $t('download_pdf') }} </b-dropdown-item-button>
<b-dropdown-item-button @click="deleteInvoice">Delete</b-dropdown-item-button> <b-dropdown-item-button @click="deleteInvoice">{{ $t('delete') }}</b-dropdown-item-button>
</b-dropdown> </b-dropdown>
</div> </div>
</div> </div>
@ -34,6 +35,7 @@ import { BDropdown, BDropdownItemButton } from 'bootstrap-vue';
import AppSelect from '@/components/form/AppSelect'; import AppSelect from '@/components/form/AppSelect';
export default { export default {
i18nOptions: { namespaces: 'invoice-controls' },
components: { components: {
BDropdown, BDropdown,
BDropdownItemButton, BDropdownItemButton,
@ -43,13 +45,36 @@ export default {
...mapGetters({ ...mapGetters({
invoice: 'invoices/invoice', invoice: 'invoices/invoice',
}), }),
getStatusObj() {
const test = this.invoiceStatuses
.find(obj => obj.value === this.invoice.status);
return test;
},
invoiceStatuses() {
return [{
value: 'draft',
name: this.$t('statuses.draft'),
}, {
value: 'booked',
name: this.$t('statuses.booked'),
}, {
value: 'sent',
name: this.$t('statuses.sent'),
}, {
value: 'paid',
name: this.$t('statuses.paid'),
}, {
value: 'cancelled',
name: this.$t('statuses.cancelled'),
}];
},
}, },
methods: { methods: {
async deleteInvoice() { async deleteInvoice() {
const confirmed = await this.$bvModal.msgBoxConfirm(`Delete invoice ${this.invoice.number}?`, { const confirmed = await this.$bvModal.msgBoxConfirm(`${this.$t('delete_modal.title')} ${this.invoice.number}?`, {
okTitle: 'Delete', okTitle: this.$t('delete_modal.ok_title'),
okVariant: 'danger', okVariant: 'danger',
cancelTitle: 'Dismiss', cancelTitle: this.$t('delete_modal.cancel_title'),
cancelVariant: 'btn-link', cancelVariant: 'btn-link',
contentClass: 'bg-base dp--24', contentClass: 'bg-base dp--24',
}); });

View File

@ -15,7 +15,7 @@
<div class="row mt-3"> <div class="row mt-3">
<AppEditable :value="invoice.notes" <AppEditable :value="invoice.notes"
class="col-12" class="col-12"
placeholder="Insert note" :placeholder="$t('insert_note')"
@change="updateProp({ notes: $event })"/> @change="updateProp({ notes: $event })"/>
</div> </div>
<div class="row"> <div class="row">
@ -54,6 +54,7 @@ import InvoiceRowsHeader from '@/components/invoices/InvoiceRowsHeader';
import InvoiceAddRowBtn from '@/components/invoices/InvoiceAddRowBtn'; import InvoiceAddRowBtn from '@/components/invoices/InvoiceAddRowBtn';
export default { export default {
i18nOptions: { namespaces: 'invoice-form' },
components: { components: {
InvoiceAddRowBtn, InvoiceAddRowBtn,
TeamLogo, TeamLogo,

View File

@ -1,17 +1,18 @@
<template> <template>
<div> <div>
<h3> <h3>
Invoice {{ $t('invoice_title') }}
<AppEditable :value="invoice.number" <AppEditable :value="invoice.number"
:errors="errors" :errors="errors"
field="number" field="number"
placeholder="NO." :placeholder="$t('invoice_number')"
@change="updateProp({ number: $event })"/> @change="updateProp({ number: $event })"/>
</h3> </h3>
Issued at: <span class="editable__item" v-b-modal.modal_issued_at>{{ invoice.issued_at | date('D. MMM YYYY', 'YYYY-MM-DD') }}</span> {{ $t('issued_at') }}
<span class="editable__item" v-b-modal.modal_issued_at>{{ invoice.issued_at | date('D. MMM YYYY', 'YYYY-MM-DD') }}</span>
<BModal id="modal_issued_at" <BModal id="modal_issued_at"
centered centered
title="Issued at" :title="$t('modal_issued_at_title')"
hide-footer hide-footer
size="sm" size="sm"
content-class="bg-base dp--24"> content-class="bg-base dp--24">
@ -21,10 +22,12 @@
:inline="true" :inline="true"
field="issued_at"/> field="issued_at"/>
</BModal> </BModal>
<br>Due at: <span class="editable__item" v-b-modal.modal_due_at>{{ invoice.due_at | date('D. MMM YYYY', 'YYYY-MM-DD') }}</span> <br>{{ $t('due_at') }}:
<span class="editable__item"
v-b-modal.modal_due_at>{{ invoice.due_at | date('D. MMM YYYY', 'YYYY-MM-DD') }}</span>
<BModal id="modal_due_at" <BModal id="modal_due_at"
centered centered
title="Due at" :title="$t('due_at')"
hide-footer hide-footer
size="sm" size="sm"
content-class="bg-base dp--24"> content-class="bg-base dp--24">
@ -34,12 +37,12 @@
:inline="true" :inline="true"
field="due_at"/> field="due_at"/>
</BModal> </BModal>
<br>Late fee: <br>{{ $t('due_at') }}
<AppEditable :value="invoice.late_fee | currency" <AppEditable :value="invoice.late_fee | currency"
:errors="errors" :errors="errors"
suffix="%" suffix="%"
field="late_fee" field="late_fee"
placeholder="Add late fee" :placeholder="$t('add_late_fee')"
@change="updateProp({ late_fee: $event })"/> @change="updateProp({ late_fee: $event })"/>
</div> </div>
</template> </template>
@ -51,6 +54,7 @@ import { formatDate } from '@/filters/date.filter';
import { formatCurrency } from '@/filters/currency.filter'; import { formatCurrency } from '@/filters/currency.filter';
export default { export default {
i18nOptions: { namespaces: 'invoice-header' },
props: ['invoice', 'errors'], props: ['invoice', 'errors'],
components: { components: {
AppEditable, AppEditable,

View File

@ -11,7 +11,7 @@
<AppEditable :value="row.quantity" <AppEditable :value="row.quantity"
:errors="errors" :errors="errors"
:field="`rows.${index}.quantity`" :field="`rows.${index}.quantity`"
:placeholder="$('enter_quantity')" :placeholder="$t('enter_quantity')"
@change="updateProp({ quantity: $event })"/> @change="updateProp({ quantity: $event })"/>
</td> </td>
<td> <td>

View File

@ -2,7 +2,7 @@
<div> <div>
<div v-for="field in team.fields" :key="field.id" class="col-sm-6"> <div v-for="field in team.fields" :key="field.id" class="col-sm-6">
<AppEditable :value="field.label" <AppEditable :value="field.label"
placeholder="Label" :placeholder="$t('label')"
@change="updateFieldProp({ label: $event }, field)"/> @change="updateFieldProp({ label: $event }, field)"/>
<i class="material-icons md-18 float-right pointer" @click="removeField(field)">close</i> <i class="material-icons md-18 float-right pointer" @click="removeField(field)">close</i>
<AppInput :value="field.value" @change="updateFieldProp({ value: $event }, field)" <AppInput :value="field.value" @change="updateFieldProp({ value: $event }, field)"
@ -11,7 +11,7 @@
<div class="col-12"> <div class="col-12">
<button class="btn btn-sm btn-secondary" @click="addNewField"> <button class="btn btn-sm btn-secondary" @click="addNewField">
<i class="material-icons md-18">add</i> <i class="material-icons md-18">add</i>
Field {{ $t('field') }}
</button> </button>
</div> </div>
</div> </div>
@ -22,6 +22,7 @@ import AppInput from '@/components/form/AppInput';
import AppEditable from '@/components/form/AppEditable'; import AppEditable from '@/components/form/AppEditable';
export default { export default {
i18nOptions: { namespaces: 'team-fields' },
props: ['team'], props: ['team'],
components: { components: {
AppEditable, AppEditable,
@ -32,17 +33,17 @@ export default {
this.$store.dispatch('teamFields/addNewField', this.team.id); this.$store.dispatch('teamFields/addNewField', this.team.id);
}, },
async removeField(field) { async removeField(field) {
const confirmed = await this.$bvModal.msgBoxConfirm(`Delete field ${field.label}?`, { const confirmed = await this.$bvModal.msgBoxConfirm(`${this.$t('delete_modal.title')} ${field.label}?`, {
okTitle: 'Delete', okTitle: this.$t('delete_modal.ok_title'),
okVariant: 'danger', okVariant: 'danger',
cancelTitle: 'Dismiss', cancelTitle: this.$t('delete_modal.cancel_title'),
cancelVariant: 'btn-link', cancelVariant: 'btn-link',
contentClass: 'bg-base dp--24', contentClass: 'bg-base dp--24',
}); });
if (confirmed) { if (confirmed) {
await this.$store.dispatch('teamFields/deleteTeamField', field.id); await this.$store.dispatch('teamFields/deleteTeamField', field.id);
try { try {
NotificationService.success('Deleted'); NotificationService.success(this.$t('notification_delete'));
} catch (err) { } catch (err) {
NotificationService.error(err.message); NotificationService.error(err.message);
} }

View File

@ -2,62 +2,62 @@
<div> <div>
<div class="row"> <div class="row">
<div class="col-12 d-flex justify-content-between"> <div class="col-12 d-flex justify-content-between">
<h4>Team</h4> <h4>{{ $t('title') }}</h4>
<div v-if="team"> <div v-if="team">
<button class="btn btn-sm btn-primary" <button class="btn btn-sm btn-primary"
@click="$emit('done')">Done @click="$emit('done')">{{ $t('done') }}
</button> </button>
</div> </div>
</div> </div>
</div> </div>
<b-tabs v-if="team" nav-class="nav-tabs--simple mb-4" active-tab-class="active" class="row"> <b-tabs v-if="team" nav-class="nav-tabs--simple mb-4" active-tab-class="active" class="row">
<b-tab title="General" class="col-12"> <b-tab :title="$t('general.title')" class="col-12">
<div class="row"> <div class="row">
<TeamLogo :errors="errors" class="col-sm-4"/> <TeamLogo :errors="errors" class="col-sm-4"/>
</div> </div>
<div class="row"> <div class="row">
<AppInput :value="team.company_name" @change="updateProp({ company_name: $event })" <AppInput :value="team.company_name" @change="updateProp({ company_name: $event })"
label="Company Name" field="company_name" :errors="errors" class="col-12"/> :label="$t('general.company_name')" field="company_name" :errors="errors" class="col-12"/>
<AppInput :value="team.contact_email" @change="updateProp({ contact_email: $event })" <AppInput :value="team.contact_email" @change="updateProp({ contact_email: $event })"
label="Email" field="contact_email" :errors="errors" class="col-sm-7"/> :label="$t('email')" field="contact_email" :errors="errors" class="col-sm-7"/>
<AppInput :value="team.contact_phone" @change="updateProp({ contact_phone: $event })" <AppInput :value="team.contact_phone" @change="updateProp({ contact_phone: $event })"
label="Phone" field="contact_phone" :errors="errors" class="col-sm-7"/> :label="$t('contact_phone')" field="contact_phone" :errors="errors" class="col-sm-7"/>
<AppInput :value="team.website" @change="updateProp({ website: $event })" <AppInput :value="team.website" @change="updateProp({ website: $event })"
label="Website" field="website" :errors="errors" class="col-sm-7"/> :label="$t('website')" field="website" :errors="errors" class="col-sm-7"/>
</div> </div>
<TeamFields class="row" :team="team"/> <TeamFields class="row" :team="team"/>
</b-tab> </b-tab>
<b-tab title="Invoicing" class="col-12"> <b-tab :title="$t('invoicing.title')" class="col-12">
<div class="row"> <div class="row">
<AppInput :value="team.invoice_late_fee" @change="updateProp({ invoice_late_fee: $event })" <AppInput :value="team.invoice_late_fee" @change="updateProp({ invoice_late_fee: $event })"
type="number" type="number"
label="Late fee (%)" field="invoice_late_fee" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.invoice_late_fee')" field="invoice_late_fee" :errors="errors" class="col-sm-4"/>
<AppInput :value="team.invoice_due_days" @change="updateProp({ invoice_due_days: $event })" <AppInput :value="team.invoice_due_days" @change="updateProp({ invoice_due_days: $event })"
type="number" type="number"
label="Payment terms, days" field="invoice_due_days" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.invoice_due_days')" field="invoice_due_days" :errors="errors" class="col-sm-4"/>
<AppInput :value="team.currency" @change="updateProp({ currency: $event })" <AppInput :value="team.currency" @change="updateProp({ currency: $event })"
label="Default currency" field="currency" :errors="errors" class="col-sm-4"/> :label="$t('invoicing.currency')" field="currency" :errors="errors" class="col-sm-4"/>
</div> </div>
</b-tab> </b-tab>
<b-tab title="Address" class="col-12"> <b-tab :title="$t('address.title')" class="col-12">
<div class="row"> <div class="row">
<AppInput :value="team.company_address" @change="updateProp({ company_address: $event })" <AppInput :value="team.company_address" @change="updateProp({ company_address: $event })"
label="Company Address" field="company_address" :errors="errors" :label="$t('address.company_address')" field="company_address" :errors="errors"
class="col-12"/> class="col-12"/>
<AppInput :value="team.company_postal_code" <AppInput :value="team.company_postal_code"
@change="updateProp({ company_postal_code: $event })" @change="updateProp({ company_postal_code: $event })"
label="Postal code" field="company_postal_code" :errors="errors" :label="$t('address.company_postal_code')" field="company_postal_code" :errors="errors"
class="col-sm-5"/> class="col-sm-5"/>
<AppInput :value="team.company_city" @change="updateProp({ company_city: $event })" <AppInput :value="team.company_city" @change="updateProp({ company_city: $event })"
label="City" field="company_city" :errors="errors" class="col-sm-7"/> :label="$t('address.company_city')" field="company_city" :errors="errors" class="col-sm-7"/>
<AppInput :value="team.company_county" @change="updateProp({ company_county: $event })" <AppInput :value="team.company_county" @change="updateProp({ company_county: $event })"
label="County/State" field="company_county" :errors="errors" class="col-sm-6"/> :label="$t('address.company_county')" field="company_county" :errors="errors" class="col-sm-6"/>
<AppInput :value="team.company_country" @change="updateProp({ company_country: $event })" <AppInput :value="team.company_country" @change="updateProp({ company_country: $event })"
label="Country" field="company_country" :errors="errors" class="col-sm-6"/> :label="$t('address.company_country')" field="company_country" :errors="errors" class="col-sm-6"/>
</div> </div>
</b-tab> </b-tab>
@ -67,7 +67,7 @@
</b-tabs> </b-tabs>
<div v-if="!team">Loading</div> <div v-if="!team">{{ $t('loading') }}</div>
</div> </div>
</template> </template>
<script> <script>
@ -83,6 +83,7 @@ import TeamLogo from '@/components/team/TeamLogo';
import TeamTaxes from '@/components/team/TeamTaxes'; import TeamTaxes from '@/components/team/TeamTaxes';
export default { export default {
i18nOptions: { namespaces: 'team-form' },
components: { components: {
TeamLogo, TeamLogo,
TeamFields, TeamFields,
@ -108,7 +109,7 @@ export default {
this.$store.dispatch('teams/updateTeam', props) this.$store.dispatch('teams/updateTeam', props)
.then(() => { .then(() => {
NotificationService.success('Updated'); NotificationService.success(this.$t('updated'));
}) })
.catch(err => this.errors.set(err.errors)); .catch(err => this.errors.set(err.errors));
}, },

View File

@ -10,17 +10,17 @@
<AppError :errors="errors" field="logo_url"/> <AppError :errors="errors" field="logo_url"/>
<BModal v-model="isModalOpen" <BModal v-model="isModalOpen"
centered centered
title="Choose logo" :title="$t('modal_title')"
hide-footer hide-footer
size="sm" size="sm"
content-class="bg-base dp--24 text-center"> content-class="bg-base dp--24 text-center">
<AppFileInput accept="image/*" class="mb-4" @selected="logoSelected" <AppFileInput accept="image/*" class="mb-4" @selected="logoSelected"
button-text="Select from files" output-type="base64"/> :button-text="$t('button_text')" output-type="base64"/>
or {{ $t('or') }}
<AppInput :value="team.logo_url" <AppInput :value="team.logo_url"
class="mt-4" class="mt-4"
@change="updateTeam({ logo_url: $event })" @change="updateTeam({ logo_url: $event })"
label="Insert web url" :label="$t('logo_url')"
field="logo_url" field="logo_url"
:errors="errors" :errors="errors"
type="url"/> type="url"/>
@ -35,6 +35,7 @@ import AppInput from '@/components/form/AppInput';
import AppFileInput from '@/components/form/AppFileInput'; import AppFileInput from '@/components/form/AppFileInput';
export default { export default {
i18nOptions: { namespaces: 'team-logo' },
props: ['errors'], props: ['errors'],
components: { components: {
AppFileInput, AppFileInput,
@ -59,7 +60,7 @@ export default {
logoSelected(payload) { logoSelected(payload) {
this.errors.clear(); this.errors.clear();
if (payload.size / 1000 > 512) { if (payload.size / 1000 > 512) {
return this.errors.set({ logo_url: ['Logo has to be under 512kb.'] }); return this.errors.set({ logo_url: [this.$t('logo_url_err')] });
} }
this.updateTeam({ logo_url: payload.content }); this.updateTeam({ logo_url: payload.content });
}, },

View File

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

View File

@ -15,7 +15,7 @@ const initialized = i18next.init({
fallbackLng: 'en', fallbackLng: 'en',
whitelist: ['en', 'et'], whitelist: ['en', 'et'],
backend: { backend: {
loadPath: 'locales/{{lng}}/{{ns}}.json', loadPath: `${window.location.origin}/locales/{{lng}}/{{ns}}.json`,
}, },
detection: { detection: {
order: ['querystring', 'path', 'localStorage', 'navigator'], order: ['querystring', 'path', 'localStorage', 'navigator'],