<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 Jul 2022 at 06:33, Max Chernoff <<a href="mailto:mseven@telus.net">mseven@telus.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(I'm *not* a TeX Live maintainer, just a regular user)<br></blockquote><div><br></div><div>same here</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
A few general comments here:<br>
<br>
1: "locale" is a POSIX command, so it should work with macOS, BSD, and<br>
Linux. It will not work with Windows though. There are other commands<br>
that you can use on Windows to get the current language; however, none<br>
of them would be safe enough for restricted \write18. It wouldn't be too<br>
hard to make a "safe" wrapper script for Windows, but this is of course<br>
extra work.<br></blockquote><div><br></div><div>I would think this is a show stopper, also you can already access the environment</div><div>using kpsewhich</div><div><br></div><div>\documentclass{article}<br>\usepackage[T1]{fontenc}<br>\begin{document}<br><br>{\catcode`\_=12<br>\input{|kpsewhich -expand-var $LC_CTYPE}<br>}<br><br>\end{document}</div><div><br></div><div>prints en_US.UTF-8 for me.</div><div><br></div><div>or more packaged version using texosquery (code here from its manual)<br></div><div><br></div><div>\documentclass{article}<br>\usepackage{tex-locale}<br>\begin{document}<br>Language: \CurrentLocaleLanguageNativeName.<br>Region: \CurrentLocaleRegionNativeName.<br>Today: \CurrentLocaleDate. (Compare with \today.)<br>Time: \CurrentLocaleTime.<br>Currency Symbol: \CurrentLocaleCurrency<br>Integer:<br>\texosqueryfmtnumber{\CurrentLocaleIntegerPattern}{123456}{0}{0}<br>Decimal:<br>\texosqueryfmtnumber{\CurrentLocaleDecimalPattern}{123456}{78}{0}<br>Percentage:<br>\texosqueryfmtnumber{\CurrentLocalePercentPattern}{0}{65}{0}<br>Currency:<br>\texosqueryfmtnumber{\CurrentLocaleCurrencyPattern}{1234567}{0}{0}<br>\end{document}</div><div><br></div><div>producing</div><div><br></div><div>Language: English. Region: United Kingdom. Today: 28 July 2022. (Com-<br>pare with 28th July 2022.) Time: 08:44:23. Currency Symbol: £ Integer:<br>123,456 Decimal: 123,456.78 Percentage: 65% Currency: £1,234,567.00</div><div><br></div><div>Neither require shell escape.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2: I don't think that this is a good idea. One of the key features of<br>
TeX (and LaTeX) is that identical input files should produce identical<br>
output across all systems. Guessing a default language like this would<br>
break this guarantee, which is probably ill-advised. I think that a<br>
better approach would be to issue a warning if a default language isn't<br>
set. This avoids any issues with system dependency or "hidden" state.<br>
<br></blockquote><div><br></div><div>I agree here, it is the same as other local settings notably paper size. <br></div><div>while a "use local locale" option might be useful, the default shouldn't</div><div>be system dependent. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3: This is already (roughly) possible with LuaTeX right now:<br>
<br></blockquote><div>Yes as above it's also possible in all engines using restricted shell escape. <br></div><div><br></div><div>David</div><div><br></div></div></div>