Lists installed system locales (on Linux, macOS, Windows)
lslocales is a small, standalone utility program that lists the locales installed on the host. On Windows it enumerates system locales via EnumSystemLocales and resolves each LCID with GetLocaleInfo (LOCALE_SNAME, falling back to LOCALE_SLANGUAGE). On POSIX it lists locale names as locale -a would, with a directory-scan fallback.
This is not lsloc (a recursive file-locator in ~/.bin).
Detailed instructions - via CMake - are provided in the accompanying INSTALL.md file.
The project creates a single executable program, lslocales.
$ lslocales --names-only | head
C
C.UTF-8
POSIX
en_AU.UTF-8
en_US.UTF-8
. . .Default output is id<TAB>name. When the id and name are identical (typical on POSIX) a single column is emitted; on Windows the id is the hex LCID.
Defect reports, feature requests, and pull requests are welcome on the lslocales GitHub page.
lslocales depends on:
For unit-testing, lslocales depends additionally on:
Other (similar) projects include:
- chomp;
- errni (errno on all platforms, and also GetLastError codes on Windows);
- lnunique;
- lstrip;
- mksock (Unix-only);
- ReadDebugString (Windows-only);
- realpath (Windows-only);
- rstrip;
- WriteDebugString (Windows-only);
lslocales is released under the 3-clause BSD license. See LICENSE for details.