mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix placeholder text not translating bug
- tiptap-extensions are not reactive - we must call a method to change them dynamically - emit changeLanguage event, which is listened for by the Editor component, which then calls a method to set the emptyNodeText of tiptap
This commit is contained in:
parent
27b8848892
commit
97a374fd84
@ -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() {
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user