Skip to content

Commit 488b3ea

Browse files
committed
feat: enhance internationalization support across various components and update translations
1 parent 7287140 commit 488b3ea

8 files changed

Lines changed: 25 additions & 37 deletions

File tree

DashAI/front/src/components/generative/ImageMessage.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { Box, useTheme } from "@mui/material";
22
import { useState } from "react";
33
import { FullscreenImageChat } from "./FullscreenImageChat";
44
import api from "../../api/api";
5+
import { useTranslation } from "react-i18next";
56

67
export function ImageMessage({ image }) {
8+
const { t } = useTranslation(["common"]);
79
const theme = useTheme();
810
const [fullscreenImage, setFullscreenImage] = useState(null);
911

@@ -29,7 +31,7 @@ export function ImageMessage({ image }) {
2931
>
3032
<img
3133
src={`${api.defaults.baseURL}/v1/generative-process/image/${image}`}
32-
alt="Image"
34+
alt={t("common:image")}
3335
style={{
3436
maxWidth: "100%",
3537
maxHeight: "300px",

DashAI/front/src/components/generative/SessionBar.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
55
import InfoSessionModal from "./InfoSessionModal";
66
import Footer from "./Footer";
77
import SessionList from "./SessionList";
8-
import SessionBarHeader from "./SessionBarHeader";
98
import NewItemButton from "../threeSectionLayout/NewItemButton";
109
import SideBar from "../threeSectionLayout/SideBar";
1110
import BarHeader from "../threeSectionLayout/BarHeader";

DashAI/front/src/components/generative/SessionBarHeader.jsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

DashAI/front/src/components/notebooks/datasetCreation/TypeChangeValidator.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ export const TypeChangeValidator = ({
6161

6262
return (
6363
<Dialog open={open} onClose={onClose} maxWidth="md" fullWidth>
64-
<DialogTitle>Validate Type Changes</DialogTitle>
64+
<DialogTitle>{t("datasets:label.validateTypeChanges")}</DialogTitle>
6565
<DialogContent>
6666
{validating && (
6767
<Box display="flex" justifyContent="center" alignItems="center" p={3}>
6868
<CircularProgress />
69-
<Box ml={2}>Validating type changes...</Box>
69+
<Box ml={2}>{t("datasets:label.validatingTypeChanges")}</Box>
7070
</Box>
7171
)}
7272

7373
{!validating && validationResult && (
7474
<>
7575
{validationResult.valid ? (
7676
<Alert severity="success" icon={<CheckCircleIcon />}>
77-
All type changes are valid and can be applied safely.
77+
{t("datasets:label.allTypeChangesValid")}
7878
</Alert>
7979
) : (
8080
<>
8181
<Alert severity="error" icon={<ErrorIcon />} sx={{ mb: 2 }}>
82-
Some type changes cannot be applied:
82+
{t("datasets:label.someTypeChangesCannotBeApplied")}
8383
</Alert>
8484
<List dense>
8585
{Object.entries(validationResult.errors).map(
@@ -108,7 +108,7 @@ export const TypeChangeValidator = ({
108108
icon={<WarningIcon />}
109109
sx={{ mt: 2, mb: 1 }}
110110
>
111-
Warnings about type changes:
111+
{t("datasets:label.typeChangeWarnings")}
112112
</Alert>
113113
<List dense>
114114
{Object.entries(validationResult.warnings).map(
@@ -130,15 +130,15 @@ export const TypeChangeValidator = ({
130130
</DialogContent>
131131
<DialogActions>
132132
<Button onClick={onClose} color="inherit">
133-
Cancel
133+
{t("common:cancel")}
134134
</Button>
135135
<Button
136136
onClick={() => onConfirm(typeChanges)}
137137
disabled={!validationResult?.valid || validating}
138138
variant="contained"
139139
color="primary"
140140
>
141-
Apply Changes
141+
{t("datasets:button.applyChanges")}
142142
</Button>
143143
</DialogActions>
144144
</Dialog>

DashAI/front/src/components/notebooks/explorer/plotLayout/forms/LegendForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export default function LegendForm({ layout, handleChange }) {
3434
slotProps={{ select: { native: true } }}
3535
fullWidth
3636
>
37-
<option value="v">Vertical</option>
38-
<option value="h">Horizontal</option>
37+
<option value="v">{t("common:vertical")}</option>
38+
<option value="h">{t("common:horizontal")}</option>
3939
</TextField>
4040

4141
<Box sx={{ display: "flex", gap: 2 }}>

DashAI/front/src/utils/i18n/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const resources = {
5454
i18n.use(initReactI18next).init({
5555
resources,
5656

57-
lng: "es",
57+
lng: "en",
5858
fallbackLng: "en",
5959

6060
ns: [

DashAI/front/src/utils/i18n/locales/en/datasets.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"button": {
33
"addColorStop": "Add Color Stop",
4+
"applyChanges": "Apply Changes",
45
"createConverter": "Create Converter",
56
"createExplorer": "Create Explorer",
67
"createNotebook": "Create Notebook",
@@ -46,6 +47,7 @@
4647
"label": {
4748
"all": "all",
4849
"allowedDataTypes": "Allowed data types: <1><0></0></1>",
50+
"allTypeChangesValid": "All type changes are valid and can be applied safely.",
4951
"analysisTools": "Analysis Tools",
5052
"appliedTransformations": "Applied Transformations:",
5153
"associatedDataset": "Associated Dataset",
@@ -226,6 +228,7 @@
226228
"showLegend": "Show Legend",
227229
"showZeroLine": "{{axis}} Axis Show Zero Line",
228230
"skewness": "Skewness",
231+
"someTypeChangesCannotBeApplied": "Some type changes cannot be applied:",
229232
"startIndex": "Start Index",
230233
"stdDev": "Standard Deviation",
231234
"strongCorrelations": "Strong Correlations",
@@ -241,6 +244,7 @@
241244
"totalRows": "Total Rows",
242245
"totalRowsCount": "Total rows: {{total}}",
243246
"traceIdx": "Trace {{index}}: {{trace}}",
247+
"typeChangeWarnings": "Warnings about type changes:",
244248
"typeToSearchDatasets": "Type to search datasets...",
245249
"unique": "Unique",
246250
"uniquenessFormula": "Uniqueness = (Unique ÷ Total) x 100",
@@ -250,6 +254,8 @@
250254
"uploadAndConfigure": "Upload your dataset and configure parameters",
251255
"uploadDataset": "Upload Dataset",
252256
"uploadYourDataset": "Upload your dataset",
257+
"validateTypeChanges": "Validate Type Changes",
258+
"validatingTypeChanges": "Validating type changes...",
253259
"valueDistribution": "Value Distribution",
254260
"valueType": "Value Type",
255261
"viewMode": "View mode",

DashAI/front/src/utils/i18n/locales/es/datasets.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"button": {
33
"addColorStop": "",
4+
"applyChanges": "",
45
"createConverter": "",
56
"createExplorer": "",
67
"createNotebook": "",
@@ -48,6 +49,7 @@
4849
"label": {
4950
"all": "",
5051
"allowedDataTypes": "",
52+
"allTypeChangesValid": "",
5153
"analysisTools": "",
5254
"appliedTransformations": "",
5355
"associatedDataset": "",
@@ -230,6 +232,7 @@
230232
"showLegend": "",
231233
"showZeroLine": "",
232234
"skewness": "",
235+
"someTypeChangesCannotBeApplied": "",
233236
"startIndex": "",
234237
"stdDev": "",
235238
"strongCorrelations": "",
@@ -246,6 +249,7 @@
246249
"totalRows": "",
247250
"totalRowsCount": "",
248251
"traceIdx": "",
252+
"typeChangeWarnings": "",
249253
"typeToSearchDatasets": "",
250254
"unique": "",
251255
"uniquenessFormula": "",
@@ -255,6 +259,8 @@
255259
"uploadAndConfigure": "",
256260
"uploadDataset": "",
257261
"uploadYourDataset": "",
262+
"validateTypeChanges": "",
263+
"validatingTypeChanges": "",
258264
"valueDistribution": "",
259265
"valueType": "",
260266
"viewMode": "",

0 commit comments

Comments
 (0)