[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm
bisitz
bisitz at source.lon-capa.org
Tue Aug 13 07:26:39 EDT 2013
bisitz Tue Aug 13 11:26:39 2013 EDT
Modified files:
/loncom/interface lonmenu.pm
Log:
Improve internationalization:
Do not translate again already translated phrases.
(incl. corrected rev. 1.286)
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.418 loncom/interface/lonmenu.pm:1.419
--- loncom/interface/lonmenu.pm:1.418 Tue Aug 6 16:02:31 2013
+++ loncom/interface/lonmenu.pm Tue Aug 13 11:26:38 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.418 2013/08/06 16:02:31 raeburn Exp $
+# $Id: lonmenu.pm,v 1.419 2013/08/13 11:26:38 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -261,7 +261,7 @@
push(@primsub,$item);
}
if (@primsub > 0) {
- $menu{$position} .= &create_submenu($link,$target,$title,\@primsub);
+ $menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1);
} elsif ($link) {
$menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>';
}
@@ -469,7 +469,7 @@
}
sub create_submenu {
- my ($link,$target,$title,$submenu) = @_;
+ my ($link,$target,$title,$submenu,$translate) = @_;
return unless (ref($submenu) eq 'ARRAY');
my $disptarget;
if ($target ne '') {
@@ -507,8 +507,13 @@
$borderbot = 'border-bottom:1px solid black;';
}
$menu .= '<li style="margin:0;padding:0;'.
- $borderbot.'"><a href="'.$href.'">'.
- &mt($item->[1]).'</a></li>';
+ $borderbot.'"><a href="'.$href.'">';
+ if ($translate) {
+ $menu .= &mt($item->[1]);
+ } else {
+ $menu .= $item->[1];
+ }
+ $menu .= '</a></li>';
}
}
$menu .= '</ul></li>';
@@ -1745,7 +1750,7 @@
}
}
}
- $switchtext = &mt('Switch role');
+ $switchtext = 'Switch role'; # do not translate here
my @roles_order = ($ccrole,'in','ta','ep','ad','st');
my $numdiffsec;
if (keys(%seccount) == 1) {
More information about the LON-CAPA-cvs
mailing list