[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonnavmaps.pm /localize lonlocal.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 20 Sep 2003 13:21:45 -0000
www Sat Sep 20 09:21:45 2003 EDT
Modified files:
/loncom/interface loncommon.pm lonnavmaps.pm
/loncom/localize lonlocal.pm
Log:
Get current language directly from lonlocal
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.121 loncom/interface/loncommon.pm:1.122
--- loncom/interface/loncommon.pm:1.121 Fri Sep 19 11:06:42 2003
+++ loncom/interface/loncommon.pm Sat Sep 20 09:21:45 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.121 2003/09/19 15:06:42 albertel Exp $
+# $Id: loncommon.pm,v 1.122 2003/09/20 13:21:45 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1662,10 +1662,6 @@
}
}
return @genlanguages;
-}
-
-sub current_language {
- return (&preferred_languages)[0];
}
###############################################################
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.230 loncom/interface/lonnavmaps.pm:1.231
--- loncom/interface/lonnavmaps.pm:1.230 Wed Sep 17 17:29:44 2003
+++ loncom/interface/lonnavmaps.pm Sat Sep 20 09:21:45 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.230 2003/09/17 21:29:44 www Exp $
+# $Id: lonnavmaps.pm,v 1.231 2003/09/20 13:21:45 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -432,7 +432,7 @@
if (!$time) {
return &mt('never');
}
- unless (&Apache::loncommon::current_language()=~/^en/) {
+ unless (&Apache::lonlocal::current_language()=~/^en/) {
return localtime($time);
}
my $now = time();
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.5 loncom/localize/lonlocal.pm:1.6
--- loncom/localize/lonlocal.pm:1.5 Wed Sep 17 19:16:27 2003
+++ loncom/localize/lonlocal.pm Sat Sep 20 09:21:45 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Localization routines
#
-# $Id: lonlocal.pm,v 1.5 2003/09/17 23:16:27 www Exp $
+# $Id: lonlocal.pm,v 1.6 2003/09/20 13:21:45 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,6 +67,12 @@
}
}
+# ============================================================== What language?
+
+sub current_language {
+ return $lh->language_tag();
+}
+
# ============================================================== Translate hash
sub texthash {
@@ -103,6 +109,7 @@
sub get_language_handle {
$lh=Apache::localize->get_handle(&Apache::loncommon::preferred_languages);
+# &Apache::lonnet::logthis($lh->encoding().' - '.$lh->language_tag());
}
1;