[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /interface lonspeller.pm /localize/localize de.pm pt.pm
www
lon-capa-cvs@mail.lon-capa.org
Thu, 22 Jul 2004 23:50:56 -0000
www Thu Jul 22 19:50:56 2004 EDT
Modified files:
/loncom loncapa_apache.conf
/loncom/interface lonspeller.pm
/loncom/localize/localize de.pm pt.pm
Log:
Set languages - requires German (de) and Portuguese (pt) dictionaries installed
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.90 loncom/loncapa_apache.conf:1.91
--- loncom/loncapa_apache.conf:1.90 Sat Jul 3 14:49:42 2004
+++ loncom/loncapa_apache.conf Thu Jul 22 19:50:55 2004
@@ -1,7 +1,7 @@
##
## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
##
-## $Id: loncapa_apache.conf,v 1.90 2004/07/03 18:49:42 raeburn Exp $
+## $Id: loncapa_apache.conf,v 1.91 2004/07/22 23:50:55 www Exp $
##
#
@@ -389,6 +389,14 @@
ErrorDocument 500 /adm/errorhandler
</Location>
+<Location /adm/spellcheck>
+PerlAccessHandler Apache::lonacc
+SetHandler perl-script
+PerlHandler Apache::lonspeller
+ErrorDocument 403 /adm/login
+ErrorDocument 500 /adm/errorhandler
+</Location>
+
<Location /adm/bookmarks>
PerlAccessHandler Apache::lonacc
SetHandler perl-script
Index: loncom/interface/lonspeller.pm
diff -u loncom/interface/lonspeller.pm:1.3 loncom/interface/lonspeller.pm:1.4
--- loncom/interface/lonspeller.pm:1.3 Thu Jul 22 16:19:20 2004
+++ loncom/interface/lonspeller.pm Thu Jul 22 19:50:55 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Interface routines for Aspell
#
-# $Id: lonspeller.pm,v 1.3 2004/07/22 20:19:20 www Exp $
+# $Id: lonspeller.pm,v 1.4 2004/07/22 23:50:55 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,9 +35,23 @@
use strict;
my $speller;
+sub spellcheck_language {
+ if ($ENV{'form.lang'}) { return $ENV{'form.lang'}; }
+ if (&mt('spellcheck_lang') ne 'spellcheck_lang') {
+ return &mt('spellcheck_lang');
+ }
+ return 'en_US';
+}
+
+sub set_language {
+ my $lang=&spellcheck_language();
+ $speller->set_option('lang',$lang);
+}
+
sub markeduptext {
my $input=shift;
my $output='';
+ &set_language();
foreach my $word (split(/\W+/,$input)) {
if ($speller->check($word)) {
$output.=$word.' ';
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.55 loncom/localize/localize/de.pm:1.56
--- loncom/localize/localize/de.pm:1.55 Tue Jul 20 20:11:10 2004
+++ loncom/localize/localize/de.pm Thu Jul 22 19:50:55 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.55 2004/07/21 00:11:10 www Exp $
+# $Id: de.pm,v 1.56 2004/07/22 23:50:55 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,6 +43,7 @@
'date_am' => 'vormittags',
'date_pm' => 'nachmittags',
'htmlarea_lang' => 'de',
+'spellcheck_lang' => 'de',
'Domain'
=> 'Domäne',
Index: loncom/localize/localize/pt.pm
diff -u loncom/localize/localize/pt.pm:1.24 loncom/localize/localize/pt.pm:1.25
--- loncom/localize/localize/pt.pm:1.24 Tue Jun 29 13:42:59 2004
+++ loncom/localize/localize/pt.pm Thu Jul 22 19:50:55 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Portuguese Localization Lexicon
#
-# $Id: pt.pm,v 1.24 2004/06/29 17:42:59 ricardo Exp $
+# $Id: pt.pm,v 1.25 2004/07/22 23:50:55 www Exp $
#
# Copyright UNICAMP, Sao Paulo
# Supported in part by Partnership in Global Learning
@@ -58,6 +58,7 @@
'date_pm' => 'tarde',
#'textual_remote_display' => 'on',
'htmlarea_lang' => 'pt_br',
+'spellcheck_lang' => 'pt',
'anno.gif' => 'pt/anno_pt.gif',
'ccrs.gif' => 'pt/ccrs_pt.gif',