Skip to content

Commit 5d6208f

Browse files
authored
Merge pull request #6 from mailcow/development
Development
2 parents a18fbdf + 47bfad0 commit 5d6208f

11 files changed

+436
-79
lines changed

src/components/Account/ChooseAccount.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="modal-card" style="width: 400px; max-width: 400px">
33
<header class="modal-card-head">
4-
Choose Account Type
4+
{{$t('AccountsDialog.title')}}
55
</header>
66
<section class="modal-card-body" >
77
<b-button
@@ -12,7 +12,7 @@
1212
icon-left="gmail"
1313
:disabled="is_loading"
1414
>
15-
Add a Gmail account
15+
{{$t('AccountsDialog.gmail')}}
1616
</b-button>
1717
<b-button
1818
@click="choose('microsoft')"
@@ -22,7 +22,7 @@
2222
icon-left="microsoft-windows"
2323
:disabled="is_loading"
2424
>
25-
Add an Outlook account
25+
{{$t('AccountsDialog.outlook')}}
2626
</b-button>
2727
<b-button
2828
@click="choose('generic')"
@@ -32,7 +32,7 @@
3232
icon-left="email"
3333
:disabled="is_loading"
3434
>
35-
Add an Imap/Smtp account
35+
{{$t('AccountsDialog.imap_smtp')}}
3636
</b-button>
3737
</section>
3838
<footer class="modal-card-foot">
@@ -52,7 +52,7 @@ export default {
5252
this.$emit('choose', app_name);
5353
} else {
5454
this.$buefy.toast.open({
55-
message: 'Microsoft and Google accounts are not yet supported. 😥 It will be added as soon as possible. 💪',
55+
message: this.$t('AccountsDialog.messages.coming_soon'),
5656
type: 'is-primary',
5757
position: 'is-top',
5858
queue: false

src/components/Account/ImapSmtpForm.vue

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
<template>
22
<div class="modal-card" style="width: 800px;">
33
<header class="modal-card-head">
4-
Imap/Smptp Settings
4+
{{$t('ImapSmtpDialog.title')}}
55
</header>
66
<section class="modal-card-body">
77
<b-loading :is-full-page="false" v-model="is_loading" :can-cancel="false"></b-loading>
88
<form ref="form">
9-
<b-field label="Email">
9+
<b-field :label="$t('ImapSmtpDialog.email')">
1010
<b-input
1111
type="email"
12-
placeholder="Your email"
12+
:placeholder="$t('ImapSmtpDialog.your_email')"
1313
required
1414
v-model="credentials.email"
1515
>
1616
</b-input>
1717
</b-field>
18-
<b-field label="Password">
18+
<b-field :label="$t('ImapSmtpDialog.password')">
1919
<b-input
2020
type="password"
2121
password-reveal
22-
placeholder="Your password"
22+
:placeholder="$t('ImapSmtpDialog.your_password')"
2323
required
2424
v-model="credentials.password"
2525
>
2626
</b-input>
2727
</b-field>
2828
<b-field grouped>
29-
<b-field label="Imap Host" expanded>
29+
<b-field :label="$t('ImapSmtpDialog.imap_host')" expanded>
3030
<b-input
3131
required
3232
v-model="credentials.imap_server_host"
3333
>
3434
</b-input>
3535
</b-field>
36-
<b-field label="Imap Port">
36+
<b-field :label="$t('ImapSmtpDialog.imap_port')">
3737
<b-input
3838
required
3939
type="number"
@@ -43,14 +43,14 @@
4343
</b-field>
4444
</b-field>
4545
<b-field grouped>
46-
<b-field label="Smtp Host" expanded>
46+
<b-field :label="$t('ImapSmtpDialog.smtp_host')" expanded>
4747
<b-input
4848
required
4949
v-model="credentials.smtp_server_host"
5050
>
5151
</b-input>
5252
</b-field>
53-
<b-field label="Smtp Port">
53+
<b-field :label="$t('ImapSmtpDialog.smtp_port')">
5454
<b-input
5555
required
5656
type="number"
@@ -63,8 +63,8 @@
6363

6464
</section>
6565
<footer class="modal-card-foot">
66-
<button :disabled="is_loading" class="button" type="button" @click="close">Close</button>
67-
<button :disabled="is_loading" class="button is-primary" @click="login">Login</button>
66+
<button :disabled="is_loading" class="button" type="button" @click="close">{{$t('ImapSmtpDialog.close')}}</button>
67+
<button :disabled="is_loading" class="button is-primary" @click="login">{{$t('ImapSmtpDialog.login')}}</button>
6868
</footer>
6969
</div>
7070
</template>
@@ -86,20 +86,20 @@ export default {
8686
AccountService.new_account(this.credentials)
8787
.then((resp) => {
8888
this.$store.commit('add_accounts', resp.data.user_accounts);
89-
this.$buefy.toast.open({ message: 'Created new account 🎉', type: 'is-success', position: 'is-top'});
89+
this.$buefy.toast.open({ message: this.$t('ImapSmtpDialog.messages.created'), type: 'is-success', position: 'is-top'});
9090
this.is_loading = false;
9191
this.close();
9292
}).catch(() => {
93-
this.$buefy.toast.open({ message: 'Sorry, something went be wrong, please try later 😢', type: 'is-danger', position: 'is-top'});
93+
this.$buefy.toast.open({ message: this.$t('ImapSmtpDialog.messages.error'), type: 'is-danger', position: 'is-top'});
9494
this.is_loading = false;
9595
});
9696
} else {
9797
this.$buefy.snackbar.open({
9898
duration: 2000,
99-
message: 'Please check form',
99+
message: this.$t('ImapSmtpDialog.messages.check_form'),
100100
type: 'is-danger',
101101
position: 'is-top',
102-
actionText: 'Close',
102+
actionText: this.$t('ImapSmtpDialog.messages.close'),
103103
queue: false
104104
});
105105
}

src/components/Editor.vue

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="editor">
33
<editor-menu-bar style="padding-bottom:2px" :editor="editor" v-slot="{ commands, isActive }">
44
<div>
5-
<b-tooltip label="Bold" type="is-dark" :delay="50">
5+
<b-tooltip :label="$t('Editor.bold')" type="is-dark" :delay="50">
66
<button
77
class="button is-white"
88
:class="{ 'is-active': isActive.bold() }"
@@ -12,7 +12,7 @@
1212
</button>
1313
</b-tooltip>
1414

15-
<b-tooltip label="Italics" type="is-dark" :delay="500">
15+
<b-tooltip :label="$t('Editor.italics')" type="is-dark" :delay="500">
1616
<button
1717
class="button is-white"
1818
:class="{ 'is-active': isActive.italic() }"
@@ -22,7 +22,7 @@
2222
</button>
2323
</b-tooltip>
2424

25-
<b-tooltip label="Strike-through" type="is-dark" :delay="500 ">
25+
<b-tooltip :label="$t('Editor.strike')" type="is-dark" :delay="500 ">
2626
<button
2727
class="button is-white"
2828
:class="{ 'is-active': isActive.strike() }"
@@ -32,7 +32,7 @@
3232
</button>
3333
</b-tooltip>
3434

35-
<b-tooltip label="Underline" type="is-dark" :delay="5">
35+
<b-tooltip :label="$t('Editor.underline')" type="is-dark" :delay="5">
3636
<button
3737
class="button is-white"
3838
:class="{ 'is-active': isActive.underline() }"
@@ -42,7 +42,7 @@
4242
</button>
4343
</b-tooltip>
4444

45-
<b-tooltip label="Paragraph" type="is-dark" :delay="5">
45+
<b-tooltip :label="$t('Editor.paragraph')" type="is-dark" :delay="5">
4646
<button
4747
class="button is-white"
4848
:class="{ 'is-active': isActive.paragraph() }"
@@ -52,15 +52,15 @@
5252
</button>
5353
</b-tooltip>
5454

55-
<b-tooltip label="Heading" type="is-dark" :delay="500">
55+
<b-tooltip :label="$t('Editor.heading')" type="is-dark" :delay="500">
5656
<button
5757
class="button is-white"
5858
:class="{ 'is-active': isActive.heading({ level: 3 }) }"
5959
@click="commands.heading({ level: 3 })"
6060
> <b-icon icon="format-header-3"/></button>
6161
</b-tooltip>
6262

63-
<b-tooltip label="Bullet List" type="is-dark" :delay="500">
63+
<b-tooltip :label="$t('Editor.bullet_list')" type="is-dark" :delay="500">
6464
<button
6565
class="button is-white"
6666
:class="{ 'is-active': isActive.bullet_list() }"
@@ -70,7 +70,7 @@
7070
</button>
7171
</b-tooltip>
7272

73-
<b-tooltip label="Ordered List" type="is-dark" :delay="50">
73+
<b-tooltip :label="$t('Editor.ordered_list')" type="is-dark" :delay="50">
7474
<button
7575
class="button is-white"
7676
:class="{ 'is-active': isActive.ordered_list() }"
@@ -80,7 +80,7 @@
8080
</button>
8181
</b-tooltip>
8282

83-
<b-tooltip label="Quote" type="is-dark" :delay="50">
83+
<b-tooltip :label="$t('Editor.quote')" type="is-dark" :delay="50">
8484
<button
8585
class="button is-white"
8686
:class="{ 'is-active': isActive.blockquote() }"
@@ -90,15 +90,15 @@
9090
</button>
9191
</b-tooltip>
9292

93-
<b-tooltip label="Undo" type="is-dark" :delay="50">
93+
<b-tooltip :label="$t('Editor.undo')" type="is-dark" :delay="50">
9494
<button
9595
class="button is-white"
9696
@click="commands.undo">
9797
<b-icon icon="undo"/>
9898
</button>
9999
</b-tooltip>
100100

101-
<b-tooltip label="Redo" type="is-dark" :delay="50">
101+
<b-tooltip :label="$t('Editor.redo')" type="is-dark" :delay="50">
102102
<button
103103
class="button is-white"
104104
@click="commands.redo">

src/components/Email/EmailContent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</div>
7373
</component>
7474
<div v-else class="is-justify-content-center is-align-items-center mail-content-container is-hidden-touch">
75-
<empty-state mode="envelope" text="No selected any email"></empty-state>
75+
<empty-state mode="envelope" :text="$t('Email.EmailContent.no_selected')"></empty-state>
7676
</div>
7777
</template>
7878
<script>

src/components/Email/EmailList.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<section class="email-list full-height">
33
<div class="email-messages-action">
44
<b-checkbox :value="$store.getters.get_slected_messages_count !== 0" @input="$store.commit($event ? 'select_all_message' : 'clear_selected_message')">
5-
<span v-if="$store.getters.get_slected_messages_count === 0">Select All</span>
5+
<span v-if="$store.getters.get_slected_messages_count === 0">{{$t('Email.EmailList.select_all')}}</span>
66
<span v-else class="title is-size-6">Selected {{$store.getters.get_slected_messages_count}}</span>
77
</b-checkbox>
88
<div class="block" v-if="$store.getters.get_slected_messages_count === 0">
@@ -27,7 +27,9 @@
2727
<draft-item v-else :message="message"></draft-item>
2828
</div>
2929
<div v-if="!$store.getters.email_is_loading && $store.getters.get_messages_count === 0">
30-
<h3 style="text-align: center; margin-top: 1em; text-transform: uppercase; color: #b9b8b8" class="subtitle is-4">{{$route.query.f || $route.params.folder}} BOX EMPTY</h3>
30+
<h3 style="text-align: center; margin-top: 1em; text-transform: uppercase; color: #b9b8b8" class="subtitle is-4">
31+
{{$t('Email.EmailList.empty', {'name': $route.query.f || $route.params.folder})}}
32+
</h3>
3133
</div>
3234
</section>
3335
</template>

src/components/Email/NavigationMenu.vue

+18-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<aside class="navigation-drawer" :class="{'open': $store.getters.navigation_drawer}">
33
<div class="navigation-drawer-overlay" @click="$store.dispatch('toggle_navigation')"></div>
44
<div class="block" style="padding: 1rem; margin-bottom: 0;">
5-
<b-button @click="$store.commit('change_mail_dialog', true)" type="is-primary" expanded icon-left="pencil">COMPOSE</b-button>
5+
<b-button @click="$store.commit('change_mail_dialog', true)" type="is-primary" expanded icon-left="pencil">{{$t('Email.side_menu.compose')}}</b-button>
66
</div>
77
<b-menu>
88
<b-menu-list>
@@ -16,16 +16,15 @@
1616
class="email-menu-item"
1717
>
1818
<template slot="label" class="is-hidden-tablet is-hidden-mobile">
19-
<!-- TODO : i18n with has folder.name -->
20-
{{folder.name}}
19+
{{$t('Email.Folders.' + folder.name)}}
2120
<div class="is-pulled-right email-count" :class="folder.name" v-if="folder.count && folder.count > 0">
2221
<span class="text-chip vs-chip--text">{{folder.count}}</span>
2322
</div>
2423
</template>
2524
</b-menu-item>
2625
</b-menu-list>
2726
<hr>
28-
<b-menu-list label="Folders">
27+
<b-menu-list :label="$t('Email.side_menu.folders')">
2928
<b-menu-item
3029
v-for="other in get_all_folders.other"
3130
:key="other.id"
@@ -43,7 +42,7 @@
4342
</div>
4443
</template>
4544
</b-menu-item>
46-
<b-menu-item icon="plus" class="email-menu-item" label="New Folder" @click="folder_dialog()"></b-menu-item>
45+
<b-menu-item icon="plus" class="email-menu-item" :label="$t('Email.side_menu.new_folder')" @click="folder_dialog()"></b-menu-item>
4746
</b-menu-list>
4847
</b-menu>
4948
</aside>
@@ -64,22 +63,22 @@ export default {
6463
methods: {
6564
folder_dialog (folder = null) {
6665
this.$buefy.dialog.prompt({
67-
message: folder ? 'Edit folder name 🖿' : 'Create new folder 🖿',
66+
message: folder ? this.$t('Email.NewFolderDialog.edit_title') : this.$t('Email.NewFolderDialog.title'),
6867
inputAttrs: {
6968
type: 'text',
7069
required: true,
71-
placeholder: 'Folder name',
70+
placeholder: this.$t('Email.NewFolderDialog.placeholder'),
7271
value: folder ? folder.display_name : ''
7372
},
74-
confirmText: folder ? 'Edit' : 'Create',
75-
cancelText: 'Cancel',
73+
confirmText: folder ? this.$t('Email.NewFolderDialog.edit') : this.$t('Email.NewFolderDialog.create'),
74+
cancelText: this.$t('Email.NewFolderDialog.cancel'),
7675
trapFocus: true,
7776
closeOnConfirm: false,
7877
onConfirm: (value, {close}) => {
7978
if (value.length === 0) {
8079
return false;
8180
}
82-
this.$buefy.toast.open(`Creating folder..`);
81+
this.$buefy.toast.open(this.$t('Email.NewFolderDialog.messages.creating_folder'));
8382
if (folder) {
8483
this.edit_folder(folder.id, {'display_name': value}, close);
8584
} else {
@@ -91,42 +90,42 @@ export default {
9190
new_folder(data, close) {
9291
EmailService.new_folder(data)
9392
.then(() => {
94-
this.$buefy.toast.open({'message': `Success, Created your folder 🥳`, 'type': 'is-success'});
93+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.created'), 'type': 'is-success'});
9594
this.$store.dispatch('get_folders');
9695
close();
9796
}).catch(() => {
98-
this.$buefy.toast.open({'message': `Sorry, something went be wrong! ☹️`, 'type': 'is-danger'});
97+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.error'), 'type': 'is-danger'});
9998
close();
10099
});
101100
},
102101
edit_folder (folder_id, data, {close}) {
103102
EmailService.rename_folder(folder_id, data)
104103
.then(() => {
105-
this.$buefy.toast.open({'message': `Success, Edited your folder 🥳`, 'type': 'is-success'});
104+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.edited'), 'type': 'is-success'});
106105
this.$store.dispatch('get_folders');
107106
close();
108107
}).catch(() => {
109-
this.$buefy.toast.open({'message': `Sorry, something went be wrong! ☹️`, 'type': 'is-danger'});
108+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.error'), 'type': 'is-danger'});
110109
close();
111110
});
112111
},
113112
delete_folder (folder) {
114113
this.$buefy.dialog.confirm({
115-
title: 'Deleting folder',
116-
message: 'Are you sure you want to <b>delete</b> <br />This action cannot be undone.',
114+
title: this.$t('Email.NewFolderDialog.delete_title'),
115+
message: this.$t('Email.NewFolderDialog.delete_content'),
117116
confirmText: 'Delete Folder',
118117
type: 'is-danger',
119118
hasIcon: true,
120119
onConfirm: () => {
121120
EmailService.delete_folder(folder.id)
122121
.then(() => {
123-
this.$buefy.toast.open({'message': `Success, Deleted your folder`, 'type': 'is-success'});
122+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.deleted'), 'type': 'is-success'});
124123
this.$store.dispatch('get_folders');
125124
}).catch((err) => {
126125
if (err.response.data.type === 'invalid_request_error') {
127-
this.$buefy.toast.open({'message': `Folder ${folder.display_name} cannot be deleted because it contains messages ☹️`, 'type': 'is-danger'});
126+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.delete_error', {'folder_name': folder.display_name}), 'type': 'is-danger'});
128127
} else {
129-
this.$buefy.toast.open({'message': `Sorry, something went be wrong! ☹️`, 'type': 'is-danger'});
128+
this.$buefy.toast.open({'message': this.$t('Email.NewFolderDialog.messages.error'), 'type': 'is-danger'});
130129
}
131130
});
132131
}

0 commit comments

Comments
 (0)