--- loncom/localize/lonlocal.pm 2003/09/28 02:06:37 1.14 +++ loncom/localize/lonlocal.pm 2003/09/28 03:02:36 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Localization routines # -# $Id: lonlocal.pm,v 1.14 2003/09/28 02:06:37 www Exp $ +# $Id: lonlocal.pm,v 1.15 2003/09/28 03:02:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -225,6 +225,18 @@ sub current_encoding { } } +# =============================================================== Which locale? +# Refer to locale -a +# +sub current_locale { + if ($lh) { + my $enc=$lh->maketext('lang_locale'); + return ($enc eq 'lang_locale'?'':$enc); + } else { + return undef; + } +} + # ============================================================== Translate hash sub texthash { @@ -265,7 +277,7 @@ sub get_language_handle { if (&Apache::lonnet::mod_perl_version == 1) { $r->content_languages([¤t_language()]); } - setlocale(LC_ALL,¤t_language.'.'.¤t_encoding); + setlocale(LC_ALL,¤t_locale); } 1;