diff --git a/src/components/molecules/ActionDescriptionBox.tsx b/src/components/molecules/ActionDescriptionBox.tsx
index cad962c7..190c5838 100644
--- a/src/components/molecules/ActionDescriptionBox.tsx
+++ b/src/components/molecules/ActionDescriptionBox.tsx
@@ -3,6 +3,7 @@ import styled from 'styled-components';
import { Typography, FormControlLabel, Checkbox, Box } from '@mui/material';
import { useActionContext } from '../../context/browserActions';
import MaxunLogo from "../../assets/maxunlogo.png";
+import { useTranslation } from 'react-i18next';
const CustomBoxContainer = styled.div`
position: relative;
@@ -44,6 +45,7 @@ const Content = styled.div`
`;
const ActionDescriptionBox = () => {
+ const { t } = useTranslation();
const { getText, getScreenshot, getList, captureStage } = useActionContext() as {
getText: boolean;
getScreenshot: boolean;
@@ -52,36 +54,36 @@ const ActionDescriptionBox = () => {
};
const messages = [
- { stage: 'initial' as const, text: 'Select the list you want to extract along with the texts inside it' },
- { stage: 'pagination' as const, text: 'Select how the robot can capture the rest of the list' },
- { stage: 'limit' as const, text: 'Choose the number of items to extract' },
- { stage: 'complete' as const, text: 'Capture is complete' },
+ { stage: 'initial' as const, text: t('action_description.list_stages.initial') },
+ { stage: 'pagination' as const, text: t('action_description.list_stages.pagination') },
+ { stage: 'limit' as const, text: t('action_description.list_stages.limit') },
+ { stage: 'complete' as const, text: t('action_description.list_stages.complete') },
];
- const stages = messages.map(({ stage }) => stage); // Create a list of stages
- const currentStageIndex = stages.indexOf(captureStage); // Get the index of the current stage
+ const stages = messages.map(({ stage }) => stage);
+ const currentStageIndex = stages.indexOf(captureStage);
const renderActionDescription = () => {
if (getText) {
return (
<>
- Capture Text
- Hover over the texts you want to extract and click to select them
+ {t('action_description.text.title')}
+ {t('action_description.text.description')}
>
);
} else if (getScreenshot) {
return (
<>
- Capture Screenshot
- Capture a partial or full page screenshot of the current page.
+ {t('action_description.screenshot.title')}
+ {t('action_description.screenshot.description')}
>
);
} else if (getList) {
return (
<>
- Capture List
+ {t('action_description.list.title')}
- Hover over the list you want to extract. Once selected, you can hover over all texts inside the list you selected. Click to select them.
+ {t('action_description.list.description')}
{messages.map(({ stage, text }, index) => (
@@ -89,7 +91,7 @@ const ActionDescriptionBox = () => {
key={stage}
control={
}
@@ -102,8 +104,8 @@ const ActionDescriptionBox = () => {
} else {
return (
<>
- What data do you want to extract?
- A robot is designed to perform one action at a time. You can choose any of the options below.
+ {t('action_description.default.title')}
+ {t('action_description.default.description')}
>
);
}
@@ -111,7 +113,7 @@ const ActionDescriptionBox = () => {
return (
-
+
{renderActionDescription()}
@@ -120,4 +122,4 @@ const ActionDescriptionBox = () => {
);
};
-export default ActionDescriptionBox;
+export default ActionDescriptionBox;
\ No newline at end of file