[systemd-devel] Additional Locale Variables for Units and Number Format

Mantas Mikulėnas grawity at gmail.com
Tue Aug 29 20:19:19 UTC 2023


It sounds like you're reinventing LC_NUMERIC.

The locale system has a lot more than just LANG; it already allows the
number format to be overridden separately from the "language". Take a look
at `locale -k LC_NUMERIC` and <
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html>.

Adding custom variables would require changing a lot – I guess the main
consumers are libc (Glibc) and libstdc++ (GCC), but of course there are
many places which set the existing LC_* and expect things to change
accordingly, or which might implement the standard interfaces on their own
without using libc.

On Tue, Aug 29, 2023, 20:17 TJ Shipp <OneZoomer at msn.com> wrote:

> I am trying to add in support for a separate variable to change our unit
> system, and having both LANG and UNITS to identify the "locale" of the
> system.
> We are also not only looking for English versus Metric, but are looking
> for mixed units as well (both Imperial and Metric hybrid), as well as
> looking to add number formats (1,000.00 vs 1.000,00)
>
> And what is the best way to add support for a new system environment
> variable such as UNITS?
>
> P.S. If anyone is interested in contracting to do this work, please send
> me a private message outside this list.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230829/22c38e57/attachment.htm>


More information about the systemd-devel mailing list