How can I display the galley according to the selected OJS language?

Hi, I’m using version 2.4.8. I have a pdf article in Spanish that is translated into English and I want to show the one that corresponds to the selected OJS language for the user.
For example if you select in the input of languaje “ingles” I want to only show the pdf in English and viceverza.

Can someone tell me where I can write the conditional?
and how can I know what is the name of the variable that uses ojs for PDFs of the articles?

I am new to ojs, I tried to explain the best I could, I would really appreciate your help tkanks!

Hi @Diana.K,

OJS doesn’t work like that. It shows always all PDFs. The PDF that is in the language you have selected is presented with PDF only, while PDFs in other languages have beside PDF also language info.

Regards, Primož

Hi, @primozs

thanks for answering!
Regards, Diana

Hi, I don’t know if it still be helpfull for you but I’ve created a solution for that and maybe it’ll be useful for someone else.

I’ve used the active locale string {$currentLocale} as a class on the article page (plugins/themes/your_theme/templates/frontend/pages/article.tpl) and another class using galley locale string {$galley->getLocale()|escape|strip} on galley link (plugins/themes/your_theme/templates/frontend/objects/galley_link.tpl.

After that, I’ve formated with css to show/hide desired galley language on active locale view.

My CSS stayed like this:

#article.en_US .galley-link.pt_BR,
#article.pt_BR .galley-link.en_US {display: none;}

1 Like