Add translate

This commit is contained in:
Vladislav Makhov 2020-10-14 17:30:37 +03:00
parent 7d6d7d2bc8
commit 6a6efd1109
3 changed files with 9 additions and 6 deletions

View File

@ -237,21 +237,20 @@ class SectionBodyContent extends React.Component {
removeItemFromFavorite,
getFileInfo,
fetchFavoritesFolder,
isFavorites } = this.props;
const { action,
id,
title } = e.currentTarget.dataset;
isFavorites,
t } = this.props;
const { action, id } = e.currentTarget.dataset;
switch (action) {
case "mark":
return markItemAsFavorite(+id)
.then(() => getFileInfo(id))
.then(() => toastr.success("Added to favorites"))
.then(() => toastr.success(t("MarkedAsFavorite")))
.catch(e => toastr.error(e));
case "remove":
return removeItemFromFavorite(+id)
.then(() => (isFavorites ? fetchFavoritesFolder() : getFileInfo(id)))
.then(() => toastr.success("Removed from favorites"))
.then(() => toastr.success(t("RemovedFromFavorites")))
.catch(e => toastr.error(e));
default:
return;

View File

@ -9,7 +9,9 @@
"LinkForPortalUsers": "Link for portal users",
"LinkCopySuccess": "Link has been copied to the clipboard",
"MarkAsFavorite": "Mark as favorite",
"MarkedAsFavorite": "Added to favorites",
"RemoveFromFavorites": "Remove from favorites",
"RemovedFromFavorites": "Removed from favorites",
"Edit": "Edit",
"Preview": "Preview",
"View": "View",

View File

@ -9,7 +9,9 @@
"LinkForPortalUsers": "Ссылка для пользователей портала",
"LinkCopySuccess": "Ссылка скопирована в буфер обмена",
"MarkAsFavorite": "Добавить в избранное",
"MarkedAsFavorite": "Добавлено в избранное",
"RemoveFromFavorites": "Удалить из избранного",
"RemovedFromFavorites": "Удалено из избранного",
"Edit": "Редактировать",
"Preview": "Просмотр",
"View": "Просмотр",