diff --git a/client/components/editor.vue b/client/components/editor.vue
index bc72daa2..1062a77c 100644
--- a/client/components/editor.vue
+++ b/client/components/editor.vue
@@ -203,7 +203,7 @@ export default {
window.onbeforeunload = () => {
if (!this.exitConfirmed && this.initContentParsed !== this.$store.get('editor/content')) {
- return 'You have unsaved edits. Are you sure you want to leave the editor?'
+ return this.$t('editor:unsavedWarning')
} else {
return undefined
}
@@ -291,7 +291,7 @@ export default {
})
if (_.get(conflictResp, 'data.pages.checkConflicts', false)) {
this.$root.$emit('saveConflict')
- throw new Error('Save conflict! Another user has already modified this page.')
+ throw new Error(this.$t('editor:conflict.warning'))
}
let resp = await this.$apollo.mutate({
diff --git a/client/components/editor/ckeditor/conflict.vue b/client/components/editor/ckeditor/conflict.vue
new file mode 100644
index 00000000..a550b0f9
--- /dev/null
+++ b/client/components/editor/ckeditor/conflict.vue
@@ -0,0 +1,129 @@
+
+ v-dialog(
+ v-model='isShown'
+ max-width='700'
+ )
+ v-card
+ .dialog-header.is-short.is-indigo
+ v-icon.mr-2(color='white') mdi-alert
+ span {{$t('editor:conflict.title')}}
+ v-card-text.pt-4
+ i18next.body-2(tag='div', path='editor:conflict.infoGeneric')
+ strong(place='authorName') {{latest.authorName}}
+ span(place='date', :title='$options.filters.moment(latest.updatedAt, `LLL`)') {{ latest.updatedAt | moment('from') }}.
+ v-btn.mt-2(outlined, color='indigo', small, :href='`/` + latest.locale + `/` + latest.path', target='_blank')
+ v-icon(left) mdi-open-in-new
+ span {{$t('editor:conflict.viewLatestVersion')}}
+ .body-2.mt-5: strong {{$t('editor:conflict.whatToDo')}}
+ .body-2.mt-1 #[v-icon(color='indigo') mdi-alpha-l-box] {{$t('editor:conflict.whatToDoLocal')}}
+ .body-2.mt-1 #[v-icon(color='indigo') mdi-alpha-r-box] {{$t('editor:conflict.whatToDoRemote')}}
+ v-card-chin
+ v-spacer
+ v-btn(text, @click='close') {{$t('common:actions.cancel')}}
+ v-btn.px-4(color='indigo', @click='useLocal', dark, :title='$t(`editor:conflict.useLocalHint`)')
+ v-icon(left) mdi-alpha-l-box
+ span {{$t('editor:conflict.useLocal')}}
+ v-dialog(
+ v-model='isRemoteConfirmDiagShown'
+ width='500'
+ )
+ template(v-slot:activator='{ on }')
+ v-btn.ml-3(color='indigo', dark, v-on='on', :title='$t(`editor:conflict.useRemoteHint`)')
+ v-icon(left) mdi-alpha-r-box
+ span {{$t('editor:conflict.useRemote')}}
+ v-card
+ .dialog-header.is-short.is-indigo
+ v-icon.mr-3(color='white') mdi-alpha-r-box
+ span {{$t('editor:conflict.overwrite.title')}}
+ v-card-text.pa-4
+ i18next.body-2(tag='div', path='editor:conflict.overwrite.description')
+ strong(place='refEditsLost') {{$t('editor:conflict.overwrite.editsLost')}}
+ v-card-chin
+ v-spacer
+ v-btn(outlined, color='indigo', @click='isRemoteConfirmDiagShown = false')
+ v-icon(left) mdi-close
+ span {{$t('common:actions.cancel')}}
+ v-btn(@click='useRemote', color='indigo', dark)
+ v-icon(left) mdi-check
+ span {{$t('common:actions.confirm')}}
+
+
+
diff --git a/client/components/editor/editor-ckeditor.vue b/client/components/editor/editor-ckeditor.vue
index abe34d7e..f08d5606 100644
--- a/client/components/editor/editor-ckeditor.vue
+++ b/client/components/editor/editor-ckeditor.vue
@@ -9,15 +9,20 @@
v-spacer
.caption Visual Editor
v-spacer
- .caption {{stats.characters}} Chars, {{stats.words}} Words
+ .caption {{$t('editor:ckeditor.stats', { chars: stats.characters, words: stats.words })}}
+ editor-conflict(v-model='isConflict', v-if='isConflict')