From d9ce262ffb65a3d0d77eb742e76bd201482f82e5 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Thu, 11 Jun 2020 20:17:37 +0200 Subject: [PATCH] Add placeholder translation Signed-off-by: Tilman Vatteroth --- public/locales/en.json | 1 + src/components/editor/editor-window/editor-window.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/locales/en.json b/public/locales/en.json index ef54bdc36..061340d9f 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -133,6 +133,7 @@ } }, "editor": { + "placeholder": "← Start by entering a title here\n===\nVisit /features if you don't know what to do.\nHappy hacking :)", "help": { "contacts": { "title": "Contacts", diff --git a/src/components/editor/editor-window/editor-window.tsx b/src/components/editor/editor-window/editor-window.tsx index c96817a66..afa71ee85 100644 --- a/src/components/editor/editor-window/editor-window.tsx +++ b/src/components/editor/editor-window/editor-window.tsx @@ -13,9 +13,12 @@ import 'codemirror/keymap/sublime.js' import 'codemirror/mode/gfm/gfm.js' import React, { useState } from 'react' import { Controlled as ControlledCodeMirror } from 'react-codemirror2' +import { useTranslation } from 'react-i18next' import './editor-window.scss' const EditorWindow: React.FC = () => { + const { t } = useTranslation() + const [content, setContent] = useState('') return ( { addModeClass: true, // autoRefresh: 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) => {