Skip to content
Snippets Groups Projects
Commit 4dd7ca05 authored by esikkala's avatar esikkala
Browse files

Translate the label of missing facet value

parent 30e33cb5
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,11 @@ class HierarchicalFacet extends Component {
if (this.state.matches.length > 0) {
isSearchMatch = this.state.matches.some(match => match.node.id === node.id)
}
if (node.id === 'http://ldf.fi/MISSING_VALUE') {
// Check if there is a translated label for missing value, or use defaults
node.prefLabel = intl.get(`perspectives.${this.props.facetClass}.properties.${this.props.facetID}.missingValueLabel`) ||
intl.get('facetBar.defaultMissingValueLabel') || 'Unknown'
}
return (
<>
<Typography className={isSearchMatch ? this.props.classes.searchMatch : ''} variant='body2'>
......
......@@ -376,7 +376,8 @@ const loadLocalesEpic = action$ => action$.pipe(
mergeMap(async action => {
await intl.init({
currentLocale: action.currentLanguage,
locales: availableLocales
locales: availableLocales,
warningHandler: () => null
})
return updateLocale({ language: action.currentLanguage })
})
......
......@@ -178,7 +178,7 @@ const mapFacetValues = sparqlBindings => {
try {
return {
id: b.id.value,
prefLabel: b.prefLabel.value,
prefLabel: b.prefLabel ? b.prefLabel.value : null,
selected: b.selected.value,
parent: b.parent ? b.parent.value : null,
instanceCount: b.instanceCount.value
......
......@@ -84,7 +84,7 @@ export const facetValuesQuery = `
}
FILTER(?instanceCount > 0)
BIND(IRI("http://ldf.fi/MISSING_VALUE") AS ?id)
BIND("Unknown" AS ?prefLabel)
# prefLabel for <http://ldf.fi/MISSING_VALUE> is given in client/translations
BIND('0' as ?parent)
BIND(<UNKNOWN_SELECTED> as ?selected)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment