#!/usr/bin/perl
# This script configures the locale environment.
# Applies only to woody release.

use strict;
use warnings;

# We use some helper subroutines so we have to include
# their definitions
require '/usr/lib/localization-config/common/editconfig.pl';
require '/usr/lib/localization-config/common/log.pl';

# If no locale is given as argument, quit
my $lang = $ARGV[0] or log_die("$0: No language given");

# The configuration files
my $gdmconfig = "/etc/default/gdm";

# Split locale entry into separate variables:
# language, country and extra information (eg '@euro')
my ($langcode) = $lang =~ m/^(..)_(..)(@.+)?/;

# Print the supported locale entries.
if ("supported" eq $lang) {
    print "all\n";
    exit 0;
}

UpdateOrAppendVariable($gdmconfig, "LANG", $langcode, "=");