On Wed, Dec 07, 2022 at 03:57:12PM -0800, Carlos Campo wrote:
> I'm configuring DSpace 7.4 to have a web with a bilingual interface
> (English, Spanish)
> Among other things, I have added the dc.description field, both for English
> and Spanish.
>
> When I navigate to the full item page, I see both fields:
> dc.description(en) and dc.description(es).
> When I navigate to the simple item page, I also see the two fields.
> However, on this page, the simple item page, I would like to see only the
> field that corresponds to the interface language. That is, if the interface
> at a given moment is in Spanish, I would like to see only the
> dc.description(es) field. However, if the interface at another time is in
> English, I'd like to see just the dc.description(en) field.
>
> I've been reading the documentation and I see that I can modify the
> structure of the simple item page by modifying the
> "untyped-item.component.html" file. There, I can add and remove fields, but
> how can I make it show only dc.description(en) or dc.description(es)
> depending on the interface language?
I haven't done anything like this, but it was an interesting problem.
You can get metadata values filtered on language by passing an optional
MetadataValueFilter to DSpaceObject.allMetadata. The interesting
objects are in 'src/app/core/shared'.
I haven't worked out exactly how to do this, but I think the place to
start looking is in
'src/app/item-page/simple/field-components/specific-field/item-page-field.component.html'.
I have not found out where to look for the currently selected language code.
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu