inveniosoftware / react-invenio-deposit

React application for Invenio deposit forms.
https://react-invenio-deposit.readthedocs.io
MIT License
3 stars 46 forks source link

i18n: Translation of funder-names/title not be used #607

Open chriz-uniba opened 1 year ago

chriz-uniba commented 1 year ago

Package version (if known): invenio-app-rdm 9.1.5

Describe the bug

There seems no way to get a translation of funder-names.

Steps to Reproduce

  1. Create an invenio-instance with German language enabled.
  2. Create funders-list from ROR-Data as described here: https://inveniordm.docs.cern.ch/customize/vocabularies/names/#creating-a-namesyaml-file --- but for funders

here a subset:

- country: DE
  id: 018mejw64
  identifiers:
  - identifier: 0000 0001 2096 9829
    scheme: isni
  - identifier: 10.13039/501100001659
    scheme: doi
  - identifier: grid.424150.6
    scheme: grid
  name: Deutsche Forschungsgemeinschaft
  title:
    en: German Research Foundation
- country: DE
  id: 04pz7b180
  identifiers:
  - identifier: 0000 0004 0639 2885
    scheme: isni
  - identifier: 10.13039/501100002347
    scheme: doi
  - identifier: grid.5586.e
    scheme: grid
  name: Federal Ministry of Education and Research
  title:
    de: "Bundesministerium f\xFCr Bildung und Forschung"
    en: Federal Ministry of Education and Research
- country: DE
  id: 03bsmfz84
  identifiers:
  - identifier: 0000 0000 9271 7869
    scheme: isni
  - identifier: 10.13039/501100001663
    scheme: doi
  - identifier: grid.452969.5
    scheme: grid
  name: Volkswagen Foundation
  title:
    de: VolkswagenStiftung
    en: Volkswagen Foundation
  1. Add this vocabulary as funder to your instance (see https://inveniordm.docs.cern.ch/customize/vocabularies/funding/#ror-dataset-import)
  2. Switch between English and German language.
  3. Check out the Funder-Names

image

Expected behavior

If there is a German translation of the title, we would have expected it to be used.

https://github.com/inveniosoftware/react-invenio-deposit/blob/27885af1f83b057bb514864cf80d18094c7c6ccc/src/lib/components/Funding/CustomAwardForm.js#L20-L21

Maybe this line here could use title with i18n if available and fall back to name if not available.

Additional context

Maybe related to: https://github.com/inveniosoftware/invenio-app-rdm/issues/1868