DSpace 7.4: How to display dc.description(en) or dc.description(es) depending on the interface language

45 views
Skip to first unread message

Carlos Campo

unread,
Dec 7, 2022, 7:05:23 PM12/7/22
to DSpace Developers
Hello,

I need to clarify an important question about a functionality of DSpace 7.4 that is very important to me. I've asked on the "DSpace Technical Support" forum and the only response I've gotten says that that functionality probably doesn't exist.

For this reason, and being a bit desperate, I come to you.

My question:
-------------
 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?  
-------------

Best regards,
Carlos Campo

Mark H. Wood

unread,
Dec 8, 2022, 8:33:24 AM12/8/22
to dspace...@googlegroups.com
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
signature.asc
Reply all
Reply to author
Forward
0 new messages