geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
412 stars 487 forks source link

multilingual record shows duplicate title if ui language does not match any of the available languages #5510

Open pvgenuchten opened 3 years ago

pvgenuchten commented 3 years ago

This happens in version 3.11.Snapshot Create multilingual record (fre, eng, ger) Remove german as language Go to basic view, switch to german -> duplicated title Switch to Swedish -> no duplicated title Switch to french -> no duplicate title 607fba6c-72c2-4946-b267-4da8eb3b3136.xml.zip

image

pvgenuchten commented 3 years ago

Seems for german the default title is duplicated, but for swedish it is not For french it also is duplicated, but then the ui picks the proper one

image

matself commented 3 years ago

Hi! Please note that the Swedish UI is brand new, and under revision. While all angular strings are translated, errors and inconsistensies have been discovered. I am working on those. But there are tons of files, not on Transifex to be translated. ISO schemas for one.

Hälsning / Regards Mats.E

Skickat från min / Sent from my iPad, Ursäkta att jag är kortfattad / Excuse my brevity.

17 mars 2021 kl. 10:50 skrev paul van genuchten @.***>:

 Seems for german the default title is duplicated, but for swedish it is not For french it also is duplicated, but then the ui picks the proper one

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

josegar74 commented 3 years ago

The code rendering this it's

https://github.com/geonetwork/core-geonetwork/blob/eb9f88250e41885c9abffe7403e5db893f442d27/web-ui/src/main/resources/catalog/views/default/templates/recordView.html#L142-L148

In German, in the search result the title element is a vector:

title: [,…]
0: "Copy of template De plantilla para el vector de datos en ISO19139 (multilingüe) created at 2021-03-17T09:33:12Z"
1: "Copy of template De plantilla para el vector de datos en ISO19139 (multilingüe) created at 2021-03-17T09:33:12Z"

while for other languages has only 1 value:

title: "Copy of template Template for Vector data in ISO19139 (multilingual) created at 2021-03-17T09:33:12Z"

It's really bizarre this difference, as the metadata has no German. Seem also happening in other UI languages not defined in the metadata like Chinese or Russian. But others like Italian or Swedish work fine. Not clear the pattern yet.


For some reason, this code:

https://github.com/geonetwork/core-geonetwork/blob/ef25ae4e9bf0d37f45f5f42dd8f0af8014dd2128/core/src/main/java/org/fao/geonet/kernel/search/LuceneSearcher.java#L1169

For certain UI languages it's returning the document in English (main metadata language) and works fine, but for others like German the document corresponds to the Spanish document and has the _title field duplicated, causing this.