-
+
{RequiredBoolean(this, "", "policy.noParent")}
-
+
{JSON.stringify(this.state.policy, null, 4)}
@@ -570,9 +570,9 @@ export class PolicyEditor extends Component {
- {!this.props.embedded && }
+ {!this.props.embedded && }
{!this.state.isNew && !this.props.embedded && <>
-
+
>}
{this.state.saving && <>
diff --git a/src/components/policy-editor/UpcomingSnapshotTimes.jsx b/src/components/policy-editor/UpcomingSnapshotTimes.jsx
index b528589..969ed35 100644
--- a/src/components/policy-editor/UpcomingSnapshotTimes.jsx
+++ b/src/components/policy-editor/UpcomingSnapshotTimes.jsx
@@ -1,6 +1,7 @@
import moment from 'moment';
import React from 'react';
import { LabelColumn } from './LabelColumn';
+import i18n from '../../utils/i18n';
export function UpcomingSnapshotTimes(resolved) {
if (!resolved) {
@@ -14,11 +15,11 @@ export function UpcomingSnapshotTimes(resolved) {
const times = resolved.upcomingSnapshotTimes;
if (!times) {
- return ;
+ return ;
}
return <>
-
+
{times.map(x => - {moment(x).format('L LT')} ({moment(x).fromNow()})
)}
diff --git a/src/pages/Policies.jsx b/src/pages/Policies.jsx
index 97680eb..1edb8c5 100644
--- a/src/pages/Policies.jsx
+++ b/src/pages/Policies.jsx
@@ -248,7 +248,7 @@ export class Policies extends Component {
id: 'edit',
Header: i18n.t('feedback.header.actions'),
width: 50,
- Cell: x =>
+ Cell: x =>
}]
return <>
@@ -279,7 +279,7 @@ export class Policies extends Component {
{OptionalDirectory(this, null, "policyPath", { autoFocus: true, placeholder: i18n.t('policies.feedback.policy.find') })}
-
+
> : }
diff --git a/src/pages/Repository.jsx b/src/pages/Repository.jsx
index e8ecd47..114d7b5 100644
--- a/src/pages/Repository.jsx
+++ b/src/pages/Repository.jsx
@@ -134,7 +134,7 @@ export class Repository extends Component {
> : }
-
+
>;
}
diff --git a/src/pages/Snapshots.jsx b/src/pages/Snapshots.jsx
index 4aec6be..b1f79c6 100644
--- a/src/pages/Snapshots.jsx
+++ b/src/pages/Snapshots.jsx
@@ -167,7 +167,7 @@ export class Snapshots extends Component {
return <>
{totals}
- {x.row.original.currentTask && Details}
+ {x.row.original.currentTask && {i18n.t('feedback.header.details')}}
>;
default:
@@ -206,7 +206,7 @@ export class Snapshots extends Component {
return {moment(x.cell.value).fromNow()}
{moment(x.cell.value).isBefore(moment()) && <>
- overdue
+ {i18n.t('feedback.snapshot.status.overdue')}
>}
;
}
diff --git a/src/tests/PolicyEditor.test.jsx b/src/tests/PolicyEditor.test.jsx
index c27e461..9ceedb2 100644
--- a/src/tests/PolicyEditor.test.jsx
+++ b/src/tests/PolicyEditor.test.jsx
@@ -5,6 +5,7 @@ import { MemoryRouter } from 'react-router-dom';
import { setupAPIMock } from '../tests/api_mocks';
import moment from 'moment';
import { changeControlValue, simulateClick } from '../tests/testutils';
+import i18n from '../utils/i18n';
// Mockup for the server
let serverMock;
@@ -144,7 +145,7 @@ it('e2e', async () => {
// this will trigger resolve and will update effective field: "(Defined by this policy)"
await waitFor(() => expect(getByTestId("effective-retention.keepLatest").value).toBe("44"));
- await waitFor(() => expect(getByTestId("definition-retention.keepLatest").innerHTML).toEqual("(Defined by this policy)"));
+ await waitFor(() => expect(getByTestId("definition-retention.keepLatest").innerHTML).toEqual(i18n.t('feedback.policy.defined-by-this-policy')));
simulateClick(getByTestId('button-save'));
await waitFor(() => expect(serverMock.history.put.length).toEqual(1));
diff --git a/src/utils/uiutil.jsx b/src/utils/uiutil.jsx
index 7595829..6bd820f 100644
--- a/src/utils/uiutil.jsx
+++ b/src/utils/uiutil.jsx
@@ -273,19 +273,19 @@ export function taskStatusSymbol(task) {
switch (st) {
case "RUNNING":
return <>
- Running for {dur}
+ {i18n.t('feedback.task.running-for')} {dur}
>
case "SUCCESS":
- return Finished in {dur}
;
+ return {i18n.t('feedback.task.finished-in')} {dur}
;
case "FAILED":
- return Failed after {dur}
;
+ return {i18n.t('feedback.task.failed-after')} {dur}
;
case "CANCELED":
- return Canceled after {dur}
;
+ return {i18n.t('feedback.task.canceled-after')} {dur}
;
default:
return st;
@@ -353,7 +353,7 @@ export function isAbsolutePath(p) {
export function errorAlert(err, prefix) {
if (!prefix) {
- prefix = "Error"
+ prefix = i18n.t('feedback.error.common')
}
prefix += ": ";
@@ -393,8 +393,8 @@ export function CLIEquivalent(props) {
return <>
-
- {visible && }
+
+ {visible && }
{visible && }
>;
@@ -404,11 +404,11 @@ export function toAlgorithmOption(x, defaultID) {
let text = x.id;
if (x.id === defaultID) {
- text = x.id + " (RECOMMENDED)";
+ text = x.id + i18n.t('value.algorithm.suffix-recommended');
}
if (x.deprecated) {
- text = x.id + " (NOT RECOMMENDED)";
+ text = x.id + i18n.t('value.algorithm.suffix-not-recommended');
}
return ;