From 584bda1997b951d59f7cefe98e2cb3ffeff97924 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Thu, 21 May 2020 01:44:11 +0300 Subject: [PATCH] translation --- public/locales/en/translations.json | 3 +++ public/locales/ro/translations.json | 3 +++ .../messageForAuthor/components/MessageForAuthorContainer.js | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 920996b..bed19cb 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -65,5 +65,8 @@ "SendMessageToAuthor": "Send message to author" }, "MessageForAuthor": "Message for author" + }, + "Notifications": { + "MessageSaved": "Message saved" } } diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index 586381d..4dd3da1 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -56,5 +56,8 @@ "SendMessageToAuthor": "Trimite mesaj către autor" }, "MessageForAuthor": "Mesaj pentru autor" + }, + "Notifications": { + "MessageSaved": "Mesaj salvat" } } diff --git a/src/features/messageForAuthor/components/MessageForAuthorContainer.js b/src/features/messageForAuthor/components/MessageForAuthorContainer.js index 6ed632c..977efd2 100644 --- a/src/features/messageForAuthor/components/MessageForAuthorContainer.js +++ b/src/features/messageForAuthor/components/MessageForAuthorContainer.js @@ -5,9 +5,11 @@ import PropTypes from "prop-types"; import MessageForAuthorDialog from "./MessageForAuthorDialog"; import { saveMessageForAuthor } from "../actionCreators"; import { showInfo, showError } from "../../snackbar/actionCreators"; +import { useTranslation } from "react-i18next"; const MessageForAuthorContainer = ({ actions, open, handleClose }) => { const [messageForAuthor, setMessageForAuthor] = useState(""); + const { t } = useTranslation(); const onMessageForAuthorChanged = (event) => { const value = event.target.value; @@ -18,7 +20,7 @@ const MessageForAuthorContainer = ({ actions, open, handleClose }) => { actions .saveMessageForAuthor(messageForAuthor) .then((event) => { - if (event.success) actions.showInfo("Message saved."); + if (event.success) actions.showInfo(t("Notifications.MessageSaved")); else actions.showError(event.message); }) .catch((error) => {