Add installation of locales for Icinga Web - #496
Conversation
chrnie
left a comment
There was a problem hiding this comment.
Nice feature, thanks for picking up #475. I went through the review points and pushed the result as #497, which targets this branch rather than main - merging it there lands everything here.
The substance is in how locale identifiers turn into packages. The RedHat langpacks are split by language, not by territory, so the territory has to be dropped entirely: de_DE and de_AT both are glibc-langpack-de.
The old regex kept everything up to the last underscore, which made sr_RS_latin resolve to glibc-langpack-sr_RS, and an entry without an underscore did not match at all, so a bare de reached dnf as a package literally named de.
Both fail with a package-not-found error naming a string the user never wrote, so identifiers are now validated up front against _ and refused with a message that says what the expected form is.
The README also contradicted itself - the prose asked for . with a dot while the example below it used de_DE. And locale_gen gets one call per locale now, since it only accepts a
list from community.general 9.3.0 onwards.
Fixes #475