Re: allowing an @modifier for documentlanguage locale-based argument
Gavin Smith <[email protected]> Fri, 10 Apr 2026 17:18:34 +0100
| Newsgroups | gmane.comp.tex.texinfo.bugs |
|---|---|
| Message-ID | <adki2hGjFml1mCXQ@orangestar> |
On Fri, Apr 10, 2026 at 05:25:29PM +0200, Patrice Dumas wrote: > On Fri, Apr 10, 2026 at 12:38:32PM +0100, Gavin Smith wrote: > > > After reading some BCP 47 related information, such as > > > https://www.unicode.org/reports/tr35/tr35-76/tr35.html > > > I am now wondering if we should not have instead a way to specify the > > > script, directly, like > > > > > > @documentscript latin > > > > > > and construct a locale with @modifier for gettext translation retrieval, > > > but also construct a BCP 47 locale name for HTML, DocBook and possibly other > > > purposes. > > > > I like that idea better, as, on reflection, we have too much tricky code > > in texinfo.tex already and that would be much easier to implement in > > texinfo.tex. > > In texi2any, I think that using a BCP 47 locale internally would be > better, with a conversion to a traditional XPG locale name when needed. > There is a gnulib module, bcp47, that does the conversion from one > locale type to the other. I have found nothing in Perl, but it would be > easy to do a simple code for that by ourself. Again, what you might think as basic string processing may be hard to implement in TeX, so please avoid allowing elaborate arguments to @documentlanguage other than what is currently supported (it wasn't clear to me from your message whether you were proposing to use such "BCP 47" locale names as arguments to @documentlanguage or not).