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

Improve galleyLabels for multilang journals #6275

Open
marcbria opened this issue Oct 9, 2020 · 3 comments
Open

Improve galleyLabels for multilang journals #6275

marcbria opened this issue Oct 9, 2020 · 3 comments
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. Try Me This issue might be good for a new contributor. Can you help us?

Comments

@marcbria
Copy link
Collaborator

marcbria commented Oct 9, 2020

Describe the problem you would like to solve
The way the label of a galley is created (and the presentation) needs to be improved to fit better in multi-language journals.

Right now, if user's $currentLocale (navigation locale) is the same as the galley lang, you only get the label but, if is different, the locale of the galley will be concatenated after, getting labels as follows:

  • PDF (English)
  • PDF (Español (España))

There are three problems here.

To start, the variable $galleyLabel that you can reach in galley_link.tpl is filled with "ArticleGalley::getGalleyLabel()" that is a wrapper method that automatically appends the language, hardcode the parenthesis... and this limits what you can do on the presentation layer.

Second, the logic behind adding those locales (hidden in currentLocale and forced in the rest) is not necessarily the way journals would like to work:

  • Some would like to add labels to every galley (even is the same than currentLocale).
  • Others would like to hide locale part (and manage locale manually in the galley form).
  • And rest would like the way is working now.

Finally, the locale naming is taken from locales.xml in registry and is the same for galleys, language selector, etc. when is not difficult to find scenarios where you would like to have different mapping for each part. For instance, I like to have galleys with shorter equivalences as follows:

  • English --> EN
  • Spanish --> ES
  • French --> FR
  • Catalan --> CAT

Describe the solution you'd like

  • Harcoded parenthesis probably need to be moved a theming level.
  • Multilang logic probably need to be set in the journal's configuration.
  • Unsure about how to find a simple solution about the "locale naming"...

Who is asking for this feature?
I think every journal publishing multilang galleys would be happy with an improvement in this.

@NateWr
Copy link
Contributor

NateWr commented Oct 12, 2020

Thanks @marcbria. I agree we need to implement a translatable string that implements the parentheses, so that other languages can change it.

And we can also use the first two characters of a locale key (en_US) to get a better presentation of the language. That said, the locale key itself won't be translated. So for Chinese someone will see ZH and in Arabic they will see AR instead of seeing the appropriate character in that language's character set. Maybe what we need is for each locale to provide its own short language name.

Just a note that if people want to skip the language information in their own templates, they can edit galley_link.tpl and replace {$galley->getGalleyLabel()|escape} with {$galley->getLabel()|escape}. That will get just the label that's entered in.

@NateWr NateWr added Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. Try Me This issue might be good for a new contributor. Can you help us? labels Oct 12, 2020
@asabharwal
Copy link

@marcbria and @NateWr!

Thank you for this discussion. I have been looking for this information for the past couple of years, and you had the solution here. I would also like to thank @rcgillis for pointing me here.

I think, that the ISO language codes (either the 2 or 3-digit formats like EN or ENG) would be a better alternate to seeing fully spelled-out label albeit this should be a journal's choice that they should make when they add locale and language to the journal.

Question: will the next upgrade replace this modified file? I like to see PDF just appear as a universal galley label as not all Spanish speakers identify themselves with Spain. Many more Spanish speakers live in South America, but at l;east those languages that use Latin script will not need a translator to show PDF in their own language.

Again, thank you for the instructions @NateWr. I now only see PDF for our bi-lingual journal.

@asabharwal Arjun Sabharwal

@marcbria
Copy link
Collaborator Author

Related with #6080.
Adressed in #7336.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. Try Me This issue might be good for a new contributor. Can you help us?
Projects
None yet
Development

No branches or pull requests

3 participants