diff --git a/apps/common/mobile/lib/controller/VersionHistory.jsx b/apps/common/mobile/lib/controller/VersionHistory.jsx index 9ab3f8364f..4053437ddf 100644 --- a/apps/common/mobile/lib/controller/VersionHistory.jsx +++ b/apps/common/mobile/lib/controller/VersionHistory.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState, version } from 'react'; +import React, { useEffect, useRef } from 'react'; import { observer, inject } from "mobx-react"; import VersionHistoryView from '../view/VersionHistory'; import { f7, Sheet, Popover, View } from 'framework7-react'; @@ -92,11 +92,11 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' } f7.dialog.create({ - title: t('Settings.notcriticalErrorTitle'), - text: (opts.data.error) ? opts.data.error : t('Settings.txtErrorLoadHistory'), + title: t('Common.VersionHistory.notcriticalErrorTitle'), + text: (opts.data.error) ? opts.data.error : t('Common.VersionHistory.txtErrorLoadHistory'), buttons: [ { - text: t('Settings.textOk') + text: t('Common.VersionHistory.textOk') } ] }).open(); @@ -124,7 +124,7 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' if (!user) { user = { id: version.user.id, - username: version.user.name || t('Settings.textAnonymous'), + username: version.user.name || t('Common.VersionHistory.textAnonymous'), colorval: Asc.c_oAscArrUserColors[usersCnt], color: generateUserColor(Asc.c_oAscArrUserColors[usersCnt++]), @@ -137,7 +137,7 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' version: version.versionGroup, revision: version.version, userid: version.user.id, - username: version.user.name || t('Settings.textAnonymous'), + username: version.user.name || t('Common.VersionHistory.textAnonymous'), usercolor: user.color, created: version.created, docId: version.key, @@ -184,7 +184,7 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' if (!user) { user = { id: change.user.id, - username: change.user.name || t('Settings.textAnonymous'), + username: change.user.name || t('Common.VersionHistory.textAnonymous'), colorval: Asc.c_oAscArrUserColors[usersCnt], color: generateUserColor(Asc.c_oAscArrUserColors[usersCnt++]), }; @@ -197,7 +197,7 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' revision: version.version, changeid: i, userid: change.user.id, - username: change.user.name || t('Settings.textAnonymous'), + username: change.user.name || t('Common.VersionHistory.textAnonymous'), usercolor: user.color, created: change.created, docId: version.key, @@ -260,11 +260,11 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' if (opts.data.error) { f7.dialog.create({ - title: t('Settings.notcriticalErrorTitle'), + title: t('Common.VersionHistory.notcriticalErrorTitle'), text: opts.data.error, buttons: [ { - text: t('Settings.textOk') + text: t('Common.VersionHistory.textOk') } ] }).open(); @@ -329,15 +329,15 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory' if (isRevision) { f7.dialog.create({ - title: t('Settings.titleWarningRestoreVersion'), - text: t('Settings.textWarningRestoreVersion'), + title: t('Common.VersionHistory.titleWarningRestoreVersion'), + text: t('Common.VersionHistory.textWarningRestoreVersion'), buttons: [ { - text: t('Settings.textCancel'), + text: t('Common.VersionHistory.textCancel'), bold: true }, { - text: t('Settings.textRestore'), + text: t('Common.VersionHistory.textRestore'), onClick: () => { Common.Gateway.requestRestore(revision.revision, undefined, revision.fileType); } diff --git a/apps/common/mobile/lib/view/VersionHistory.jsx b/apps/common/mobile/lib/view/VersionHistory.jsx index ed8fa573fb..a42aa096d0 100644 --- a/apps/common/mobile/lib/view/VersionHistory.jsx +++ b/apps/common/mobile/lib/view/VersionHistory.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect } from 'react'; +import React, { useCallback } from 'react'; import { Page, Navbar, BlockTitle, List, ListItem, Icon, NavRight, Link } from "framework7-react"; import { useTranslation } from "react-i18next"; import { observer, inject } from "mobx-react"; @@ -11,7 +11,6 @@ const VersionHistoryView = inject('storeVersionHistory', 'users')(observer(props const arrVersions = historyStore.arrVersions; const currentVersion = historyStore.currentVersion; const isNavigate = props.isNavigate; - const _t = t("Settings", { returnObjects: true }); const usersVersions = historyStore.usersVersions; const handleClickRevision = useCallback(version => { @@ -22,7 +21,7 @@ const VersionHistoryView = inject('storeVersionHistory', 'users')(observer(props return ( - + {Device.phone ? @@ -40,13 +39,13 @@ const VersionHistoryView = inject('storeVersionHistory', 'users')(observer(props {arrVersions.map((version, index) => { return (
handleClickRevision(version)}> - {`${version.selected ? t('Settings.textCurrent') + ' - ' : ''} ${t('Settings.textVersion')} ${version.revision}`} + {`${version.selected ? t('Common.VersionHistory.textCurrent') + ' - ' : ''} ${t('Common.VersionHistory.textVersion')} ${version.revision}`}
user.id === version.userid).color}}>{usersStore.getInitials(version.username)}
{(version.version === currentVersion.version && !version.selected && version.canRestore) &&
- +
}
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index f19878df4b..01b50d599f 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -174,6 +174,20 @@ "textCustomColors": "Custom Colors", "textStandartColors": "Standard Colors", "textThemeColors": "Theme Colors" + }, + "VersionHistory": { + "textVersionHistory": "Version History", + "textAnonymous": "Anonymous", + "txtErrorLoadHistory": "Loading history failed", + "textVersion": "Version", + "textCurrent": "Current", + "textRestore": "Restore", + "titleWarningRestoreVersion": "Restore this version?", + "textWarningRestoreVersion": "Current file will be saved in version history.", + "textBack": "Back", + "notcriticalErrorTitle": "Warning", + "textOk": "Ok", + "textCancel": "Cancel" } }, "ContextMenu": { @@ -726,14 +740,7 @@ "txtScheme7": "Equity", "txtScheme8": "Flow", "txtScheme9": "Foundry", - "textVersionHistory": "Version History", - "textAnonymous": "Anonymous", - "txtErrorLoadHistory": "Loading history failed", - "textVersion": "Version", - "textCurrent": "Current", - "textRestore": "Restore", - "titleWarningRestoreVersion": "Restore this version?", - "textWarningRestoreVersion": "Current file will be saved in version history." + "textVersionHistory": "Version History" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",