# Hack: copy to the chroot the gtk20*.mo files from all the langpacks that
# the server has, to avoid installing the whole language packs for just the
# [Preferences] ldm button.
# Only do that for thin clients, not for fat clients.
case "$MODE" in
    after-install)
        test -z "$FAT_CLIENT_DESKTOPS" || return 0

        cd "$ROOT/usr/share/locale/"
        # For all chroot languages
        for LC_MESSAGES_DIR in */LC_MESSAGES/
        do
	        LANG_DIR="${LC_MESSAGES_DIR%/LC_MESSAGES/}"
	        # If the language file exists on the server
	        if [ -r /usr/share/locale-langpack/"$LANG_DIR"/LC_MESSAGES/gtk20.mo ]
	        then
		        cp /usr/share/locale-langpack/"$LANG_DIR"/LC_MESSAGES/gtk20*.mo \
			        "$ROOT/usr/share/locale/$LANG_DIR/LC_MESSAGES/"
	        fi
        done
        cd - > /dev/null
    ;;
esac
