translation

master
Tudor Stanciu 2020-05-21 01:44:11 +03:00
parent 3da5ea1601
commit 584bda1997
3 changed files with 9 additions and 1 deletions

View File

@ -65,5 +65,8 @@
"SendMessageToAuthor": "Send message to author" "SendMessageToAuthor": "Send message to author"
}, },
"MessageForAuthor": "Message for author" "MessageForAuthor": "Message for author"
},
"Notifications": {
"MessageSaved": "Message saved"
} }
} }

View File

@ -56,5 +56,8 @@
"SendMessageToAuthor": "Trimite mesaj către autor" "SendMessageToAuthor": "Trimite mesaj către autor"
}, },
"MessageForAuthor": "Mesaj pentru autor" "MessageForAuthor": "Mesaj pentru autor"
},
"Notifications": {
"MessageSaved": "Mesaj salvat"
} }
} }

View File

@ -5,9 +5,11 @@ import PropTypes from "prop-types";
import MessageForAuthorDialog from "./MessageForAuthorDialog"; import MessageForAuthorDialog from "./MessageForAuthorDialog";
import { saveMessageForAuthor } from "../actionCreators"; import { saveMessageForAuthor } from "../actionCreators";
import { showInfo, showError } from "../../snackbar/actionCreators"; import { showInfo, showError } from "../../snackbar/actionCreators";
import { useTranslation } from "react-i18next";
const MessageForAuthorContainer = ({ actions, open, handleClose }) => { const MessageForAuthorContainer = ({ actions, open, handleClose }) => {
const [messageForAuthor, setMessageForAuthor] = useState(""); const [messageForAuthor, setMessageForAuthor] = useState("");
const { t } = useTranslation();
const onMessageForAuthorChanged = (event) => { const onMessageForAuthorChanged = (event) => {
const value = event.target.value; const value = event.target.value;
@ -18,7 +20,7 @@ const MessageForAuthorContainer = ({ actions, open, handleClose }) => {
actions actions
.saveMessageForAuthor(messageForAuthor) .saveMessageForAuthor(messageForAuthor)
.then((event) => { .then((event) => {
if (event.success) actions.showInfo("Message saved."); if (event.success) actions.showInfo(t("Notifications.MessageSaved"));
else actions.showError(event.message); else actions.showError(event.message);
}) })
.catch((error) => { .catch((error) => {