From 6c4cd4d0616b3217ca225e48359164a9505ea152 Mon Sep 17 00:00:00 2001 From: Josue Modesto Date: Wed, 8 Jul 2026 17:31:19 -0300 Subject: [PATCH 1/3] Internacionalizacao da Pagina ListaTombosScreen --- public/locales/en/filterTombos.json | 12 ++ public/locales/en/listaTombosScreen.json | 63 ++++++ public/locales/es/filterTombos.json | 12 ++ public/locales/es/listaTombosScreen.json | 63 ++++++ public/locales/pt-BR/filterTombos.json | 12 ++ public/locales/pt-BR/listaTombosScreen.json | 63 ++++++ src/components/FilterTombos.jsx | 27 +-- src/i18n.ts | 4 +- src/pages/ListaTombosScreen.jsx | 203 ++++++++++---------- 9 files changed, 347 insertions(+), 112 deletions(-) create mode 100644 public/locales/en/filterTombos.json create mode 100644 public/locales/en/listaTombosScreen.json create mode 100644 public/locales/es/filterTombos.json create mode 100644 public/locales/es/listaTombosScreen.json create mode 100644 public/locales/pt-BR/filterTombos.json create mode 100644 public/locales/pt-BR/listaTombosScreen.json diff --git a/public/locales/en/filterTombos.json b/public/locales/en/filterTombos.json new file mode 100644 index 0000000..02425b8 --- /dev/null +++ b/public/locales/en/filterTombos.json @@ -0,0 +1,12 @@ +{ + "labelIdentificador": "Identifier", + "labelColetor": "Collector", + "labelNumeroColeta": "Collection Number", + "placeholderIdentificador": "Type the identifier's name", + "placeholderColetor": "Type the collector's name", + "placeholderNumeroColeta": "Select a collector first", + "nenhumResultado": "No results", + "nenhumNumeroColeta": "No collection number available", + "adicionarFiltro": "Add Filter", + "remover": "Remove" +} diff --git a/public/locales/en/listaTombosScreen.json b/public/locales/en/listaTombosScreen.json new file mode 100644 index 0000000..8817218 --- /dev/null +++ b/public/locales/en/listaTombosScreen.json @@ -0,0 +1,63 @@ +{ + "titulo": "Records", + "colHcf": "HCF", + "colNomePopular": "Common name", + "colNomeCientifico": "Scientific name", + "colDataColeta": "Collection date", + "colColetor": "Collector", + "colAcao": "Action", + "buscarTombo": "Search record", + "labelHcf": "HCF:", + "labelTipo": "Type:", + "placeholderSelecione": "Select", + "tipoParatipo": "Paratype", + "tipoIsotipo": "Isotype", + "labelSituacao": "Status:", + "situacaoRegular": "Regular", + "situacaoPermutado": "Exchanged", + "situacaoEmprestado": "On loan", + "situacaoDoado": "Donated", + "labelNomeCientifico": "Scientific name:", + "placeholderNomeCientifico": "Passiflora edulis", + "labelNomePopular": "Common name:", + "placeholderNomePopular": "Passion fruit", + "labelCodigoBarraFoto": "Photo barcode:", + "placeholderCodigoBarraFoto": "Enter the barcode", + "notifExcluirTombo": "Delete record", + "tomboExcluido": "The record was deleted successfully.", + "erroExcluirTombo": "There was a problem deleting the record, please try again.", + "confirmExcluirTitulo": "Are you sure you want to delete this record?", + "confirmExcluirConteudo": "By clicking YES, the record will be deleted.", + "notifBuscarTombos": "Search records", + "erroBuscarTombos": "Error fetching the records.", + "erroBuscarTombosFalha": "Failed to fetch records.", + "alerta": "Alert", + "erroMinMaxColunas": "Select a minimum of 1 and a maximum of 5 columns to export.", + "erroInformePeriodo": "Enter a range, specific records or a date range to export", + "erroExportacaoUnica": "Data export must be done by a range, specific records or a date range, never using two or more", + "panelHeaderCampos": "Select the fields to be exported:", + "tagHcf": "HCF", + "tagDataColeta": "Collection Date", + "tagFamilia": "Family", + "tagSubfamilia": "Subfamily", + "tagGenero": "Genus", + "tagEspecie": "Species", + "tagSubespecie": "Subspecies", + "tagVariedade": "Variety", + "tagSequencia": "Record sequence", + "tagCodigoBarra": "Barcode", + "tagLatitude": "Latitude", + "tagLongitude": "Longitude", + "tagAltitude": "Altitude", + "tagNumeroColeta": "Collection No.", + "tagColetores": "Collectors", + "aPartirDe": "From:", + "ate": "To:", + "ou": "OR", + "numerosTombos": "Record numbers to be exported:", + "aPartirDataTombo": "From the record date:", + "placeholderDataInicial": "Select the initial record date", + "ateDataTombo": "To the record date:", + "placeholderDataFinal": "Select the final record date", + "exportar": "Export" +} diff --git a/public/locales/es/filterTombos.json b/public/locales/es/filterTombos.json new file mode 100644 index 0000000..fcb58be --- /dev/null +++ b/public/locales/es/filterTombos.json @@ -0,0 +1,12 @@ +{ + "labelIdentificador": "Identificador", + "labelColetor": "Colector", + "labelNumeroColeta": "Número de Colecta", + "placeholderIdentificador": "Escriba el nombre del identificador", + "placeholderColetor": "Escriba el nombre del colector", + "placeholderNumeroColeta": "Seleccione un colector primero", + "nenhumResultado": "Ningún resultado", + "nenhumNumeroColeta": "Ningún número de colecta disponible", + "adicionarFiltro": "Agregar Filtro", + "remover": "Eliminar" +} diff --git a/public/locales/es/listaTombosScreen.json b/public/locales/es/listaTombosScreen.json new file mode 100644 index 0000000..22e0566 --- /dev/null +++ b/public/locales/es/listaTombosScreen.json @@ -0,0 +1,63 @@ +{ + "titulo": "Registros", + "colHcf": "HCF", + "colNomePopular": "Nombre popular", + "colNomeCientifico": "Nombre científico", + "colDataColeta": "Fecha de colecta", + "colColetor": "Colector", + "colAcao": "Acción", + "buscarTombo": "Buscar registro", + "labelHcf": "HCF:", + "labelTipo": "Tipo:", + "placeholderSelecione": "Seleccione", + "tipoParatipo": "Paratipo", + "tipoIsotipo": "Isotipo", + "labelSituacao": "Situación:", + "situacaoRegular": "Regular", + "situacaoPermutado": "Permutado", + "situacaoEmprestado": "Prestado", + "situacaoDoado": "Donado", + "labelNomeCientifico": "Nombre científico:", + "placeholderNomeCientifico": "Passiflora edulis", + "labelNomePopular": "Nombre popular:", + "placeholderNomePopular": "Maracuyá", + "labelCodigoBarraFoto": "Código de barras de la foto:", + "placeholderCodigoBarraFoto": "Escriba el código de barras", + "notifExcluirTombo": "Eliminar registro", + "tomboExcluido": "El registro fue eliminado con éxito.", + "erroExcluirTombo": "Hubo un problema al eliminar el registro, inténtelo de nuevo.", + "confirmExcluirTitulo": "¿Está seguro de que desea eliminar este registro?", + "confirmExcluirConteudo": "Al hacer clic en SÍ, el registro será eliminado.", + "notifBuscarTombos": "Buscar registros", + "erroBuscarTombos": "Error al buscar los registros.", + "erroBuscarTombosFalha": "Error al buscar registros.", + "alerta": "Alerta", + "erroMinMaxColunas": "Seleccione un mínimo de 1 y un máximo de 5 columnas para exportar.", + "erroInformePeriodo": "Indique un período, registros específicos o un intervalo de fechas para exportar", + "erroExportacaoUnica": "La exportación de los datos debe hacerse por un período, registros específicos o un intervalo de fechas, nunca utilizando dos o más", + "panelHeaderCampos": "Seleccione los campos a exportar:", + "tagHcf": "HCF", + "tagDataColeta": "Fecha de Colecta", + "tagFamilia": "Familia", + "tagSubfamilia": "Subfamilia", + "tagGenero": "Género", + "tagEspecie": "Especie", + "tagSubespecie": "Subespecie", + "tagVariedade": "Variedad", + "tagSequencia": "Secuencia del registro", + "tagCodigoBarra": "Código de barras", + "tagLatitude": "Latitud", + "tagLongitude": "Longitud", + "tagAltitude": "Altitud", + "tagNumeroColeta": "N.º Colecta", + "tagColetores": "Colectores", + "aPartirDe": "A partir de:", + "ate": "Hasta:", + "ou": "O", + "numerosTombos": "Números de los registros a exportar:", + "aPartirDataTombo": "A partir de la fecha de registro:", + "placeholderDataInicial": "Seleccione la fecha de registro inicial", + "ateDataTombo": "Hasta la fecha de registro:", + "placeholderDataFinal": "Seleccione la fecha de registro final", + "exportar": "Exportar" +} diff --git a/public/locales/pt-BR/filterTombos.json b/public/locales/pt-BR/filterTombos.json new file mode 100644 index 0000000..1fbc76d --- /dev/null +++ b/public/locales/pt-BR/filterTombos.json @@ -0,0 +1,12 @@ +{ + "labelIdentificador": "Identificador", + "labelColetor": "Coletor", + "labelNumeroColeta": "Número de Coleta", + "placeholderIdentificador": "Digite o nome do identificador", + "placeholderColetor": "Digite o nome do coletor", + "placeholderNumeroColeta": "Selecione um coletor primeiro", + "nenhumResultado": "Nenhum resultado", + "nenhumNumeroColeta": "Nenhum número de coleta disponível", + "adicionarFiltro": "Adicionar Filtro", + "remover": "Remover" +} diff --git a/public/locales/pt-BR/listaTombosScreen.json b/public/locales/pt-BR/listaTombosScreen.json new file mode 100644 index 0000000..bd8af64 --- /dev/null +++ b/public/locales/pt-BR/listaTombosScreen.json @@ -0,0 +1,63 @@ +{ + "titulo": "Tombos", + "colHcf": "HCF", + "colNomePopular": "Nome popular", + "colNomeCientifico": "Nome científico", + "colDataColeta": "Data de coleta", + "colColetor": "Coletor", + "colAcao": "Ação", + "buscarTombo": "Buscar tombo", + "labelHcf": "HCF:", + "labelTipo": "Tipo:", + "placeholderSelecione": "Selecione", + "tipoParatipo": "Parátipo", + "tipoIsotipo": "Isótipo", + "labelSituacao": "Situação:", + "situacaoRegular": "Regular", + "situacaoPermutado": "Permutado", + "situacaoEmprestado": "Emprestado", + "situacaoDoado": "Doado", + "labelNomeCientifico": "Nome científico:", + "placeholderNomeCientifico": "Passiflora edulis", + "labelNomePopular": "Nome popular:", + "placeholderNomePopular": "Maracujá", + "labelCodigoBarraFoto": "Código de barras da foto:", + "placeholderCodigoBarraFoto": "Digite o código de barras", + "notifExcluirTombo": "Excluir tombo", + "tomboExcluido": "O tombo foi excluído com sucesso.", + "erroExcluirTombo": "Houve um problema ao excluir o tombo, tente novamente.", + "confirmExcluirTitulo": "Você tem certeza que deseja excluir este tombo?", + "confirmExcluirConteudo": "Ao clicar em SIM, o tombo será excluído.", + "notifBuscarTombos": "Buscar tombos", + "erroBuscarTombos": "Erro ao buscar os tombos.", + "erroBuscarTombosFalha": "Falha ao buscar tombos.", + "alerta": "Alerta", + "erroMinMaxColunas": "Selecione o mínimo de 1 e o máximo de 5 colunas para exportar.", + "erroInformePeriodo": "Informe um período, tombos específicos ou período de datas para exportar", + "erroExportacaoUnica": "A exportação dos dados deve ser feita por um período, tombos específicos ou período de datas, nunca utilizando dois ou mais", + "panelHeaderCampos": "Selecione os campos a serem exportados:", + "tagHcf": "HCF", + "tagDataColeta": "Data da Coleta", + "tagFamilia": "Família", + "tagSubfamilia": "Subfamília", + "tagGenero": "Gênero", + "tagEspecie": "Espécie", + "tagSubespecie": "Subespécie", + "tagVariedade": "Variedade", + "tagSequencia": "Sequencia do tombo", + "tagCodigoBarra": "Codigo de barra", + "tagLatitude": "Latitude", + "tagLongitude": "Longitude", + "tagAltitude": "Altitude", + "tagNumeroColeta": "Nº Coleta", + "tagColetores": "Coletores", + "aPartirDe": "A partir de:", + "ate": "Até:", + "ou": "OU", + "numerosTombos": "Numeros dos tombos a serem exportados:", + "aPartirDataTombo": "A partir da data de tombo:", + "placeholderDataInicial": "Seleciona a data de tombo inicial", + "ateDataTombo": "Até a data de tombo:", + "placeholderDataFinal": "Seleciona a data de tombo final", + "exportar": "Exportar" +} diff --git a/src/components/FilterTombos.jsx b/src/components/FilterTombos.jsx index 0acaa31..1572141 100644 --- a/src/components/FilterTombos.jsx +++ b/src/components/FilterTombos.jsx @@ -11,13 +11,14 @@ import { Spin } from 'antd' import axios from 'axios' +import { withTranslation } from 'react-i18next' import { PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons' const { Panel } = Collapse const { Option } = Select -const FilterTombos = ({ onChange }) => { +const FilterTombos = ({ onChange, t}) => { const [selectedFilters, setSelectedFilters] = useState([]) const [filterValues, setFilterValues] = useState({}) @@ -148,11 +149,11 @@ const FilterTombos = ({ onChange }) => { const availableFilters = [ { key: 'identificador_id', - label: 'Identificador', + label: t('filterTombos:labelIdentificador'), component: ( { notFoundContent={ loadingColetor ? - : 'Nenhum resultado' + : t('filterTombos:nenhumResultado') } style={{ width: '100%' }} > @@ -206,12 +207,12 @@ const FilterTombos = ({ onChange }) => { }, { key: 'numero_coleta', - label: 'Número de Coleta', + label: t('filterTombos:labelNumeroColeta'), component: ( - - + )} @@ -359,16 +323,16 @@ class ListaTombosScreen extends Component { - Situação: + {t('listaTombosScreen:labelSituacao')} {getFieldDecorator('situacao')( - + + + + )} @@ -379,36 +343,36 @@ class ListaTombosScreen extends Component { - Nome científico: + {t('listaTombosScreen:labelNomeCientifico')} {getFieldDecorator('nomeCientifico')( - + )} - Nome popular: + {t('listaTombosScreen:labelNomePopular')} {getFieldDecorator('nomePopular')( - + )} - Código de barras da foto: + {t('listaTombosScreen:labelCodigoBarraFoto')} {getFieldDecorator('codigoBarraFoto')( - + )} @@ -437,7 +401,7 @@ class ListaTombosScreen extends Component { }} className="login-form-button" > - Limpar + {t('common:limpar')} @@ -448,7 +412,7 @@ class ListaTombosScreen extends Component { htmlType="submit" className="login-form-button ant-btn-pesquisar" > - Pesquisar + {t('common:pesquisar')} @@ -501,7 +465,7 @@ class ListaTombosScreen extends Component { .map(extraiApenasChave) if (campos.length < 1 || campos.length > 5) { - this.openNotificationWithIcon('warning', 'Alerta', 'Selecione o mínimo de 1 e o máximo de 5 colunas para exportar.') + this.openNotificationWithIcon('warning', this.props.t('listaTombosScreen:alerta'), this.props.t('listaTombosScreen:erroMinMaxColunas')) return } @@ -512,12 +476,12 @@ class ListaTombosScreen extends Component { ].filter(item => item === true) if (grupos.length === 0) { - this.openNotificationWithIcon('warning', 'Alerta', 'Informe um período, tombos específicos ou período de datas para exportar') + this.openNotificationWithIcon('warning', this.props.t('listaTombosScreen:alerta'), this.props.t('listaTombosScreen:erroInformePeriodo')) return } if (grupos.length > 1) { - this.openNotificationWithIcon('warning', 'Alerta', 'A exportação dos dados deve ser feita por um período, tombos específicos ou período de datas, nunca utilizando dois ou mais') + this.openNotificationWithIcon('warning', this.props.t('listaTombosScreen:alerta'), this.props.t('listaTombosScreen:erroExportacaoUnica')) return } @@ -572,11 +536,12 @@ class ListaTombosScreen extends Component { renderExportar(getFieldDecorator) { const { fetching, data } = this.state + const { t } = this.props return (
- + @@ -584,7 +549,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('hcf')( {' '} - HCF + {t('listaTombosScreen:tagHcf')} )} @@ -594,7 +559,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('data_coleta')( {' '} - Data da Coleta + {t('listaTombosScreen:tagDataColeta')} )} @@ -604,7 +569,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('familia')( {' '} - Família + {t('listaTombosScreen:tagFamilia')} )} @@ -614,7 +579,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('subfamilia')( {' '} - Subfamília + {t('listaTombosScreen:tagSubfamilia')} )} @@ -624,7 +589,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('genero')( {' '} - Gênero + {t('listaTombosScreen:tagGenero')} )} @@ -634,7 +599,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('especie')( {' '} - Espécie + {t('listaTombosScreen:tagEspecie')} )} @@ -644,7 +609,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('subespecie')( {' '} - Subespécie + {t('listaTombosScreen:tagSubespecie')} )} @@ -654,7 +619,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('variedade')( {' '} - Variedade + {t('listaTombosScreen:tagVariedade')} )} @@ -664,7 +629,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('sequencia')( {' '} - Sequencia do tombo + {t('listaTombosScreen:tagSequencia')} )} @@ -674,7 +639,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('codigo_barra')( {' '} - Codigo de barra + {t('listaTombosScreen:tagCodigoBarra')} )} @@ -684,7 +649,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('latitude')( {' '} - Latitude + {t('listaTombosScreen:tagLatitude')} )} @@ -694,7 +659,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('longitude')( {' '} - Longitude + {t('listaTombosScreen:tagLongitude')} )} @@ -704,7 +669,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('altitude')( {' '} - Altitude + {t('listaTombosScreen:tagAltitude')} )} @@ -714,7 +679,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('numero_coleta')( {' '} - Nº Coleta + {t('listaTombosScreen:tagNumeroColeta')} )} @@ -724,7 +689,7 @@ class ListaTombosScreen extends Component { {getFieldDecorator('coletores')( {' '} - Coletores + {t('listaTombosScreen:tagColetores')} )} @@ -734,7 +699,7 @@ class ListaTombosScreen extends Component { - A partir de: + {t('listaTombosScreen:aPartirDe')} @@ -748,7 +713,7 @@ class ListaTombosScreen extends Component { - Até: + {t('listaTombosScreen:ate')} @@ -763,12 +728,12 @@ class ListaTombosScreen extends Component {
- OU + {t('listaTombosScreen:ou')} - Numeros dos tombos a serem exportados: + {t('listaTombosScreen:numerosTombos')} @@ -792,13 +757,13 @@ class ListaTombosScreen extends Component {
- OU + {t('listaTombosScreen:ou')}
- A partir da data de tombo: + {t('listaTombosScreen:aPartirDataTombo')} @@ -806,7 +771,7 @@ class ListaTombosScreen extends Component { )} @@ -814,7 +779,7 @@ class ListaTombosScreen extends Component { - Até a data de tombo: + {t('listaTombosScreen:ateDataTombo')} @@ -822,7 +787,7 @@ class ListaTombosScreen extends Component { )} @@ -837,7 +802,7 @@ class ListaTombosScreen extends Component { htmlType="submit" style={{ backgroundColor: '#FF7F00', borderColor: '#FF7F00' }} > - Exportar + {t('listaTombosScreen:exportar')}
@@ -849,9 +814,49 @@ class ListaTombosScreen extends Component { render() { const { getFieldDecorator } = this.props.form + const { t } = this.props + + const columns = [ + { + title: t('listaTombosScreen:colHcf'), + type: 'number', + key: 'hcf', + width: 100 + }, + { + title: t('listaTombosScreen:colNomePopular'), + type: 'text', + key: 'nomePopular', + width: 200 + }, + { + title: t('listaTombosScreen:colNomeCientifico'), + type: 'text', + key: 'nomeCientifico', + width: 200 + }, + { + title: t('listaTombosScreen:colDataColeta'), + type: 'text', + key: 'data', + width: 100 + }, + { + title: t('listaTombosScreen:colColetor'), + type: 'text', + key: 'coletor', + width: 200 + }, + { + title: t('listaTombosScreen:colAcao'), + key: 'acao', + width: 120 + } + ] + return (
- + {this.renderPainelBusca(getFieldDecorator)} @@ -874,4 +879,6 @@ class ListaTombosScreen extends Component { ) } } -export default Form.create()(ListaTombosScreen) +const ListaTombosScreenWithForm = Form.create()(ListaTombosScreen) + +export default withTranslation()(ListaTombosScreenWithForm) From 20a74accc6b761e73b98f4565c4cb1c813caa7f7 Mon Sep 17 00:00:00 2001 From: Josue Date: Thu, 9 Jul 2026 21:33:16 -0300 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20Corre=C3=A7=C3=A3o=20falta=20de=20vi?= =?UTF-8?q?rgula?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n.ts b/src/i18n.ts index 9fa99b6..19dca95 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -74,7 +74,7 @@ void i18n 'relatorioQtdPeriodoScreen', 'relatorioTombosPorCidadeScreen', 'filterTombos', - 'listaTombosScreen' + 'listaTombosScreen', 'estadoContainer', 'estadoComponent', 'rankingCard', From 22651531071de9cf20f0fe2da480e16f8fcdf8ed Mon Sep 17 00:00:00 2001 From: Josue Date: Thu, 9 Jul 2026 21:45:29 -0300 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20COrre=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ListaTombosScreen.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/ListaTombosScreen.jsx b/src/pages/ListaTombosScreen.jsx index c852c89..30f83f3 100644 --- a/src/pages/ListaTombosScreen.jsx +++ b/src/pages/ListaTombosScreen.jsx @@ -17,7 +17,6 @@ import { Form } from '@ant-design/compatible' import { DeleteOutlined, EditOutlined, ExportOutlined, SearchOutlined } from '@ant-design/icons' -import { withTranslation } from 'react-i18next' import FilterTombos from '../components/FilterTombos' import HeaderListComponent from '../components/HeaderListComponent'