---
name: "validlocale"
section: "8"
platform: "linux"
package: "locales"
version: "2.41-12+deb13u4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/validlocale"
---

# validlocale(8)

Test if a given locale is available

## NAME

validlocale - Test if a given locale is available

## SYNTAX

validlocale \<*locale*\>

## DESCRIPTION

Test if the locale given as argument is a valid locale.  If it isn't, print on stdout the string to add to /etc/locale.gen to make locale-gen generate the locale (if it exists at all).

## FILES

*/usr/sbin/validlocale*\
 */usr/share/i18n/SUPPORTED*

## ENVIRONMENT VARIABLES

- **DEFAULTCHARSET**

  Which charset to assume if the given locale is missing from the list of supported locales.

## EXAMPLES

If you give a valid locale as parameter, it outputs a string specifying this on stderr:

-

  % validlocale C\
   locale 'C' valid and available

When given a invalid (not generated or just nonexistent), it outputs a string on stderr telling that this is an invalid locale, and a string to stdout with the string to add to /etc/locale.gen to have this locale generated:

-

  % validlocale de\_AU@euro\
   locale 'de\_AU@euro' not available\
   de\_AU@euro ISO-8859-15

## AUTHORS

Petter Reinholdtsen \<pere@hungry.com\>

## SEE ALSO

[locale-gen(8)](/locale-gen/8.md), [localedef(1)](/localedef/1.md), [locale(1)](/locale/1.md)
