Skip to content

Commit d9f2ac3

Browse files
authored
Metadata fallback group title translation added (#1944)
1 parent a9f2cfd commit d9f2ac3

File tree

14 files changed

+34
-16
lines changed

14 files changed

+34
-16
lines changed

geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_templates/ObjectFieldTemplate.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
*/
99

1010
import React, { useState } from 'react';
11+
import PropTypes from 'prop-types';
1112
import Button from '@js/components/Button';
1213
import { Glyphicon } from 'react-bootstrap';
1314
import FaIcon from '@js/components/FaIcon';
1415
import Message from '@mapstore/framework/components/I18N/Message';
16+
import { getMessageById } from '@mapstore/framework/utils/LocaleUtils';
1517
import InputControlWithDebounce from '@js/components/InputControlWithDebounce';
1618
import {
1719
canExpand,
@@ -69,11 +71,10 @@ function RootMetadata({
6971
properties,
7072
errorSchema,
7173
formContext
72-
}) {
74+
}, context) {
7375
const {
7476
title: metadataTitle
7577
} = formContext;
76-
7778
const [filterText, setFilterText] = useState('');
7879

7980
const groups = properties.reduce((acc, property) => {
@@ -86,7 +87,7 @@ function RootMetadata({
8687
|| !title.toLowerCase().includes((filterText || '').toLowerCase())) {
8788
return acc;
8889
}
89-
const sectionKey = options?.['geonode-ui:group'] || 'General';
90+
const sectionKey = options?.['geonode-ui:group'] || getMessageById(context.messages, 'gnviewer.metadataGroupTitle');
9091
const sectionItems = acc[sectionKey] || [];
9192
return {
9293
...acc,
@@ -144,6 +145,10 @@ function RootMetadata({
144145
);
145146
}
146147

148+
RootMetadata.contextTypes = {
149+
messages: PropTypes.object
150+
};
151+
147152
function ObjectFieldTemplate(props) {
148153
const isRoot = props?.idSchema?.$id === 'root';
149154
if (isRoot) {

geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@
453453
"metadataUpdateError": "Die Metadaten konnten nicht aktualisiert werden",
454454
"metadataNotFound": "Für die ausgewählte Ressource wurden keine Metadaten gefunden",
455455
"filterMetadata": "Nach Namen filtern...",
456-
"noMetadataFound": "Keine Metadaten gefunden..."
456+
"noMetadataFound": "Keine Metadaten gefunden...",
457+
"metadataGroupTitle": "Allgemein"
457458
}
458459
}
459460
}

geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@
453453
"metadataUpdateError": "It was not possible to update the metadata",
454454
"metadataNotFound": "Metadata not found for the selected resource",
455455
"filterMetadata": "Filter by name...",
456-
"noMetadataFound": "No metadata found..."
456+
"noMetadataFound": "No metadata found...",
457+
"metadataGroupTitle": "General"
457458
}
458459
}
459460
}

geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@
452452
"metadataUpdateError": "No fue posible actualizar los metadatos",
453453
"metadataNotFound": "No se encontraron metadatos para el recurso seleccionado",
454454
"filterMetadata": "Filtrar por nombre...",
455-
"noMetadataFound": "No se encontraron metadatos..."
455+
"noMetadataFound": "No se encontraron metadatos...",
456+
"metadataGroupTitle": "General"
456457
}
457458
}
458459
}

geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@
422422
"metadataUpdateError": "It was not possible to update the metadata",
423423
"metadataNotFound": "Metadata not found for the selected resource",
424424
"filterMetadata": "Filter by name...",
425-
"noMetadataFound": "No metadata found..."
425+
"noMetadataFound": "No metadata found...",
426+
"metadataGroupTitle": "General"
426427
}
427428
}
428429
}

geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@
453453
"metadataUpdateError": "Il n'a pas été possible de mettre à jour les métadonnées",
454454
"metadataNotFound": "Les métadonnées ne sont pas trouvées pour la ressource sélectionnée",
455455
"filterMetadata": "Filtrer par nom...",
456-
"noMetadataFound": "Aucune métadonnée trouvée..."
456+
"noMetadataFound": "Aucune métadonnée trouvée...",
457+
"metadataGroupTitle": "Général"
457458
}
458459
}
459460
}

geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@
422422
"metadataUpdateError": "It was not possible to update the metadata",
423423
"metadataNotFound": "Metadata not found for the selected resource",
424424
"filterMetadata": "Filter by name...",
425-
"noMetadataFound": "No metadata found..."
425+
"noMetadataFound": "No metadata found...",
426+
"metadataGroupTitle": "General"
426427
}
427428
}
428429
}

geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@
455455
"metadataUpdateError": "Non è stato possibile aggiornare i metadati",
456456
"metadataNotFound": "Metadati non disponibili per la risorsa selezionata",
457457
"filterMetadata": "Filtra per nome...",
458-
"noMetadataFound": "Nessun metadato trovato..."
458+
"noMetadataFound": "Nessun metadato trovato...",
459+
"metadataGroupTitle": "Generale"
459460
}
460461
}
461462
}

geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@
422422
"metadataUpdateError": "It was not possible to update the metadata",
423423
"metadataNotFound": "Metadata not found for the selected resource",
424424
"filterMetadata": "Filter by name...",
425-
"noMetadataFound": "No metadata found..."
425+
"noMetadataFound": "No metadata found...",
426+
"metadataGroupTitle": "General"
426427
}
427428
}
428429
}

geonode_mapstore_client/static/mapstore/gn-translations/data.pt-PT.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@
422422
"metadataUpdateError": "It was not possible to update the metadata",
423423
"metadataNotFound": "Metadata not found for the selected resource",
424424
"filterMetadata": "Filter by name...",
425-
"noMetadataFound": "No metadata found..."
425+
"noMetadataFound": "No metadata found...",
426+
"metadataGroupTitle": "General"
426427
}
427428
}
428429
}

0 commit comments

Comments
 (0)