[LON-CAPA-cvs] cvs: loncom /interface lonpreferences.pm

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Wed, 28 May 2008 23:50:55 -0000


bisitz		Wed May 28 19:50:55 2008 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  Localization and Optimization for mathrendering preferences:
  - Added missing mt/lt calls
  - Added headlines
  - Better screen arrangement of pref list
  - Changed order of examples: same order as in pref list
  - Same text in pref list and headlines as in lonparmset.pm
  
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.122 loncom/interface/lonpreferences.pm:1.123
--- loncom/interface/lonpreferences.pm:1.122	Tue May 27 21:45:48 2008
+++ loncom/interface/lonpreferences.pm	Wed May 28 19:50:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.122 2008/05/28 01:45:48 www Exp $
+# $Id: lonpreferences.pm,v 1.123 2008/05/28 23:50:53 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -189,35 +189,45 @@
     my %userenv = &Apache::lonnet::get('environment',['texengine']);
     my $texengine=$userenv{'texengine'};
 
-    my $pref=&mt('Preferred method to display Math');
     my %mathchoices=('' => 'Default',
-		     'tth' => 'TeX to HTML',
+		     'tth' => 'tth (TeX to HTML)',
 		     #'ttm' => 'TeX to MathML',
 		     'jsMath' => 'jsMath',
-		     'mimetex' => 'Convert to Images'
+		     'mimetex' => 'mimetex (Convert to Images)'
                      );
     my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine',
 						     %mathchoices);
     my $jsMath_start=&Apache::lontexconvert::jsMath_header();
-    my $change=&mt('Change');
-    $r->print(<<ENDLSCREEN);
-<br />
+    my %lt=&Apache::lonlocal::texthash(
+      'headline' => 'Change Math Preferences',
+      'preftxt'  => 'Preferred method to display Math',
+      'change'   => 'Change',
+      'exmpl'    => 'Examples',
+      'jsmath'   => 'jsMath:',
+      'tth'      => 'tth (TeX to HTML):',
+      'mimetex'  => 'mimetex (Convert to Images):',
+    );
 
+    $r->print(<<ENDLSCREEN);
+<h2>$lt{'headline'}</h2>
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_texengine" />
-<p>$pref: $selectionbox</p>
-<p><input type="submit" value="$change" /></p>
-</form>
-Examples:
-<p> TeX to HTML <br /> 
-<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe>
+<p>
+$lt{'preftxt'}:<br />
+$selectionbox <input type="submit" value="$lt{'change'}" />
 </p>
-<p>jsMath <br /> 
+</form>
+<br />
+<hr />
+$lt{'exmpl'}
+
+<h3>$lt{'jsmath'}</h3> 
+<p>
 $jsMath_start
 <script type="text/javascript">
 if (jsMath.nofonts == 1) {
     document.writeln
-        ('<center><div style="padding: 10; border-style: solid; border-width:3;'
+        ('<div style="padding: 10; border-style: solid; border-width:3;'
 	 +' border-color: #DD0000; background-color: #FFF8F8; width: 75%; text-align: left">'
 	 +'<small><font color="#AA0000"><b>Warning:</b> '
 	 +'It looks like you don\\\'t have the TeX math fonts installed. '
@@ -227,16 +237,21 @@
 	 +'needed fonts.  In the meantime, jsMath will do the best it can '
 	 +'with the fonts you have, but it may not be pretty and some equations '
 	 +'may not be rendered correctly. '
-	 +'</font></small></div></center>');
+	 +'</font></small></div>');
 }
 </script>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="120"></iframe>
-
 </p>
-<p> Convert to Images <br />
-<br />
+
+<h3>$lt{'mimetex'}</h3>
+<p>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="100"></iframe>
 </p>
+
+<h3>$lt{'tth'}</h3>
+<p>
+<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe>
+</p>
 ENDLSCREEN
     if ($env{'environment.texengine'} ne 'jsMath') {
 	$r->print('<script type="text/javascript">jsMath.Process()</script>');