sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.61k stars 97 forks source link

Bibliography always use curly quotes instead of language-dependent quotes #2024

Open Omikhleia opened 1 month ago

Omikhleia commented 1 month ago

SILE 0.14.17 or 0.15-develop

While the bibliograpĥy package has provision for i18n via fluent, it always use curly quotes for article titles, etc. That is, “'Title”

https://github.com/sile-typesetter/sile/blob/b2cc0841ff603abc335c5e66d8cc3c64b65365eb/packages/bibtex/bibliography.lua#L378-L382

This is naive, and wrong:

Omikhleia commented 1 month ago

N.B. I wouldn't be against transferring smartquotes.sile to the SILE organization, if it may help here... But it would need #1631 (#1641) to be sorted out first, so that it can be made independent from the silex.lang adaptation layer...

And since it would still be a 3rd-party dependency outside the core distribution (whether as of today, or as a subproject under the SILE organization), wouldn't it also imply removing the bibtex support from the core distribution to manage it separately? (Which might be a good option anyhow, such things do not really belong to the "core", esp. if we want to consider CSL support at one point...)

Omikhleia commented 1 month ago

I wouldn't be against transferring smartquotes.sile to the SILE organization, if it may help here

It might not be sufficient,

Omikhleia commented 1 month ago

The period likely does not go inside the quotes if following usual conventions.

Actually, the picture is not obvious either in English, with titles already ending in a punctuation mark:

See https://universitypark-lonestar.libanswers.com/faq/241427

The devil is in the details as always.

alerque commented 1 month ago

A smartquotes package in core (or at least the org) makes a lot of sense to me, but I'm not sure with all the other things going on here that this would actually be a good use case for it. It looks to me like the whole string assembly bit of this code just needs to be refactored into a localized string using Fluent. Just because there is more punctuation involved than words being translated doesn't make in an inappropriate use of the tech: taking a bunch of arguments and outputting them in a certain order with certain marks between them depending on the locale is a localization job. The whole thing should probably be processed at once, not section by section, allowing localizers not just us coders to have easier control over how it all goes together.

alerque commented 1 month ago

Any chance I could convince you to work up an MWE with an entry each in English and French for example such that we could test the outcome of any proposed solutions to this?

Omikhleia commented 1 month ago

A smartquotes package in core (or at least the org) makes a lot of sense to me, but I'm not sure with all the other things going on here that this would actually be a good use case for it. It looks to me like the whole string assembly bit of this code just needs to be refactored into a localized string using Fluent.

My current quick experiments lean towards both using smarquotes and Fluent, actually. But this is a "long-term" project (with bibliographies just on their way being assembled here) - so I wouldn't decide too soon on a solution, but you can count me 'in' at some step (i.e. after shorter term projects get completed)

Omikhleia commented 1 week ago

For the record, with CSL:

However, the following concern (from my previous comment) does not seem to be addressed:

  • Footnotes: Keep the comma after a title ending in a question or exclamation mark.
  • Bibliography: Omit the period after a title ending in a question or exclamation mark

The CSL strip-periods is something else, and does not cover these cases. There's no mention of them in the CSL specification, as far as I can tell. But this discussion on Zotero hints at it performing some extra "cleanup".