ad_page_contract {

	return the page corresponding to the user language

    @author Emmanuelle Raffenne (eraffenne@gmail.com)
    @creation-date 2007-10-12
    @cvs-id $Id: index.vuh,v 1.1 2009/07/16 09:37:28 emmar Exp $

} 

# set default variables
set default_language "en"
set user_language [ad_conn language]

# redirect if possible
set path_info [ad_conn path_info]
if { [string eq $path_info ""] } {
    set path_info "index"
}

if { ![file exists [acs_root_dir]/packages/dotlrn/www/help/$user_language] } {
    set user_language $default_language
}

if { [file exists "[acs_root_dir]/packages/dotlrn/www/help/$user_language/${path_info}.adp"] || [file exists "[acs_root_dir]/packages/dotlrn/www/help/$user_language/${path_info}"]} {
    rp_internal_redirect /packages/dotlrn/www/help/${user_language}/${path_info}
} else {
    ns_returnnotfound
}
