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) => {