[LON-CAPA-cvs] cvs: modules /gerd makemap.pl loncom/interface lonmenu.pm lonpreferences.pm loncom/localize lonlocal.pm loncom/localize/localize de.pm loncom/lonnet/perl lonnet.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 17 Sep 2003 01:45:14 -0000


This is a MIME encoded message

--www1063763114
Content-Type: text/plain

www		Tue Sep 16 21:45:14 2003 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm lonpreferences.pm 
    /loncom/localize	lonlocal.pm 
    /loncom/localize/localize	de.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /modules/gerd	makemap.pl 
  Log:
  Better German lexicon, work on translator interface.
  
  
--www1063763114
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20030916214514.txt"

Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.87 loncom/interface/lonmenu.pm:1.88
--- loncom/interface/lonmenu.pm:1.87	Tue Sep  9 14:46:28 2003
+++ loncom/interface/lonmenu.pm	Tue Sep 16 21:45:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.87 2003/09/09 18:46:28 www Exp $
+# $Id: lonmenu.pm,v 1.88 2003/09/17 01:45:14 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,15 +44,29 @@
 use Apache::lonhtmlcommon();
 use Apache::loncommon;
 use Apache::File;
+use Apache::lonlocal;
+
 use vars qw(@desklines $readdesk);
+
+
 my @inlineremote;
 my $font;
 my $tabbg;
 my $pgbg;
 
+# ================================================================ Little texts
+
+sub initlittle {
+    return &Apache::lonlocal::texthash('ret' => 'Return to Last Location',
+				       'nav' => 'Navigate Contents',
+				       'main' => 'Main Menu',
+				       'launch' => 'Launch Remote Control');
+}
+
 # ============================= This gets called at the top of the body section
 
 sub menubuttons {
+    &Apache::lonlocal::reroutetrans();
     my $forcereg=shift;
     my $target  =shift;
     my $registration=shift;
@@ -62,16 +76,17 @@
     my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'});
     if ($ENV{'browser.interface'} eq 'textual') {
 # Textual display only
+	my %lt=&initlittle();
         if ($ENV{'request.course.id'}) {
 	    $navmaps=(<<ENDNAV);
-<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">Navigate Contents</a>
+<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">$lt{'nav'}</a>
 ENDNAV
             if (($ENV{'REQUEST_URI'}=~/^\/adm\//) &&
          ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) &&
          ($ENV{'REQUEST_URI'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {
                 my $escreload=&Apache::lonnet::escape('return:');
                 $reloadlink=(<<ENDRELOAD);
-<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">Return to Last Location</font></a>
+<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a>
 ENDRELOAD
             }
         }
@@ -79,7 +94,7 @@
 <script>
 // BEGIN LON-CAPA Internal
 </script>
-<a href="/adm/menu" target="_top">Main Menu</a>
+<a href="/adm/menu" target="_top">$lt{'main'}</a>
 $reloadlink $navmaps<br />
 <script>
 // END LON-CAPA Internal
@@ -90,6 +105,7 @@
     } elsif ($ENV{'environment.remote'} eq 'off') {
 # Remote Control is switched off
 # figure out colors
+	my %lt=&initlittle();
 	my $function='student';
         if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) {
 	    $function='coordinator';
@@ -113,7 +129,7 @@
         if ($ENV{'request.course.id'}) {
 	    $navmaps=(<<ENDNAVREM);
 <td bgcolor="$tabbg">
-<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top"><font color="$font">Navigate Contents</font></a></td>
+<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top"><font color="$font">$lt{'nav'}</font></a></td>
 ENDNAVREM
             if (($ENV{'REQUEST_URI'}=~/^\/adm\//) &&
                 ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) &&
@@ -121,7 +137,7 @@
                 my $escreload=&Apache::lonnet::escape('return:');
                 $reloadlink=(<<ENDRELOAD);
 <td bgcolor="$tabbg">
-<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">Return to Last Location</font></a></td>
+<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a></td>
 ENDRELOAD
             }
         }
@@ -129,6 +145,7 @@
         if ($registration) {
            $reg=&innerregister($forcereg,$target);
         }
+	    my $trans=&Apache::lonlocal::endreroutetrans();
 	return (<<ENDINLINEMENU);
 <script>
 // BEGIN LON-CAPA Internal
@@ -136,18 +153,19 @@
 <table bgcolor="$pgbg" width="100%" border="0" cellpadding="3" cellspacing="3">
 <tr>
 <td bgcolor="$tabbg">
-<a href="/adm/menu" target="_top"><font color="$font">Main Menu</font></a>
+<a href="/adm/menu" target="_top"><font color="$font">$lt{'main'}</font></a>
 </td>
 $reloadlink
 $navmaps
 <td bgcolor="$tabbg">
 <a href="/adm/remote?action=launch&url=$escurl" target="_top">
-<font color="$font">Launch Remote Control</font></a></td>
+<font color="$font">$lt{'launch'}</font></a></td>
 <td bgcolor="$tabbg">
 <img align="right" src="/adm/lonIcons/minilogo.gif" />
 <b>LON-CAPA</b></td>
 </tr>
 </table>
+$trans
 <script>
 // END LON-CAPA Internal
 </script>
@@ -610,6 +628,9 @@
     my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$nobreak)=@_;
     $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;
+    $top=&mt($top);
+    $bot=&mt($bot);
+    $desc=&mt($desc);
     unless (($ENV{'browser.interface'} eq 'textual')  ||
             ($ENV{'environment.remote'} eq 'off')) {
 # Remote
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.28 loncom/interface/lonpreferences.pm:1.29
--- loncom/interface/lonpreferences.pm:1.28	Tue Sep 16 18:40:25 2003
+++ loncom/interface/lonpreferences.pm	Tue Sep 16 21:45:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.28 2003/09/16 22:40:25 www Exp $
+# $Id: lonpreferences.pm,v 1.29 2003/09/17 01:45:14 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -108,8 +108,8 @@
     my $user       = $ENV{'user.name'};
     my $domain     = $ENV{'user.domain'};
     my %userenv = &Apache::lonnet::get
-        ('environment',['language','translator']);
-    my $language=$userenv{'language'};
+        ('environment',['languages','translator']);
+    my $language=$userenv{'languages'};
     my $translator=$userenv{'translator'};
     my $bodytag=&Apache::loncommon::bodytag(
               'Change Your Language Preferences');
@@ -141,12 +141,12 @@
     $newlanguage=~s/[^\-\w]//g;
     my $message='';
     if ($newlanguage) {
-        &Apache::lonnet::put('environment',{'language' => $newlanguage});
-        &Apache::lonnet::appenv('environment.language' => $newlanguage);
-        $message='Set new preferred language to '.$newlanguage;
+        &Apache::lonnet::put('environment',{'languages' => $newlanguage});
+        &Apache::lonnet::appenv('environment.languages' => $newlanguage);
+        $message='Set new preferred languages to '.$newlanguage;
     } else {
-        &Apache::lonnet::del('environment',['language']);
-        &Apache::lonnet::delenv('environment\.language');
+        &Apache::lonnet::del('environment',['languages']);
+        &Apache::lonnet::delenv('environment\.languages');
         $message='Reset preferred language';
     }
     if ($ENV{'user.adv'}) {
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.3 loncom/localize/lonlocal.pm:1.4
--- loncom/localize/lonlocal.pm:1.3	Tue Sep 16 18:40:25 2003
+++ loncom/localize/lonlocal.pm	Tue Sep 16 21:45:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Localization routines
 #
-# $Id: lonlocal.pm,v 1.3 2003/09/16 22:40:25 www Exp $
+# $Id: lonlocal.pm,v 1.4 2003/09/17 01:45:14 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -39,6 +39,8 @@
 our @ISA = qw (Exporter);
 our @EXPORT = qw(mt);
 
+my $reroute;
+
 # ========================================================= The language handle
 
 use vars qw($lh);
@@ -49,12 +51,45 @@
     unless ($ENV{'environment.translator'}) {
 	return $lh->maketext(@_);
     } else {
-	return '<a target="trans" href="/cgi-bin/translator.pl?arg1='.
+	my $trans=$lh->maketext(@_);
+	my $link='<a target="trans" href="/cgi-bin/translator.pl?arg1='.
 	    &Apache::lonnet::escape($_[0]).'&arg2='.
 	    &Apache::lonnet::escape($_[1]).'&arg3='.
 	    &Apache::lonnet::escape($_[2]).'&lang='.
 	    $ENV{'environment.translator'}.
-	    '">'.$lh->maketext(@_).'</a>';
+	    '">[['.$trans.']]</a>';
+	if ($ENV{'transreroute'}) {
+	    $reroute.=$link;
+	    return $trans;
+	} else {
+	    return $link;
+	}
+    }
+}
+
+# ============================================================== Translate hash
+
+sub texthash {
+    my %hash=@_;
+    foreach (keys %hash) {
+	$hash{$_}=&mt($hash{$_});
+    }
+    return %hash;
+}
+
+# ======================================================== Re-route translation
+
+sub reroutetrans {
+    $ENV{'transreroute'}=1;
+    $reroute='';
+}
+# ==================================================== End re-route translation
+sub endreroutetrans {
+    $ENV{'transreroute'}=0;
+    if ($ENV{'environment.translator'}) {
+	return $reroute;
+    } else {
+	return '';
     }
 }
 
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.1 loncom/localize/localize/de.pm:1.2
--- loncom/localize/localize/de.pm:1.1	Tue Sep 16 15:23:47 2003
+++ loncom/localize/localize/de.pm	Tue Sep 16 21:45:14 2003
@@ -2,7 +2,96 @@
 package Apache::localize::de;
 use base qw(Apache::localize);
 %Lexicon=('_AUTO' => 1,
-	  'Navigate Course Contents' => 'Inhaltsverzeichnis' );
+   'Announcements and Calendar'
+=> 'Bekanntmachungen und Kalender',
+
+   'Author'
+=> 'Autor',
+
+   'Change Your Preferences'
+=> 'Ändern der Benutzerpräferenzen',
+
+   'Choose the user role'
+=> 'Wählen der Benutzerrolle',
+
+   'Co-Author'
+=> 'Co-Autor',
+
+   'Communication and Messages'
+=> 'Kommunication und Nachrichten',
+
+   'Course Coordinator'
+=> 'Kurs Koordinator',
+
+   'Course Statistics and Charts'
+=> 'Kursstatistiken und Notenübersicht',
+
+   'Course announcements and my calendar'
+=> 'Kursbekanntmachungen und mein Kalender',
+
+   'Create Users, Change User Privileges'
+=> 'Erstellen neuer Benutzeraccounts, Ändern von Benutzerprivilegien',
+
+   'Domain Coordinator'
+=> 'Domain Koordinator',
+
+   'Enrollment Manager'
+=> 'Einschreibungsmanagement',
+
+   'Enter grades from check-out assessment resources'
+=> 'Eingeben von Ergebnissen ausgeteilter Examen',
+
+   'Exam Proctor'
+=> 'Exam Proktor',
+
+   'Exit LON-CAPA'
+=> 'Ausloggen von LON-CAPA',
+
+   'Grades Spreadsheet'
+=> 'Benotungs Spreadsheet',
+
+   'Grading'
+=> 'Benotung',
+
+   'Instructor'
+=> 'Lehrender',
+
+   'Launch Remote Control'
+=> 'Fernbedienungsfenster',
+
+   'Main Menu'
+=> 'Hauptmenü',
+
+   'Navigate Course Contents'
+=> 'Inhaltsverzeichnis',
+
+   'No Role, Cumulative Privileges'
+=> 'Keine Rolle, kumulative Privilegien',
+
+   'Return to Last Location'
+=> 'Rückkehr zur letzten Seite',
+
+   'Send and receive messages'
+=> 'Verschicken und Empfangen von Nachrichten',
+
+   'Set my user preferences'
+=> 'Setzen von Benutzerpräferenzen',
+
+   'Student'
+=> 'Studierender',
+
+   'Switch to another user role'
+=> 'Andere Benutzerrolle wählen',
+
+   'Teaching Assistant'
+=> 'Hilfskraft',
+
+   'Use or edit my bookmark collection'
+=> 'Benutzen oder editieren meiner Bookmark-Sammlung',
+
+   'User Roles'
+=> 'Benutzerrollen'
+);
 
 1;
 
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.413 loncom/lonnet/perl/lonnet.pm:1.414
--- loncom/lonnet/perl/lonnet.pm:1.413	Tue Sep 16 13:54:50 2003
+++ loncom/lonnet/perl/lonnet.pm	Tue Sep 16 21:45:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.413 2003/09/16 17:54:50 www Exp $
+# $Id: lonnet.pm,v 1.414 2003/09/17 01:45:14 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -85,6 +85,7 @@
 use HTML::LCParser;
 use Fcntl qw(:flock);
 use Apache::loncoursedata;
+use Apache::lonlocal;
 
 my $readit;
 
@@ -2739,7 +2740,7 @@
 
 sub plaintext {
     my $short=shift;
-    return $prp{$short};
+    return &mt($prp{$short});
 }
 
 # ----------------------------------------------------------------- Assign Role
Index: modules/gerd/makemap.pl
diff -u modules/gerd/makemap.pl:1.1 modules/gerd/makemap.pl:1.2
--- modules/gerd/makemap.pl:1.1	Sun Aug 17 18:17:16 2003
+++ modules/gerd/makemap.pl	Tue Sep 16 21:45:14 2003
@@ -1,4 +1,4 @@
-  my $cluster='production';
+  my $cluster='development';
 
   use Image::WorldMap;
   my $map = Image::WorldMap->new("earth.png","maian/8");

--www1063763114--