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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Thu, 19 Jun 2008 15:51:40 -0000


This is a MIME encoded message

--bisitz1213890700
Content-Type: text/plain

bisitz		Thu Jun 19 11:51:40 2008 EDT

  Modified files:              
    /loncom/interface	lonwhatsnew.pm 
  Log:
  Localization:
  - Added missing &mt() calls
  - Optimized &mt() calls, e.g. got rid of ugly concatinations
  
  
--bisitz1213890700
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20080619115140.txt"

Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.77 loncom/interface/lonwhatsnew.pm:1.78
--- loncom/interface/lonwhatsnew.pm:1.77	Wed Apr 30 19:52:00 2008
+++ loncom/interface/lonwhatsnew.pm	Thu Jun 19 11:51:39 2008
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.77 2008/04/30 23:52:00 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.78 2008/06/19 15:51:39 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -169,19 +169,19 @@
                          degdiff => 'Degree of difficulty',
                          numstudents => 'Total number of students with submissions',
     );
-    my %versions = &Apache::lonlocal::texthash (
+    my %versions = (
                        -1 => "version changes since start of $lctype",
                   2592000 => 'version changes since last month',
                    604800 => 'version changes since last week',
                     86400 => 'version changes since yesterday',
                    );
-    my %newroles = &Apache::lonlocal::texthash (
+    my %newroles = (
                        -1 => "roles which have become active since start of $lctype",
                   2592000 => 'roles which have become active since last month',
                    604800 => 'roles which have become active since last week',
                     86400 => 'roles which have become active since yesterday',
                    );
-    my %oldroles = &Apache::lonlocal::texthash (
+    my %oldroles = (
                        -1 => "roles which expired since start of $lctype",
                   2592000 => 'roles which expired since last month',
                    604800 => 'roles which expired since last week',
@@ -352,10 +352,8 @@
     }
     $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
               .' <span class="LC_nobreak">'
-              .&mt('Currently: <i>[_1]</i>',$currinit)
-              .'.&nbsp;&nbsp;'
-#              &mt('<b>Change</b> for just <a href="/adm/whatsnew?command=courseinit&amp;refpage=[_1]">this '.$lctype.'</a>',$refpage).' '.
-#              &mt('or for all <a href="/adm/preferences?action=changecourseinit&amp;refpage=[_1]">your courses</a>.',$refpage).'</span><br /><hr />');
+              .&mt('Currently: [_1].','<i>'.$currinit.'</i>')
+              .'&nbsp;&nbsp;'
               .&mt('<b>Change</b> for just [_1]this course[_2]'
                   .' or for all [_3]your courses[_2].'
                   ,'<a href="/adm/whatsnew?command=courseinit&amp;refpage='.$refpage.'">'
@@ -402,13 +400,13 @@
     );
 
     if ($timediff{'versions'} == -1) {
-        $headings{'versionchanges'} = 'Resources in '.$lctype.' with version changes since start of '.$lctype;
+        $headings{'versionchanges'} = &mt('Resources in '.$lctype.' with version changes since start of '.$lctype);
     } elsif ($timediff{'versions'} == 2592000) {
-        $headings{'versionchanges'} = 'Resources in '.$lctype.' with version changes since last month';
+        $headings{'versionchanges'} = &mt('Resources in '.$lctype.' with version changes since last month');
     } elsif ($timediff{'versions'} == 604800) {
-        $headings{'versionchanges'} = 'Resources in '.$lctype.' with version changes since last week';
+        $headings{'versionchanges'} = &mt('Resources in '.$lctype.' with version changes since last week');
     } elsif ($timediff{'versions'} == 86400) {
-        $headings{'versionchanges'} = 'Resources in '.$lctype.' with version changes since yesterday';
+        $headings{'versionchanges'} = &mt('Resources in '.$lctype.' with version changes since yesterday');
     }
 
     $timediff{'oldroles'} = $display_settings{$cid.':oldroleinterval'};
@@ -416,13 +414,13 @@
     $interval{'oldroles'} = $interval_titles->{'oldroles'}->{$timediff{'oldroles'}};
 
     if ($timediff{'oldroles'} == -1) {
-        $headings{'oldroles'} = 'Roles for which access to '.$lctype.' has expired since start of '.$lctype;
+        $headings{'oldroles'} = &mt('Roles for which access to '.$lctype.' has expired since start of '.$lctype);
     } elsif ($timediff{'oldroles'} == 2592000) {
-        $headings{'oldroles'} = 'Roles for which access to '.$lctype.' has expired since last month';
+        $headings{'oldroles'} = &mt('Roles for which access to '.$lctype.' has expired since last month');
     } elsif ($timediff{'oldroles'} == 604800) {
-        $headings{'oldroles'} = 'Roles for which access to '.$lctype.' has expired since last week';
+        $headings{'oldroles'} = &mt('Roles for which access to '.$lctype.' has expired since last week');
     } elsif ($timediff{'oldroles'} == 86400) {
-        $headings{'oldroles'} = 'Roles for which access to '.$lctype.' has expired since yesterday';
+        $headings{'oldroles'} = &mt('Roles for which access to '.$lctype.' has expired since yesterday');
     }
 
     $timediff{'newroles'} = $display_settings{$cid.':newroleinterval'};
@@ -430,13 +428,13 @@
     $interval{'newroles'} = $interval_titles->{'newroles'}->{$timediff{'newroles'}};
 
     if ($timediff{'newroles'} == -1) {
-        $headings{'newroles'} = 'Roles for which access to '.$lctype.' has become available since start of '.$lctype;
+        $headings{'newroles'} = &mt('Roles for which access to '.$lctype.' has become available since start of '.$lctype);
     } elsif ($timediff{'newroles'} == 2592000) {
-        $headings{'newroles'} = 'Roles for which access to '.$lctype.' has become available since last month';
+        $headings{'newroles'} = &mt('Roles for which access to '.$lctype.' has become available since last month');
     } elsif ($timediff{'newroles'} == 604800) {
-        $headings{'newroles'} = 'Roles for which access to '.$lctype.' has become available since last week';
+        $headings{'newroles'} = &mt('Roles for which access to '.$lctype.' has become available since last week');
     } elsif ($timediff{'newroles'} == 86400) {
-        $headings{'newroles'} = 'Roles for which access to '.$lctype.' has become available since yesterday';
+        $headings{'newroles'} = &mt('Roles for which access to '.$lctype.' has become available since yesterday');
     }
 
     my $now = time;
@@ -637,12 +635,12 @@
 <input type="hidden" name="refpage" value="'.$refpage.'" />'.
 &mt('Display:').' 
 <select name="interval">
-<option value="" selected="selected">Select</option>
+<option value="" selected="selected">'.&mt('Select').'</option>
 ');
     if (ref($interval_titles) eq 'HASH') {
         if (ref($interval_titles->{$context}) eq 'HASH') {
             foreach my $key (reverse sort ({$a cmp $b} (keys(%{$interval_titles->{$context}})))) {
-                $r->print('<option value="'.$key.'">'.$interval_titles->{$context}->{$key}.
+                $r->print('<option value="'.$key.'">'.&mt($interval_titles->{$context}->{$key}).
                           '</option>'."\n");
             }
         }
@@ -1563,7 +1561,6 @@
         'revd' => 'Last revised',
         'newv' => 'New version',
         'veru' => 'Version used',
-        'noup' => 'No', 
     );
     if (keys(%{$changed}) > 0) {
         $r->print('<tr class="LC_info_row"><td class="LC_left_item">'.
@@ -1586,8 +1583,8 @@
                       $$changed{$item}{'version'}.'</td></tr>');
         }
     } else {
-        $r->print('<tr class="LC_empty_row"><td>'.$lt{'noup'}.
-                  ' '.$interval.'</td></tr>');
+        $r->print('<tr class="LC_empty_row"><td>'
+                 .&mt('No '.$interval).'</td></tr>');
     }
     return;
 }
@@ -1601,7 +1598,6 @@
         'role'  => 'Role',
         'sec'   => 'Section',
         'status'  => 'Status',
-        'norc'  => 'There are no ',
     );
     if ($chgcount) {
         $r->print('<tr class="LC_info_row">'.
@@ -1644,8 +1640,8 @@
             }
         }
     } else {
-        $r->print('<tr class="LC_empty_row"><td>'.$lt{'norc'}.
-                  ' '.$interval.'</td></tr>');
+        $r->print('<tr class="LC_empty_row"><td>'
+                 .&mt('There are no '.$interval).'</td></tr>');
     }
     return;
 }

--bisitz1213890700--