Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable simultaneous display of multilingual metadata #7272

Open
asmecher opened this issue Sep 8, 2021 · 11 comments
Open

Enable simultaneous display of multilingual metadata #7272

asmecher opened this issue Sep 8, 2021 · 11 comments
Assignees
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete.
Milestone

Comments

@asmecher
Copy link
Member

asmecher commented Sep 8, 2021

Describe the problem you would like to solve
From the Coalition Publica metadata working group:

One of the most frequent issues with metadata is that users will enter more than one language into a single field because they want both to display. If users could selectively display more than one language for some metadata elements, we would certainly see a decrease in metadata abuse. Abstracts are an excellent example. It is very common to see two languages in a single abstract field because a journal wants to show both abstracts on an article landing page. For example, an English-language journal may have very little additional metadata or website copy available in French, but they want to provide French abstracts for English articles so that their Francophone readers can decide if they want to take the time reader an article in English. This example could be equally true for a French-language journal, or for other metadata fields such as title and keywords.

Describe the solution you'd like
Rather than displaying only the current language's metadata, with a fallback on the primary language, permit the display of metadata in both languages on the same page.

This might need to be treated differently depending on the context. For example, it's common for an article landing page to present information in two languages at once (e.g. French and English) for titles and abstracts. For other fields (e.g. keywords) it might be better to introduce a visual indication that other languages may be available, with a way to toggle that display.

Who is asking for this feature?
Coalition Publica metadata working group

Additional information
From the recommenation: "Simultaneous Display of Multilingual Metadata"

@NateWr NateWr added the Enhancement:3:Major A new feature or improvement that will take a month or more to complete. label Sep 9, 2021
@NateWr
Copy link
Contributor

NateWr commented Sep 9, 2021

I'd like to see this implemented on a per-theme basis. We can implement it as a theme option in the default theme and some of the others without too much difficulty.

@fgnievinski
Copy link
Contributor

the simultaneous display of multilingual metadata might ensure that all languages are indexable by crawlers #699

@fgnievinski
Copy link
Contributor

@NateWr
Copy link
Contributor

NateWr commented Oct 13, 2021

Just noting that the lang attribute should be used to ensure that a screen reader can read text in languages other than the one specified in the <body> tag.

@fgnievinski
Copy link
Contributor

Multilingual DC tags could also be used, e.g.,:

<meta name="DC.Language" scheme="ISO639-1" content="it"/>
<meta name="DC.Title" content=" Intervista con Catherine D’Ignazio: Data Feminism nella storia urbana e nel patrimonio"/>
<meta name="DC.Title.Alternative" xml:lang="en" content=" Interview with Catherine D’Ignazio:  Data Feminism for Cultural Heritage and Urban History"/>

Although not used by Google Scholar, they could be useful for general Google Search.

@luca-ludovico
Copy link

luca-ludovico commented Oct 16, 2021

a solution has been reported in the forum:
https://forum.pkp.sfu.ca/t/option-to-have-article-abstracts-and-titles-in-multiple-languages/33220/3
see a live example:
https://digitcult.lim.di.unimi.it/index.php/dc/article/view/191

Dear all, here is the code we wrote for DigitCult.
Let me recall the behaviour we had to implement. We usually publish articles in Italian; in this case, we require that the title, subtitle, and abstract are made available in English too, and we display them in a smaller size. We also accept papers originally written in English; in this case, we just show the English version.
A good example is available here: https://digitcult.lim.di.unimi.it/index.php/dc/issue/view/13 (most papers in Italian, a few papers in English).

Basically, you have to modify two files:

  1. \templates\frontend\objects\article_summary.tpl
  2. \templates\frontend\objects\article_details.tpl

The references to $article->getLocalizedTitle() and ->getLocalizedAbstract() have to be modified into loops on the data structures resulting from article->getTitle() and ->getAbstract(), which are arrays. You can iterate over them through foreach statements, e.g. if you don't know how many languages you have to manage, or simply target the languages you are interested in, as in our scenario.

In our case, the first file - article_summary.tpl - has been transformed into:

<div class="title">
	<a href="{url page="article" op="view" path=$articlePath}">
	{assign var="titleIta" value=$article->getTitle("it_IT")}
	{assign var="titleEng" value=$article->getTitle("en_US")}
	{if $titleIta|count_characters > 0}
		{$titleIta|strip_unsafe_html}<br /><small>
	{/if}
	{$titleEng|strip_unsafe_html}
	{if $titleIta|count_characters > 0}
		</small>
	{/if}
	</a>
</div>

In the second file - article_details.tpl - please note that the code lines reported below are not continuous, there is a gap where you see the sequence "..."

<article class="obj_article_details">
{assign var="titleIta" value=$article->getTitle("it_IT")}
{assign var="titleEng" value=$article->getTitle("en_US")}
{assign var="subtitleIta" value=$article->getSubtitle("it_IT")}
{assign var="subtitleEng" value=$article->getSubtitle("en_US")}

<h1 class="page_title">
	{if $titleIta|count_characters > 0}
		{$titleIta|escape}
	{/if}
</h1>
{if $subtitleIta|count_characters > 0}
	<h2 class="subtitle">
		{$subtitleIta|escape}
	</h2>
{/if}
<h1 class="page_title">
{if $titleEng|count_characters > 0}
	{$titleEng|escape}
{/if}
</h1>
{if $subtitleEng|count_characters > 0}
	<h2 class="subtitle">
		{$subtitleEng|escape}
	</h2>
{/if}

...

{* Abstract *}
{assign var="abstractIta" value=$article->getAbstract("it_IT")}
{assign var="abstractEng" value=$article->getAbstract("en_US")}

{if $abstractIta|count_characters > 0}
	<div class="item abstract">
		<h3 class="label">Abstract [ita]</h3>
		{$abstractIta|nl2br}
	</div>
{/if}
{if $abstractEng|count_characters > 0}
	<div class="item abstract">
		<h3 class="label">Abstract [eng]</h3>
		{$abstractEng|nl2br}
	</div>
{/if}

@fgnievinski
Copy link
Contributor

Attaching the modified .tpl files for download:
rpkpojsoptiontohavearticleabstractsandtitlesin.zip

@fgnievinski
Copy link
Contributor

fgnievinski commented Jan 20, 2023

I just realized CrossRef already supports multiple titles in different languages, e.g.:

<titles>
<title>When your best metadata isn't good enough: working with an imperfect specification</title>
</titles>
<titles language="fr">
<title>Quand vos meilleures métadonnées ne suffisent pas: travailler avec une spécification imparfaite</title>
</titles>

background: https://community.crossref.org/t/multi-language-support/3054/9

support for exporting multilingual metadata, even for single-language articles, is a frequent discussion forum topic, e.g.:
https://forum.pkp.sfu.ca/t/ojs-3-crossref-and-metadata-in-different-languages/50977
https://forum.pkp.sfu.ca/t/crossref-export-plugin-does-not-export-the-data-in-the-original-language/23368/7
https://forum.pkp.sfu.ca/t/ojs-does-the-crossref-export-plugin-registeres-doi-with-two-titles/3929

edit: actually, crossref doesn't fully support titles in multiple languages; it does support additional titles, but their language is undefined:
https://community.crossref.org/t/multi-language-support/3054/17

jyhein added a commit to jyhein/ojs that referenced this issue Oct 12, 2023
@jyhein
Copy link
Contributor

jyhein commented Oct 12, 2023

Issue description

One of the most frequent issues with metadata is that editors will enter content with more than one language into a single field because they want all the data visible for the reader without the need to switch the UI language. For smaller languages, it is for example very common to write an English abstract for the article. It is likely common to see two languages in a single abstract field because the editor wants to show both abstracts on an article landing page. This example could be equally true for other metadata fields such as title and keywords.
It means that although visually working, the language encoding does not match the content. For some search engines like Google this does not make a difference, because it will ignore the HTML lang attribute in any case, but other crawlers like Bing will take these into account. However, this is a major problem when the metadata is sent upstream ie. to other services and also for screen readers.

Changes

The suggested solution is to build a set of theme options in the Default theme in OJS/OMP/OPS that enable the simultaneous display of specified metadata fields in the Landing page by simply defining those fields and editing the theme settings. The implementation in the Default theme can then be used as an example in theme development. If required, additions to the core ThemePlugin functionality are added.

The attached PR's includes the following code changes:

  • Add a new theme option to the Default theme where editors can select which fields are shown with multiple languages. The choices include title and subtitle, abstract, keywords. Selections are made with a simple checkbox.
  • The selected fields are shown in all available submission translations in the landing page.
  • Use HTML lang attribute to determine content language
  • For Submission titles the title matching the selected UI language is shown inside a hgroup element using h1 for main title and h2 for subtitle
  • The translated titles are shown inside another hgroup with a aria-label describing the content and h2 elements with lang attributes listing the translated titles
  • Keywords and abstracts include lang attributes and a description of the content

<hgroup>
<h1>Title</h1>
<h2>Subtitle</h2
</hgroup>
<hgroup id aria-label="Article titles in other languages">
<h2 lang="fi">Suomenkielinen otsikko - Suomenkielinen alaotsikko</h2>
<h2 lang="fr">Titre en français - Sous-titre en français</h2>
</hgroup>

PRs:

OJS: pkp/ojs#4050
OPS: pkp/ops#574
OMP: pkp/omp#1466

jyhein added a commit to jyhein/ops that referenced this issue Oct 12, 2023
jyhein added a commit to jyhein/omp that referenced this issue Oct 12, 2023
@jyhein
Copy link
Contributor

jyhein commented Oct 18, 2023

Separate title groups for primary language (UI or submission language) and other languages. Aria attributes are for screen readers. The example is just a suggestion that may need to be changed.

<hgroup>
<h1>Title</h1>
<h2>Subtitle</h2>
</hgroup>
<hgroup id aria-label="Article titles in other languages">
<h2 lang="fi">Suomenkielinen otsikko - Suomenkielinen alaotsikko</h2>
<h2 lang="fr">Titre en français - Sous-titre en français</h2>
</hgroup>

Other choices:

The titles are as in the default theme. Titles in other languages are in their own section either directly under the titles or directly above keywords.

<h1>Title</h1>
<h2>Subtitle</h2

Then:

<section>
<h2 lang="en">Article titles in other languages</h2>
<p lang="fi">Suomenkielinen otsikko: Suomenkielinen alaotsikko</p>
<p lang="fr">Titre en français: Sous-titre en français</p>
</section>

OR

<section>
<h2 lang="en">Article titles in other languages</h2>
<ul>
<li lang="fi">Suomenkielinen otsikko: Suomenkielinen alaotsikko</li>
<li lang="fr">Titre en français: Sous-titre en français</li>
</ul>
</section>

jyhein added a commit to jyhein/ojs that referenced this issue Nov 16, 2023
jyhein added a commit to jyhein/ojs that referenced this issue Nov 16, 2023
jyhein added a commit to jyhein/ojs that referenced this issue Nov 17, 2023
jyhein added a commit to jyhein/ojs that referenced this issue Nov 22, 2023
jyhein added a commit to jyhein/ojs that referenced this issue Nov 27, 2023
jyhein added a commit to jyhein/ops that referenced this issue Nov 27, 2023
jyhein added a commit to jyhein/omp that referenced this issue Nov 27, 2023
jyhein added a commit to jyhein/ojs that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete.
Projects
Status: No status
Development

No branches or pull requests

6 participants