Merge pull request #695 from Human-Connection/583-localize-tiptap-placeholder-text

Fix placeholder text not translating bug
This commit is contained in:
Wolfgang Huß 2019-05-29 08:08:29 +02:00 committed by GitHub
commit 810746f138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -327,10 +327,18 @@ export default {
},
},
},
mounted() {
this.$root.$on('changeLanguage', () => {
this.changePlaceHolderText()
})
},
beforeDestroy() {
this.editor.destroy()
},
methods: {
changePlaceHolderText() {
this.editor.extensions.options.placeholder.emptyNodeText = this.$t('editor.placeholder')
},
// navigate to the previous item
// if it's the first item, navigate to the last one
upHandler() {

View File

@ -14,7 +14,8 @@
<ds-icon
style="margin-right: 2px;"
name="globe"
/> {{ current.code.toUpperCase() }}
/>
{{ current.code.toUpperCase() }}
<ds-icon
style="margin-left: 2px"
size="xx-small"
@ -78,6 +79,7 @@ export default {
changeLanguage(locale, toggleMenu) {
this.$i18n.set(locale)
toggleMenu()
this.$root.$emit('changeLanguage')
},
matcher(locale) {
return locale === this.$i18n.locale()