plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
508 stars 117 forks source link

Validation for `langid`? #1386

Open pauloney opened 4 days ago

pauloney commented 4 days ago

Would it be possible (or desirable) to add a validation for the value of langid at the Biber level?

From my point f view it would be really nice. It is too easy to make a mistake, or typo, that can go undetected...

moewew commented 4 days ago

A Biber-side validation of langid values would require a list of supported languages. But at least in principle language modules for babel/polyglossia can be loaded more or less directly from a file without announcing them further first. So such a list would not only be a hassle to maintain, it also has the potential to yield wrong results even if it is up-to-date with what is available on CTAN, say.

pauloney commented 4 days ago

But isn't that exactly the use-case for a 'Warning' ? Something that is not fatal and will not stop processing, but will warn the user that something is amiss.

This happens to the ISBN validation on every run. The ISBN validator knows almost nothing about:

So when I run biber, I always get a warning about lots of them and I keep an eye on it to make sure no new ones are creeping in. I update the list frequently to get all the new numbers, and override what I got from CTAN. Overall it is, in the end, a very useful feature.

It is true you can load a language with your own files, your own name and your own invented langid, but that is a LOT rarer than an ISBN that is not in the current list.

Paulo Ney

On Tue, Sep 24, 2024 at 10:08 AM moewew @.***> wrote:

A Biber-side validation of langid values would require a list of supported languages. But at least in principle language modules for babel/ polyglossia can be loaded more or less directly from a file without announcing them further first. So such a list would not only be a hassle to maintain, it also has the potential to yield wrong results even if it is up-to-date with what is available on CTAN, say.

— Reply to this email directly, view it on GitHub https://github.com/plk/biblatex/issues/1386#issuecomment-2371857140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR7WYV4NXKSJ6TFLEL4KCTZYGMBTAVCNFSM6AAAAABOXFPRZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZRHA2TOMJUGA . You are receiving this because you authored the thread.Message ID: @.***>

pauloney commented 1 hour ago

... and in retrospect, biber already does many other validations of entries, and things like:

edition = {Second},
year = {1957-58},

get their own Warnings. So adding one more for langid would just been in line with what is nortmally done.

People that load a whole new language by file and with a fake langid SHOULD get at least a warning....