diff --git a/n18n.config.js b/n18n.config.js index 28b1050e..086c650c 100644 --- a/n18n.config.js +++ b/n18n.config.js @@ -3,7 +3,19 @@ const supportedLngs = ['en', 'pt']; export const ni18nConfig = { fallbackLng: supportedLngs, supportedLngs, - ns: ['translation', 'home', 'about', 'sidebar', 'settings', 'releases', 'repositories', 'overview'], + ns: [ + 'translation', + 'home', + 'about', + 'sidebar', + 'settings', + 'releases', + 'repositories', + 'overview', + 'header', + 'lates_value_table', + 'graphic_chart' + ], react: { useSuspense: false } diff --git a/public/locales/en/graphic_chart.json b/public/locales/en/graphic_chart.json new file mode 100644 index 00000000..527ca0c6 --- /dev/null +++ b/public/locales/en/graphic_chart.json @@ -0,0 +1,4 @@ +{ + "error": "An error occurred while trying to load the information", + "noData": "No data available to display" +} diff --git a/public/locales/en/header.json b/public/locales/en/header.json new file mode 100644 index 00000000..a3795409 --- /dev/null +++ b/public/locales/en/header.json @@ -0,0 +1,10 @@ +{ + "repository": "Repository", + "edit_intervals": "Edit Intervals", + "cancel": "Cancel", + "save": "Save", + "warning_message": "Attention: This configuration will be applied to all product repositories.", + "error_message": "An error occurred while trying to load the information.", + "update_success": "Intervals updated successfully!", + "update_error": "Error updating intervals!" +} diff --git a/public/locales/en/latest_value_table.json b/public/locales/en/latest_value_table.json new file mode 100644 index 00000000..c108564a --- /dev/null +++ b/public/locales/en/latest_value_table.json @@ -0,0 +1,6 @@ +{ + "lastValue": "Latest value", + "lastMeasurement": "Latest measurement", + "error": "An error occurred while trying to load the information", + "noData": "No data available to display" +} diff --git a/public/locales/pt/graphic_chart.json b/public/locales/pt/graphic_chart.json new file mode 100644 index 00000000..e5228b14 --- /dev/null +++ b/public/locales/pt/graphic_chart.json @@ -0,0 +1,4 @@ +{ + "error": "Ocorreu um erro ao tentar carregar as informações", + "noData": "Não há dados para serem exibidos" +} diff --git a/public/locales/pt/header.json b/public/locales/pt/header.json new file mode 100644 index 00000000..ab5dd0d2 --- /dev/null +++ b/public/locales/pt/header.json @@ -0,0 +1,10 @@ +{ + "repository": "Repositório", + "edit_intervals": "Editar Intervalos", + "cancel": "Cancelar", + "save": "Salvar", + "warning_message": "Atenção: Essa configuração será aplicada a todos os repositórios do produto.", + "error_message": "Ocorreu um erro ao tentar carregar as informações.", + "update_success": "Intervalos atualizados com sucesso!", + "update_error": "Erro ao atualizar intervalos!" +} diff --git a/public/locales/pt/latest_value_table.json b/public/locales/pt/latest_value_table.json new file mode 100644 index 00000000..6d4dc4bc --- /dev/null +++ b/public/locales/pt/latest_value_table.json @@ -0,0 +1,6 @@ +{ + "lastValue": "Último valor", + "lastMeasurement": "Última medição", + "error": "Ocorreu um erro ao tentar carregar as informações", + "noData": "Não há dados para serem exibidos" +} diff --git a/src/pages/products/[product]/releases/tests/__snapshots__/Releases.spec.tsx.snap b/src/pages/products/[product]/releases/tests/__snapshots__/Releases.spec.tsx.snap index cb56f344..fe9918bf 100644 --- a/src/pages/products/[product]/releases/tests/__snapshots__/Releases.spec.tsx.snap +++ b/src/pages/products/[product]/releases/tests/__snapshots__/Releases.spec.tsx.snap @@ -73,6 +73,7 @@ exports[` Deve corresponder ao snapshot 1`] = ` aria-label="search-bar-label" class="MuiFormControl-root MuiTextField-root text css-1u3bzj6-MuiFormControl-root-MuiTextField-root" data-testid="input" + style="min-width: 250px;" >
Deve corresponder ao snapshot 1`] = ` value="" />
- - ​ -

- Repositório + repository

should render correctly 1`] = ` aria-label="search" class="MuiFormControl-root MuiTextField-root text css-1u3bzj6-MuiFormControl-root-MuiTextField-root" data-testid="input" + style="min-width: 250px;" >

diff --git a/src/shared/components/LatestValueTable/LatestValueTable.tsx b/src/shared/components/LatestValueTable/LatestValueTable.tsx index 0b8ec798..1517c378 100644 --- a/src/shared/components/LatestValueTable/LatestValueTable.tsx +++ b/src/shared/components/LatestValueTable/LatestValueTable.tsx @@ -17,6 +17,7 @@ import { import _ from 'lodash'; import { useRequestValues } from '@hooks/useRequestValues'; +import { useTranslation } from 'react-i18next'; interface Prop { title: string; @@ -24,6 +25,8 @@ interface Prop { } function LatestValueTable({ title, value }: Prop) { + const { t } = useTranslation('lates_value_table'); + const { data, error, isLoading, isEmpty } = useRequestValues({ type: 'latest-values', value }); const tableRows: { name: string; latestValue: number; latestData: string }[] = []; @@ -48,8 +51,8 @@ function LatestValueTable({ title, value }: Prop) { {title} - Último valor - Última medição + {t('lastValue')} + {t('lastMeasurement')} @@ -71,14 +74,14 @@ function LatestValueTable({ title, value }: Prop) { {error && ( - Ocorreu um erro ao tentar carregar as informações + {t('error')} )} {isEmpty && ( - Não há dados para serem exibidos + {t('noData')} )} diff --git a/src/shared/components/LatestValueTable/tests/__snapshots__/LatestValueTable.spec.tsx.snap b/src/shared/components/LatestValueTable/tests/__snapshots__/LatestValueTable.spec.tsx.snap index 499a2476..5009cb41 100644 --- a/src/shared/components/LatestValueTable/tests/__snapshots__/LatestValueTable.spec.tsx.snap +++ b/src/shared/components/LatestValueTable/tests/__snapshots__/LatestValueTable.spec.tsx.snap @@ -29,13 +29,13 @@ exports[` should render correctly 1`] = ` class="MuiTableCell-root MuiTableCell-head MuiTableCell-stickyHeader MuiTableCell-alignRight MuiTableCell-sizeMedium css-i02g0k-MuiTableCell-root" scope="col" > - Último valor + lastValue - Última medição + lastMeasurement @@ -118,13 +118,13 @@ exports[` should render correctly with empty data 1`] = ` class="MuiTableCell-root MuiTableCell-head MuiTableCell-stickyHeader MuiTableCell-alignRight MuiTableCell-sizeMedium css-i02g0k-MuiTableCell-root" scope="col" > - Último valor + lastValue - Última medição + lastMeasurement @@ -156,7 +156,7 @@ exports[` should render correctly with empty data 1`] = `
- Não há dados para serem exibidos + noData
@@ -192,13 +192,13 @@ exports[` should render correctly with error 1`] = ` class="MuiTableCell-root MuiTableCell-head MuiTableCell-stickyHeader MuiTableCell-alignRight MuiTableCell-sizeMedium css-i02g0k-MuiTableCell-root" scope="col" > - Último valor + lastValue - Última medição + lastMeasurement @@ -230,7 +230,7 @@ exports[` should render correctly with error 1`] = `
- Ocorreu um erro ao tentar carregar as informações + error
diff --git a/src/shared/components/Layout/Breadcrumbs/Breadcrumbs.tsx b/src/shared/components/Layout/Breadcrumbs/Breadcrumbs.tsx index 35f49742..b27f0231 100644 --- a/src/shared/components/Layout/Breadcrumbs/Breadcrumbs.tsx +++ b/src/shared/components/Layout/Breadcrumbs/Breadcrumbs.tsx @@ -25,7 +25,7 @@ export function Breadcrumbs() { if (pathArray[0] === '') { return ( - Produtos# + {t('products')} ); }