[LON-CAPA-cvs] cvs: loncom /interface lonhelper.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Mon, 19 Apr 2004 15:40:08 -0000
sakharuk Mon Apr 19 11:40:08 2004 EDT
Modified files:
/loncom/interface lonhelper.pm
Log:
Some localization.
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.67 loncom/interface/lonhelper.pm:1.68
--- loncom/interface/lonhelper.pm:1.67 Wed Mar 31 00:23:59 2004
+++ loncom/interface/lonhelper.pm Mon Apr 19 11:40:08 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# .helper XML handler to implement the LON-CAPA helper
#
-# $Id: lonhelper.pm,v 1.67 2004/03/31 05:23:59 albertel Exp $
+# $Id: lonhelper.pm,v 1.68 2004/04/19 15:40:08 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -583,7 +583,7 @@
}
# Phase 4: Display.
- my $stateTitle = &mt($state->title());
+ my $stateTitle=&mt($state->title());
my $helperTitle = &mt($self->{TITLE});
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'','');
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"');
@@ -593,6 +593,30 @@
$result .= <<HEADER;
<html>
+<script type="text/javascript" language="Javascript" >
+ var editbrowser;
+ function openbrowser(formname,elementname,only,omit) {
+ var url = '/res/?';
+ if (editbrowser == null) {
+ url += 'launch=1&';
+ }
+ url += 'catalogmode=interactive&';
+ url += 'mode=parmset&';
+ url += 'form=' + formname + '&';
+ if (only != null) {
+ url += 'only=' + only + '&';
+ }
+ if (omit != null) {
+ url += 'omit=' + omit + '&';
+ }
+ url += 'element=' + elementname + '';
+ var title = 'Browser';
+ var options = 'scrollbars=1,resizable=1,menubar=0';
+ options += ',width=700,height=600';
+ editbrowser = open(url,title,options,'1');
+ editbrowser.focus();
+ }
+</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>$loncapaHelper: $helperTitle</title>
@@ -1206,10 +1230,13 @@
# Only print "select all" and "unselect all" if there are five or
# more choices; fewer then that and it looks silly.
if ($self->{'multichoice'} && scalar(@{$self->{CHOICES}}) > 4) {
+ my %lt=&Apache::lonlocal::texthash(
+ 'sa' => "Select All",
+ 'ua' => "Unselect All");
$buttons = <<BUTTONS;
<br />
-<input type="button" onclick="checkall(true, '$var')" value="Select All" />
-<input type="button" onclick="checkall(false, '$var')" value="Unselect All" />
+<input type="button" onclick="checkall(true, '$var')" value="$lt{'sa'}" />
+<input type="button" onclick="checkall(false, '$var')" value="$lt{'ua'}" />
<br />
BUTTONS
}
@@ -1276,6 +1303,7 @@
$choiceLabel = eval($choiceLabel);
$choiceLabel = &$choiceLabel($helper, $self);
}
+ &Apache::lonnet::logthis("TITLE TRANSLATION >$choiceLabel<");
$result .= "/></td><td> " . &mtn($choiceLabel) . "</td></tr>\n";
}
$result .= "</table>\n\n\n";
@@ -1893,10 +1921,14 @@
}
</script>
SCRIPT
+ my %lt=&Apache::lonlocal::texthash(
+ 'sar' => "Select All Resources",
+ 'uar' => "Unselect All Resources");
+
$buttons = <<BUTTONS;
<br />
-<input type="button" onclick="checkall(true, '$var')" value="Select All Resources" />
-<input type="button" onclick="checkall(false, '$var')" value="Unselect All Resources" />
+<input type="button" onclick="checkall(true, '$var')" value="$lt{'sar'}" />
+<input type="button" onclick="checkall(false, '$var')" value="$lt{'uar'}" />
<br />
BUTTONS
}
@@ -2104,16 +2136,21 @@
</script>
SCRIPT
- my $selectAllStudents = &mt('Select All Students');
- my $unselectAllStudents = &mt('Unselect All Students');
+ my %lt=&Apache::lonlocal::texthash(
+ 'ocs' => "Select Only Current Students",
+ 'sas' => "Select All Students",
+ 'uas' => "Unselect All Students",
+ 'sfsg' => "Select for Section/Group",
+ 'ufsg' => "Unselect for Section/Group");
+
$buttons = <<BUTTONS;
<br />
-<input type="button" onclick="checkactive()" value="Select Only Current Students" />
-<input type="button" onclick="checkall(true, '$var')" value="$selectAllStudents" />
-<input type="button" onclick="checkall(false, '$var')" value="$unselectAllStudents" />
-<input type="button" onclick="checksec(true)" value="Select for Section/Group">
+<input type="button" onclick="checkactive()" value="$lt{'ocs'}" />
+<input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" />
+<input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" />
+<input type="button" onclick="checksec(true)" value="$lt{'sfsg'}">
<input type="text" size="5" name="chksec">
-<input type="button" onclick="checksec(false)" value="Unselect for Section/Group">
+<input type="button" onclick="checksec(false)" value="$lt{'ufsg'}">
<br />
BUTTONS
}
@@ -2172,15 +2209,16 @@
}
}
- my $name = &mt($self->{'coursepersonnel'} ? 'Name' : 'Student Name');
+ my $name = $self->{'coursepersonnel'} ? &mt('Name') : &mt('Student Name');
+ &Apache::lonnet::logthis("THE NAME IS >$name<");
my $type = 'radio';
if ($self->{'multichoice'}) { $type = 'checkbox'; }
$result .= "<table cellspacing='2' cellpadding='2' border='0'>\n";
$result .= "<tr><td></td><td align='center'><b>$name</b></td>".
"<td align='center'><b>" . &mt('Section') . "</b></td>" .
- "<td align='center'><b>Status</b></td>" .
- "<td align='center'><b>" . &mt("Role") . "</b></td></tr>" .
- "<td align='center'><b>Username:Domain</b></td></tr>";
+ "<td align='center'><b>".&mt('Status')."</b></td>" .
+ "<td align='center'><b>" . &mt("Role") . "</b></td>" .
+ "<td align='center'><b>".&mt('Username').":".&mt('Domain')."</b></td></tr>";
my $checked = 0;
for my $choice (@$choices) {
@@ -2403,20 +2441,22 @@
}
</script>
SCRIPT
- my $selectAllFiles = &mt("Select All Files");
- my $unselectAllFiles = &mt("Unselect All Files");
- $buttons = <<BUTTONS;
+ my %lt=&Apache::lonlocal::texthash(
+ 'saf' => "Select All Files",
+ 'uaf' => "Unselect All Files");
+ $buttons = <<BUTTONS;
<br />
-<input type="button" onclick="checkall(true, '$var')" value="$selectAllFiles" />
-<input type="button" onclick="checkall(false, '$var')" value="$unselectAllFiles" />
+<input type="button" onclick="checkall(true, '$var')" value="$lt{'saf'}" />
+<input type="button" onclick="checkall(false, '$var')" value="$lt{'uaf'}" />
BUTTONS
- my $selectAllPublished = &mt("Select All Published");
- my $unselectAllPublished= &mt("UnselectAllPublished");
+ my %lt=&Apache::lonlocal::texthash(
+ 'sap' => "Select All Published",
+ 'uap' => "Unselect All Published");
if ($helper->{VARS}->{'construction'}) {
- $buttons .= <<BUTTONS;
-<input type="button" onclick="checkallclass(true, 'Published')" value="$selectAllPublished" />
-<input type="button" onclick="checkallclass(false, 'Published')" value="$unselectAllPublished" />
+ $buttons .= <<BUTTONS;
+<input type="button" onclick="checkallclass(true, 'Published')" value="$lt{'sap'}" />
+<input type="button" onclick="checkallclass(false, 'Published')" value="$lt{'uap'}" />
<br />
BUTTONS
}