--- loncom/localize/lonlocal.pm 2003/09/17 01:45:14 1.4 +++ loncom/localize/lonlocal.pm 2003/09/20 17:04:02 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Localization routines # -# $Id: lonlocal.pm,v 1.4 2003/09/17 01:45:14 www Exp $ +# $Id: lonlocal.pm,v 1.8 2003/09/20 17:04:02 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,6 +67,19 @@ sub mt (@) { } } +# ============================================================== What language? + +sub current_language { + return $lh->language_tag(); +} + +# ============================================================== What encoding? + +sub current_encoding { + my $enc=$lh->maketext('char_encoding'); + return ($enc eq 'char_encoding'?'':$enc); +} + # ============================================================== Translate hash sub texthash { @@ -76,13 +89,19 @@ sub texthash { } return %hash; } +# ======================================================== Re-route translation + +sub clearreroutetrans { + &reroutetrans(); + $reroute=''; +} # ======================================================== Re-route translation sub reroutetrans { $ENV{'transreroute'}=1; - $reroute=''; } + # ==================================================== End re-route translation sub endreroutetrans { $ENV{'transreroute'}=0; @@ -97,6 +116,11 @@ sub endreroutetrans { sub get_language_handle { $lh=Apache::localize->get_handle(&Apache::loncommon::preferred_languages); + $r->content_languages(["¤t_language()"]); + my $enc=¤t_encoding(); + if ($enc) { + + } } 1;