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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Wed, 22 Oct 2008 10:53:21 -0000


bisitz		Wed Oct 22 06:53:21 2008 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
  Log:
  Localization:
  - Optimized &mt() usage to make sections/groups/access status message translatable
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.141 loncom/interface/lonstatistics.pm:1.142
--- loncom/interface/lonstatistics.pm:1.141	Tue Sep 16 11:40:15 2008
+++ loncom/interface/lonstatistics.pm	Wed Oct 22 06:53:21 2008
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.141 2008/09/16 15:40:15 bisitz Exp $
+# $Id: lonstatistics.pm,v 1.142 2008/10/22 10:53:21 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -462,7 +462,7 @@
     $description = &section_or_group_text($mode,'section',@sections).
 	' '.&section_or_group_text($mode,'group',@groups);
     if ($mode eq 'localized') {
-        $description .= &mt(' [_1] access status.',$env{'form.Status'});
+        $description .= ' '.&mt($env{'form.Status'}.' access status.');
     } elsif ($mode eq 'plaintext') {
         $description .= ' '.$env{'form.Status'}.' access status.';
     }
@@ -488,21 +488,21 @@
                              );
     if (scalar(@items) == 1 && $items[0] ne 'all') {
         if ($mode eq 'localized') {
-            $text = &mt('[_1] [_2].',$phrases{$type}{single},$items[0]);
+            $text = &mt($phrases{$type}{single}.' [_1].',$items[0]);
         } elsif ($mode eq 'plaintext') {
             $text = $phrases{$type}{single}.' '.$items[0].'.';
 
         }
     } elsif (scalar(@items) && $items[0] eq 'all') {
         if ($mode eq 'localized') {
-            $text = &mt('[_1].',$phrases{$type}{all});
+            $text = &mt($phrases{$type}{all}.'.');
         } elsif ($mode eq 'plaintext') {
             $text = $phrases{$type}{all}.'.';
         }
     } elsif (scalar(@items)) {
         my $lastitem = pop(@items);
         if ($mode eq 'localized') {
-            $text = &mt('[_1] [_2] and [_3].',$phrases{$type}{plural},
+            $text = &mt($phrases{$type}{plural}.' [_1] and [_2].',
                         join(', ',@items),$lastitem);
         } elsif ($mode eq 'plaintext') {
             $text = $phrases{$type}{plural}.' '.join(', ',@items).' and '.