On 10/09/2023 23:52, Ihor Radchenko wrote:
Max Nikulin writes:
On 09/09/2023 16:11, Ihor Radchenko wrote:
I am not sure if making a breaking change to public constant is the best
approach.
What about simply adding an extra entry:
("de" ....)
("de-de" <copy of "de" property list>)
Ideally it should not be a public constant. Values should be accessed
using a helper that returns "de" value for "de-de", "de-ch", "de-it"
without copies, unless a more specific key is defined as it is done for
de-at.
It is already a public constant. And I see no strong reason to change
this (strong enough to justify breaking change).
Every piece of code accessing this public constant must implement
fallback from e.g. "de-ch" (or de_CH) to "de". Or to "en" for an
unsupported language. To achieve consistent behavior it is better to
provide a helper function.
I have a hope that properties may be generated from CLDR data, LaTeX
babel .ini files, etc. However it should be possible to override
specific properties.
For context, I plan to provide a global language-identifier alist that
will link human-readable language names to abbreviations like "de",
"de-de", etc.
This languange-region identifiers may be written in different way
(dash/underscore, case), but they are used specify POSIX locale LANG,
LC_* and extensions like LANGUAGE, so in some cases human friendly names
may be less convenient.
Thus, auto-generating the alist may be not reliable. At least some
manual overseeing may be needed.
Of course, some overrides may be necessary. E.g. it was decided to use
French inner quotes different from CLDR.
Though I am not sure if we can easily handle tricky
cases like weird installation directory for TeXLive or MikTeX.
kpsewhich babel-de.ini
/usr/share/texlive/texmf-dist/tex/generic/babel/locale/de/babel-de.ini