#!/bin/sh
#
# Univention System Setup
#  language change script
#
# SPDX-FileCopyrightText: 2004-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

# shellcheck source=../setup_utils.sh
. /usr/lib/univention-system-setup/scripts/setup_utils.sh

info_header "$0" "$(gettext "Generating locales")"

[ "$check_ldap_access" = "1" ] &&
	exit 0

locale="$(get_profile_var locale)" ||
	exit 0

if [ -z "$locale" ]; then
	univention-config-registry unset locale
else
	univention-config-registry set locale="$locale"
fi

locale-gen

exit 0
