[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html /localize lonlocal.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 11 Oct 2003 14:06:01 -0000


This is a MIME encoded message

--www1065881161
Content-Type: text/plain

www		Sat Oct 11 10:06:01 2003 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
    /loncom/localize	lonlocal.pm 
  Log:
  Saving my work: internationalize static html files.
  
  
--www1065881161
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20031011100601.txt"

Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.106 loncom/html/res/adm/pages/menu.html:1.107
--- loncom/html/res/adm/pages/menu.html:1.106	Fri Aug 15 17:40:47 2003
+++ loncom/html/res/adm/pages/menu.html	Sat Oct 11 10:06:01 2003
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.106 2003/08/15 21:40:47 www Exp $
+// $Id: menu.html,v 1.107 2003/10/11 14:06:01 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -51,6 +51,7 @@
 if (lonhttpdport == null) {
     var lonhttpdport='8080';
 }
+
 var imgpath=':'+lonhttpdport+'/res/adm/pages/';
 var fontpath=':'+lonhttpdport+'/adm/lonLCDfont/';
 var currentURL='';
@@ -192,42 +193,6 @@
     showdisplay(utext,ltext);
 }
 
-function showdisplay(utext,ltext) {
-  var i; var ch;
-  dislocked=1;
-  if (utext == null) { utext = '';}
-  if (ltext == null) { ltext = '';}
-  if (typeof(utext)!="string") { utext=''; }
-  if (typeof(ltext)!="string") { ltext=''; }
-  if ((utext=='') && (ltext=='')) {
-     utext=statustop;
-     ltext=statusbot;
-     dislocked=0;
-  }
-  if (active) { 
-   for (i=0;i<=7;i++) {
-      if (i<utext.length) {
-         ch=utext.charAt(i);
-         if (ch==' ') { ch='space'; }
-         if (ch=='-') { ch='hyphen'; }
-         if (ch==':') { ch='colon'; }
-         if (ch=='/') { ch='slash'; }
-      } else { ch='space'; }
-      this.document['i'+i].src="http://"+clienthost+fontpath+ch+'.gif';
-   }
-   for (i=0;i<=7;i++) {
-      if (i<ltext.length) {
-         ch=ltext.charAt(i);
-         if (ch==' ') { ch='space'; }
-         if (ch=='-') { ch='hyphen'; }
-         if (ch==':') { ch='colon'; }
-         if (ch=='/') { ch='slash'; }
-      } else { ch='space'; }
-      this.document['j'+i].src="http://"+clienthost+fontpath+ch+'.gif';
-   }
-  }
-}
-
 function defdis() {
    this.window.focus();
    display();
@@ -389,8 +354,42 @@
              extdisp.document.writeln(
                 '<tr><td align="center"><a href="javascript:opener.'+
                hr[i]+';">&gt;&gt;&gt;<img align="absmiddle" border="0" src="'+
-             this.document['b'+i].src+'" />&lt;&lt;&lt;</a><br />&nbsp;<br />'+
-  '<table hspace="0" border="0" cellspacing="1" cellpadding="0"><tr>');
+            this.document['b'+i].src+'" />&lt;&lt;&lt;</a><br />&nbsp;<br />');
+             bigdisplay(dt,db,i);
+             extdisp.document.writeln('</td><td>'+ds[i]+'</td></tr>');
+          }
+       }
+   }
+   extdisp.document.writeln('</table></body></html>');
+   extdisp.document.close();
+}
+
+function edit_bookmarks() {
+   go('');
+   w_BookmarkPal_flag=1;
+   bookmarkpal=window.open("http://"+clienthost+"/adm/bookmarks",
+               "BookmarkPal", "width=400,height=505,scrollbars=0");
+}
+
+function catalog_info() {
+   go('');
+   w_LONcatInfo_flag=1;
+   loncatinfo=window.open(clientwindow.window.location.pathname+'.meta',"cat",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
+}
+
+function chat_win() {
+   go('');
+   w_LONchat_flag=1;
+   lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
+}
+// -->
+</script>
+<block condition="&EXT('browser.textremote')!=1">
+<script type="text/javascript">
+
+function bigdisplay(dt,db,i) {
+             extdisp.document.writeln(
+'<table hspace="0" border="0" cellspacing="1" cellpadding="0"><tr>');
              for (var j=0;j<=7;j++) {
                 if (j<dt[i].length) {
                    ch=dt[i].charAt(j);
@@ -414,35 +413,71 @@
                 extdisp.document.writeln('<td><img border="0" src="http://'
                                     +clienthost+fontpath+ch+'.gif" /></td>');
             }
-            extdisp.document.writeln(
-  '</tr></table></td><td>'+ds[i]+'</td></tr>');
-          }
-       }
-   }
-   extdisp.document.writeln('</table></body></html>');
-   extdisp.document.close();
+            extdisp.document.writeln('</tr></table>');
 }
 
-function edit_bookmarks() {
-   go('');
-   w_BookmarkPal_flag=1;
-   bookmarkpal=window.open("http://"+clienthost+"/adm/bookmarks",
-               "BookmarkPal", "width=400,height=505,scrollbars=0");
+function showdisplay(utext,ltext) {
+  var i; var ch;
+  dislocked=1;
+  if (utext == null) { utext = '';}
+  if (ltext == null) { ltext = '';}
+  if (typeof(utext)!="string") { utext=''; }
+  if (typeof(ltext)!="string") { ltext=''; }
+  if ((utext=='') && (ltext=='')) {
+     utext=statustop;
+     ltext=statusbot;
+     dislocked=0;
+  }
+  if (active) {
+   for (i=0;i<=7;i++) {
+      if (i<utext.length) {
+         ch=utext.charAt(i);
+         if (ch==' ') { ch='space'; }
+         if (ch=='-') { ch='hyphen'; }
+         if (ch==':') { ch='colon'; }
+         if (ch=='/') { ch='slash'; }
+      } else { ch='space'; }
+      this.document['i'+i].src="http://"+clienthost+fontpath+ch+'.gif';
+   }
+   for (i=0;i<=7;i++) {
+      if (i<ltext.length) {
+         ch=ltext.charAt(i);
+         if (ch==' ') { ch='space'; }
+         if (ch=='-') { ch='hyphen'; }
+         if (ch==':') { ch='colon'; }
+         if (ch=='/') { ch='slash'; }
+      } else { ch='space'; }
+      this.document['j'+i].src="http://"+clienthost+fontpath+ch+'.gif';
+   }
+  }
 }
-
-function catalog_info() {
-   go('');
-   w_LONcatInfo_flag=1;
-   loncatinfo=window.open(clientwindow.window.location.pathname+'.meta',"cat",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
+</script>
+</block>
+<block condition="&EXT('browser.textremote')">
+<script type="text/javascript">
+function bigdisplay(dt,db,i) {
+             extdisp.document.writeln(dt+'<br />'+db);
 }
 
-function chat_win() {
-   go('');
-   w_LONchat_flag=1;
-   lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
+function showdisplay(utext,ltext) {
+  var i; var ch;
+  dislocked=1;
+  if (utext == null) { utext = '';}
+  if (ltext == null) { ltext = '';}
+  if (typeof(utext)!="string") { utext=''; }
+  if (typeof(ltext)!="string") { ltext=''; }
+  if ((utext=='') && (ltext=='')) {
+     utext=statustop;
+     ltext=statusbot;
+     dislocked=0;
+  }
+  if (active) {
+   this.document.topdisplay.value=utext;
+   this.document.botdisplay.value=ltext;
+  }
 }
-// -->
 </script>
+</block>
 <center>
 <table hspace="0" border="0" cellspacing="0" cellpadding="0">
 <tr><td>
@@ -462,6 +497,7 @@
 </center>
 
 <center>
+<block condition="&EXT('browser.textremote')!=1">
 <table hspace="1" border="0" cellspacing="0" cellpadding="1">
 <tr><td bgcolor="#666666">
 <table hspace="0" border="0" cellspacing="1" cellpadding="0"> 
@@ -488,6 +524,13 @@
 </table>
 </td></tr>
 </table>
+</block>
+<block condition="&EXT('browser.textremote')">
+<font size="1">
+<input type="text" name="topdisplay" size="10" value="LON-CAPA" /><br />
+<input type="text" name="botdisplay" size="10" value="" />
+</block>
+
 </center>
 
 <center>
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.23 loncom/localize/lonlocal.pm:1.24
--- loncom/localize/lonlocal.pm:1.23	Fri Oct 10 12:56:16 2003
+++ loncom/localize/lonlocal.pm	Sat Oct 11 10:06:01 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Localization routines
 #
-# $Id: lonlocal.pm,v 1.23 2003/10/10 16:56:16 www Exp $
+# $Id: lonlocal.pm,v 1.24 2003/10/11 14:06:01 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -210,6 +210,20 @@
     }
 }
 
+# ================================================================ The <mt> tag
+
+BEGIN {
+}
+
+sub start_mt {
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+    return &mt(&Apache::lonxml::get_all_text("/mt",$parser));
+}
+
+sub end_mt {
+    return '';
+}
+
 # ============================================================== What language?
 
 sub current_language {
@@ -283,6 +297,7 @@
     if (&Apache::lonnet::mod_perl_version == 1) {
 	$r->content_languages([&current_language()]);
     }
+    &Apache::lonxml::register('Apache::lonlocal',('mt'));
 ###    setlocale(LC_ALL,&current_locale);
 }
 

--www1065881161--