translation
parent
3da5ea1601
commit
584bda1997
|
@ -65,5 +65,8 @@
|
|||
"SendMessageToAuthor": "Send message to author"
|
||||
},
|
||||
"MessageForAuthor": "Message for author"
|
||||
},
|
||||
"Notifications": {
|
||||
"MessageSaved": "Message saved"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,5 +56,8 @@
|
|||
"SendMessageToAuthor": "Trimite mesaj către autor"
|
||||
},
|
||||
"MessageForAuthor": "Mesaj pentru autor"
|
||||
},
|
||||
"Notifications": {
|
||||
"MessageSaved": "Mesaj salvat"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue