the interpretation of the locale string is implementation-defined.
Thus, setlocale(3) ought to explain how the string is interpreted. By now, it only mentions predefined locales.
While at it, it also lacks the xref to locale(1).
The page documents:
Only three locales are defined by default, the empty string "" which
denotes the native environment, and the "C" and "POSIX" locales, which
denote the C language environment. A locale argument of NULL causes
setlocale() to return the current locale. By default, C programs start
in the "C" locale.
It also points to:
/usr/share/locale/locale/category locale file for the locale locale and
the category category.
Which can be used to discover the installed locales for a given category:
$ ls /usr/share/locale/*/LC_CTYPE | wc -l
This is certainly a method to actually find out the possible names - but I wouldn't call that a "documentation".
A commit references this bug:
Date: Sat Jun 27 20:55:48 UTC 2020
New revision: 362708
Explain how to learn about possible recognized locale names
Posix says that the interpretation of the locale string is
"implementation-defined", so we ought to document what is
Also add a cross reference to locale(1).
MFC after: 1 week
Fixed in HEAD, stable/12, and stable/11