From 4bfde69a6dc7950a56b109e92e93b2f82447fc90 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 16 Oct 2003 10:44:10 +0000 Subject: [PATCH] locale-exists: New script to test whether a given locale exists on the system. --- locale-exists | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 locale-exists diff --git a/locale-exists b/locale-exists new file mode 100755 index 0000000..05c7e5b --- /dev/null +++ b/locale-exists @@ -0,0 +1,8 @@ +#! /bin/sh +set -e + +# Takes a locale as the first argument, or assumes $LANG if there are no +# arguments. Exits zero if the given locale exists, and non-zero otherwise. + +[ "$1" ] && export LANG="$1" +PERL_BADLANG=0 perl -MPOSIX -le 'exit 1 unless setlocale(LANG, "")' -- 2.30.2