[LON-CAPA-cvs] cvs: loncom /homework imagechoice.pm
bisitz
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 13 Oct 2008 14:06:49 -0000
bisitz Mon Oct 13 10:06:49 2008 EDT
Modified files:
/loncom/homework imagechoice.pm
Log:
Localization:
Added missing &mt() calls
Index: loncom/homework/imagechoice.pm
diff -u loncom/homework/imagechoice.pm:1.14 loncom/homework/imagechoice.pm:1.15
--- loncom/homework/imagechoice.pm:1.14 Tue Mar 11 22:46:53 2008
+++ loncom/homework/imagechoice.pm Mon Oct 13 10:06:47 2008
@@ -1,4 +1,4 @@
-# $Id: imagechoice.pm,v 1.14 2008/03/12 02:46:53 raeburn Exp $
+# $Id: imagechoice.pm,v 1.15 2008/10/13 14:06:47 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,6 +26,7 @@
use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet;
+use Apache::lonlocal;
use LONCAPA;
@@ -112,27 +113,27 @@
sub getcoord {
my ($r,$type,$filename,$id)=@_;
- my $heading='Select Position on Image';
+ my $heading=&mt('Select Position on Image');
my $nextstage='';
if ($type eq 'box') {
my (undef,@coords)=split(':',$env{"imagechoice.$id.coords"});
my $step=scalar(@coords)/2;
if ($step == 0) {
- $heading='Select First Coordinate on Image';
+ $heading=&mt('Select First Coordinate on Image');
#$nextstage='<input type="hidden" name="type" value="pairtwo" />';
} elsif ($step == 1) {
- $heading='Select Second Coordinate on Image';
+ $heading=&mt('Select Second Coordinate on Image');
#$nextstage='<input type="hidden" name="type" value="pairthree" />';
} else {
- $heading='Select Finish to save selection.';
- $nextstage='<input type="submit" name="finish" value="Finish" />';
+ $heading=&mt('Select Finish to save selection');
+ $nextstage='<input type="submit" name="finish" value="'.&mt('Finish').'" />';
}
} elsif ($type eq 'polygon') {
- $heading='Enter Coordinate or click finish to close Polygon';
- $nextstage='<input type="submit" name="finish" value="Finish" />';
+ $heading=&mt('Enter Coordinate or click finish to close Polygon');
+ $nextstage='<input type="submit" name="finish" value="'.&mt('Finish').'" />';
} elsif ($type eq 'point') {
- $heading='Click to select a Coordinate or click Finish to save current selection.';
- $nextstage='<input type="submit" name="finish" value="Finish" />';
+ $heading=&mt('Click to select a Coordinate or click Finish to save current selection');
+ $nextstage='<input type="submit" name="finish" value="'.&mt('Finish').'" />';
}
my $start_page =
@@ -142,12 +143,13 @@
my $end_page =
&Apache::loncommon::end_page();
+ my $canceltext=&mt('Cancel');
$r->print(<<"END");
$start_page
<h3>$heading</h3>
<form method="POST" action="/adm/imagechoice?token=$id">
$nextstage
-<input type="submit" name="cancel" value="Cancel" />
+<input type="submit" name="cancel" value="$canceltext" />
<br />
<input name="image" type="image" src="$filename" />
</form>
@@ -249,7 +251,7 @@
my (undef,$id) = split(/=/,$ENV{'QUERY_STRING'});
my $filename = &unescape($env{"imagechoice.$id.file"});
my $formname = $env{"imagechoice.$id.formname"};
- if ($env{'form.cancel'} eq 'Cancel') {
+ if ($env{'form.cancel'} eq &mt('Cancel')) {
&deletedata($id);
&closewindow($r,'',$filename);
return OK;
@@ -258,7 +260,7 @@
if (defined($env{'form.type'})) { $type=$env{'form.type'}; }
my $numcoords=&savecoord($id,$type);
my $imurl=&drawimage($r,$type,$filename,$id);
- if (($env{'form.finish'} eq 'Finish')) {
+ if ($env{'form.finish'} eq &mt('Finish')) {
&storedata($r,$type,$imurl,$id);
} else {
&getcoord($r,$type,$imurl,$id);