Add placeholder translation

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-06-11 20:17:37 +02:00 committed by mrdrogdrog
parent e887dbb9d0
commit d9ce262ffb
2 changed files with 5 additions and 1 deletions

View file

@ -133,6 +133,7 @@
} }
}, },
"editor": { "editor": {
"placeholder": "← Start by entering a title here\n===\nVisit /features if you don't know what to do.\nHappy hacking :)",
"help": { "help": {
"contacts": { "contacts": {
"title": "Contacts", "title": "Contacts",

View file

@ -13,9 +13,12 @@ import 'codemirror/keymap/sublime.js'
import 'codemirror/mode/gfm/gfm.js' import 'codemirror/mode/gfm/gfm.js'
import React, { useState } from 'react' import React, { useState } from 'react'
import { Controlled as ControlledCodeMirror } from 'react-codemirror2' import { Controlled as ControlledCodeMirror } from 'react-codemirror2'
import { useTranslation } from 'react-i18next'
import './editor-window.scss' import './editor-window.scss'
const EditorWindow: React.FC = () => { const EditorWindow: React.FC = () => {
const { t } = useTranslation()
const [content, setContent] = useState<string>('') const [content, setContent] = useState<string>('')
return ( return (
<ControlledCodeMirror <ControlledCodeMirror
@ -51,7 +54,7 @@ const EditorWindow: React.FC = () => {
addModeClass: true, addModeClass: true,
// autoRefresh: true, // autoRefresh: true,
// otherCursors: true // otherCursors: true
placeholder: "← Start by entering a title here\n===\nVisit /features if you don't know what to do.\nHappy hacking :)" placeholder: t('editor.placeholder')
} }
} }
onBeforeChange={(editor, data, value) => { onBeforeChange={(editor, data, value) => {