How to setup up PDF download links

Describe the issue or problem
Our OJS installation has two languages configured: English and Italian. For each published article in our journal, the site shows two PDF download links instead of one

Steps I took leading up to the issue

  1. Select English as the current user-interface language
  2. Open the details of an article
  3. Scroll down to the Downloads section
  4. Two buttons appear with the text “PDF” and “PDF (Italian)”, respectively.
  5. We would expect just one button with the text “PDF”, because we do not provide a translation for our articles: each article has only one text, regardless of the language selected for the UI.
  6. We haven’t found any setting that allows to adjust this.

What application are you using?
OJS 3.5.0.3

Additional information
Here are two screenshots of the download area for the same article. The first screenshot was taken with the UI language set to English. The second screenshot was taken with the UI language set to Italian.

double-pdf-en-it

double-pdf-it-en

Hi @rifp,

To clarify one of these pieces:

By this do you mean that your articles may sometimes be in English and sometimes in Italian? And that it could vary from article-to-article?

What I suspect is happening here is that is in OJS 3.5, each galley has a locale attribute, and if that galley’s locale matches an enabled journal language, OJS will list a download link for that locale. When both English and Italian are enabled, and your PDF galley is effectively associated with both locales (for example via metadata or how it was created), OJS renders “PDF” (for the current locale) and “PDF (Italian)” (for the other enabled locale).

So, what is happening is that OJS does not try to infer that this is really just one language from the article content; it only uses the combination of galley locale plus enabled languages to decide which buttons to show.

Try these checks on a single article first:

*Edit the article’s galley: Go to the submission → Publication → Galleys.
Check whether there is more than one PDF galley (e.g., one with locale “en_US” and another with “it_IT”). If there are two, delete the extra one or make only one active.
2) Verify the galley locale: If you only want one language label, set the galley’s locale consistently (e.g., all PDFs set to English).
3) Avoid duplicating the same PDF as a separate galley for the other language unless you truly have a translated version (I’m not entirely sure if this is the case with your journal, but perhaps you could send a link to journal so I could have. closer look.

Check the Journal language settings:

  • Settings → Website → Languages.
  • Confirm that only the languages you actually need as UI languages are enabled, and that the supported subumission languages match how you work (i.e. if you always publish in one language, consider limiting submission languages).

Hi rcgillis,

thanks a lot for the detailed explanation.

Each article in our journal is either in English or in Italian. Each article contains an abstract in both languages. For each article, we have indeed created two galleys, one for English and one for Italian, using the same PDF file. By doing this we hoped that the system would offer only one of the two files for download, according to the language currently selected as UI language. Instead, we get two buttons / galleys as described in my original question.

As a test, we have created only one (English) galley for an article that is going to be published in a new issue. When we switch the UI to English, we get the correct galley:

single-pdf-en

However, when we switch to Italian, the galley is displayed as

single-pdf-it

which is not what we want: We would like to have a single galley with the text “PDF”, no matter which language is selected in the user interface.

Regarding your suggestion:

Verify the galley locale: If you only want one language label, set the galley’s locale consistently (e.g., all PDFs set to English).

Some articles are in English and some in Italian, but we would prefer if the galley did not show an article’s language when the other language is active in the UI.

We haven’t found a way to achieve this, since we must specify a language for each galley, and the text in the download button is influenced by both the language of the galley and the active UI language. Are we missing some option? We basically would like to create language-less galleys. Is this possible?

We only recently migrated to OJS 3.5.0-3 from version 2.4.8-5. We had patched the old version to format the galleys as I described above (one galley, no language indication) but we were wondering if we could achieve the same with some appropriate configuration in the new installation.

Hi @rifp,

Thanks for explaining your use case in more detail, and for doing the test with your current galleys.

With respect to your desired behaviour:

I think that OJS’ default behaviour is to display whatever galleys that are uploaded - not opt for either or based on the language/locale. Changing this would likely require a modification of the core code (which carries certain risks, and would need to be maintained between upgrades), or the use of a plugin, I suspect. But let me check with our team to see if there isn’t an alternative.

-Roger
PKP Team

Hi @rifp,

Spoke with our dev team about this, and they had this to say;

We don’t do that out of the box because most users would never expect to see different galleys based on what language they have chosen. We want to highlight multilingual options where they’re available, and not hide them behind a language switcher. Most journals can’t afford the time and effort to publish galleys in all languages the journal UI is available in. For those who want to do things differently, they’d need to work with the theming tools.

So, I think, going back to what I was saying about this requiring custom code. This might be technically feasible, but could be done through a custom theme, if one had the know-how and willingness to develop customizations within a them around this. More information on theming can be found here: https://docs.pkp.sfu.ca/pkp-theming-guide/

-Roger
PKP Team

Hi Roger,

thanks for the information. We will look into themes.

Just one clarification regarding our requirements. It is not a requirement for us to provide one article galley per UI language. Having one galley per language was our previous workaround on version 2.4.8 to avoid buttons containing a language indication. Since it is compulsory to associate a language to each galley, we always had a language combination (UI language + galley language) in which some galley buttons were displayed incorrectly as “PDF (Italian)” or “PDF (Inglese)”.

So our solution / workaround was to create a galley for each UI language containing the same PDF file. We also patched the OJS code by replacing

$article->getGalleys()

with

$article->getLocalizedGalleys()

in three templates. In this way, only the galley for the current locale was displayed, and that contained only the text “PDF”, because it was in the correct locale.

As far as we know, we cannot use this workaround any more, because the method getLocalizedGalleys() has been removed. We haven’t found a similar way to filter the galleys in OJS 3.

So we hope we find a way to change the text in the galley button by using a custom theme. In this case, we would remove the double galleys from our system.

Best regards,

RIFP admin

Hi @rifp,

Thanks for the additional clarification. I’m not totally sure about making these changes. I’ll see if someone can weigh in on this

-Roger
PKP Team

Hi @Roger,

thanks for your hints: I found a solution that works for us.

We use the bootstrap3 theme plug-in. I was able to change the galleys by modifying two templates in that plug-in.

As soon as I have some spare time, I will try to make a child plug-in that provides the same two custom templates.

Best regards,

rifp admin

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.