Merge branch 'feature/translations' of https://github.com/ONLYOFFICE/AppServer into feature/translations

This commit is contained in:
Nikita Gopienko 2021-05-21 16:31:24 +03:00
commit b0e2ee5a19
4 changed files with 19 additions and 20 deletions

View File

@ -106,7 +106,6 @@
"TitleSubfolders": "Flds",
"TitleUploaded": "Uploaded",
"TooltipElementCopyMessage": "Copy {{element}}",
"TooltipElementMoveMessage": "Move {{element}}",
"TooltipElementsCopyMessage": "Copy {{element}} elements",
"TooltipElementsMoveMessage": "Move {{element}} elements",
"TrashEmptyContainerDescription": "Trash is where all the deleted files are moved. You can restore or delete them permanently by emptying Trash. ",
@ -117,4 +116,4 @@
"View": "View",
"ViewList": "List",
"ViewTiles": "Tiles"
}
}

View File

@ -106,7 +106,6 @@
"TitleSubfolders": "Папки",
"TitleUploaded": "Загружен",
"TooltipElementCopyMessage": "Скопировать {{element}}",
"TooltipElementMoveMessage": "Переместить {{element}}",
"TooltipElementsCopyMessage": "Скопировать {{element}} элемента(ов)",
"TooltipElementsMoveMessage": "Переместить {{element}} элемента(ов)",
"TrashEmptyContainerDescription": "В разделе «Корзина» находятся все удаленные файлы. Вы можете восстановить их, если они были удалены по ошибке, или удалить их навсегда. Обратите внимание, что когда вы удаляете файлы из корзины, они больше не могут быть восстановлены.",
@ -117,4 +116,4 @@
"View": "Просмотр",
"ViewList": "Список",
"ViewTiles": "Плитки"
}
}

View File

@ -33,14 +33,14 @@ const DragTooltip = (props) => {
const tooltipRef = useRef(null);
const {
t,
tooltipValue,
tooltipOptions,
iconOfDraggedFile,
isSingleItem,
item,
tooltipPageX,
tooltipPageY,
} = props;
const { label, filesCount } = tooltipValue;
const { filesCount, operationName } = tooltipOptions;
const { title } = item;
useEffect(() => {
@ -85,11 +85,15 @@ const DragTooltip = (props) => {
);
}, [title, iconOfDraggedFile]);
const tooltipLabel = tooltipValue
? isSingleItem && label === "TooltipElementMoveMessage"
const tooltipLabel = tooltipOptions
? operationName === "copy"
? isSingleItem
? t("TooltipElementCopyMessage", { element: filesCount })
: t("TooltipElementsCopyMessage", { element: filesCount })
: isSingleItem
? renderFileMoveTooltip()
: t(label, { element: filesCount })
: "";
: t("TooltipElementsMoveMessage", { element: filesCount })
: t("");
return <StyledTooltip ref={tooltipRef}>{tooltipLabel}</StyledTooltip>;
};
@ -98,7 +102,7 @@ export default inject(({ filesStore }) => {
const {
selection,
iconOfDraggedFile,
tooltipValue,
tooltipOptions,
tooltipPageX,
tooltipPageY,
} = filesStore;
@ -108,7 +112,7 @@ export default inject(({ filesStore }) => {
return {
item: selection[0],
isSingleItem,
tooltipValue,
tooltipOptions,
iconOfDraggedFile,
tooltipPageX,

View File

@ -91,7 +91,7 @@ class FilesStore {
this.startDrag = startDrag;
};
get tooltipValue() {
get tooltipOptions() {
if (!this.dragging) return null;
const selectionLength = this.selection.length;
@ -110,13 +110,10 @@ class FilesStore {
operationName = "move";
}
return operationName === "copy"
? singleElement
? { label: "TooltipElementCopyMessage", filesCount }
: { label: "TooltipElementsCopyMessage", filesCount }
: singleElement
? { label: "TooltipElementMoveMessage", filesCount }
: { label: "TooltipElementsMoveMessage", filesCount };
return {
filesCount,
operationName,
};
}
initFiles = () => {