Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata fallback group title translation added #1944

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
*/

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import Button from '@js/components/Button';
import { Glyphicon } from 'react-bootstrap';
import FaIcon from '@js/components/FaIcon';
import Message from '@mapstore/framework/components/I18N/Message';
import { getMessageById } from '@mapstore/framework/utils/LocaleUtils';
import InputControlWithDebounce from '@js/components/InputControlWithDebounce';
import {
canExpand,
Expand Down Expand Up @@ -69,11 +71,10 @@ function RootMetadata({
properties,
errorSchema,
formContext
}) {
}, context) {
const {
title: metadataTitle
} = formContext;

const [filterText, setFilterText] = useState('');

const groups = properties.reduce((acc, property) => {
Expand All @@ -86,7 +87,7 @@ function RootMetadata({
|| !title.toLowerCase().includes((filterText || '').toLowerCase())) {
return acc;
}
const sectionKey = options?.['geonode-ui:group'] || 'General';
const sectionKey = options?.['geonode-ui:group'] || getMessageById(context.messages, 'gnviewer.metadataGroupTitle');
const sectionItems = acc[sectionKey] || [];
return {
...acc,
Expand Down Expand Up @@ -144,6 +145,10 @@ function RootMetadata({
);
}

RootMetadata.contextTypes = {
messages: PropTypes.object
};

function ObjectFieldTemplate(props) {
const isRoot = props?.idSchema?.$id === 'root';
if (isRoot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@
"metadataUpdateError": "Die Metadaten konnten nicht aktualisiert werden",
"metadataNotFound": "Für die ausgewählte Ressource wurden keine Metadaten gefunden",
"filterMetadata": "Nach Namen filtern...",
"noMetadataFound": "Keine Metadaten gefunden..."
"noMetadataFound": "Keine Metadaten gefunden...",
"metadataGroupTitle": "Allgemein"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@
"metadataUpdateError": "No fue posible actualizar los metadatos",
"metadataNotFound": "No se encontraron metadatos para el recurso seleccionado",
"filterMetadata": "Filtrar por nombre...",
"noMetadataFound": "No se encontraron metadatos..."
"noMetadataFound": "No se encontraron metadatos...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@
"metadataUpdateError": "Il n'a pas été possible de mettre à jour les métadonnées",
"metadataNotFound": "Les métadonnées ne sont pas trouvées pour la ressource sélectionnée",
"filterMetadata": "Filtrer par nom...",
"noMetadataFound": "Aucune métadonnée trouvée..."
"noMetadataFound": "Aucune métadonnée trouvée...",
"metadataGroupTitle": "Général"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@
"metadataUpdateError": "Non è stato possibile aggiornare i metadati",
"metadataNotFound": "Metadati non disponibili per la risorsa selezionata",
"filterMetadata": "Filtra per nome...",
"noMetadataFound": "Nessun metadato trovato..."
"noMetadataFound": "Nessun metadato trovato...",
"metadataGroupTitle": "Generale"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@
"metadataUpdateError": "It was not possible to update the metadata",
"metadataNotFound": "Metadata not found for the selected resource",
"filterMetadata": "Filter by name...",
"noMetadataFound": "No metadata found..."
"noMetadataFound": "No metadata found...",
"metadataGroupTitle": "General"
}
}
}
Loading