[LON-CAPA-cvs] cvs: loncom /localize lonlocal.pm /localize/localize de.pm ja.pm

www lon-capa-cvs@mail.lon-capa.org
Sun, 28 Sep 2003 03:02:37 -0000


www		Sat Sep 27 23:02:37 2003 EDT

  Modified files:              
    /loncom/localize	lonlocal.pm 
    /loncom/localize/localize	de.pm ja.pm 
  Log:
  It would be too nice if the locale names had anything to do with the
  language codes, or the charset, in a predictable way ... but they do
  not.
  
  
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.14 loncom/localize/lonlocal.pm:1.15
--- loncom/localize/lonlocal.pm:1.14	Sat Sep 27 22:06:37 2003
+++ loncom/localize/lonlocal.pm	Sat Sep 27 23:02:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Localization routines
 #
-# $Id: lonlocal.pm,v 1.14 2003/09/28 02:06:37 www Exp $
+# $Id: lonlocal.pm,v 1.15 2003/09/28 03:02:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -225,6 +225,18 @@
     }
 }
 
+# =============================================================== Which locale?
+# Refer to locale -a
+#
+sub current_locale {
+    if ($lh) {
+	my $enc=$lh->maketext('lang_locale');
+	return ($enc eq 'lang_locale'?'':$enc);
+    } else {
+	return undef;
+    }
+}
+
 # ============================================================== Translate hash
 
 sub texthash {
@@ -265,7 +277,7 @@
     if (&Apache::lonnet::mod_perl_version == 1) {
 	$r->content_languages([&current_language()]);
     }
-    setlocale(LC_ALL,&current_language.'.'.&current_encoding);
+    setlocale(LC_ALL,&current_locale);
 }
 
 1;
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.30 loncom/localize/localize/de.pm:1.31
--- loncom/localize/localize/de.pm:1.30	Sat Sep 27 20:14:25 2003
+++ loncom/localize/localize/de.pm	Sat Sep 27 23:02:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.30 2003/09/28 00:14:25 www Exp $
+# $Id: de.pm,v 1.31 2003/09/28 03:02:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,6 +36,7 @@
           
 'char_encoding'=> 'ISO-8859-1',
 'language_code'=> 'de',
+'lang_locale'  => 'german',
 
    'Domain'
 => 'Domäne',
Index: loncom/localize/localize/ja.pm
diff -u loncom/localize/localize/ja.pm:1.5 loncom/localize/localize/ja.pm:1.6
--- loncom/localize/localize/ja.pm:1.5	Fri Sep 26 17:04:26 2003
+++ loncom/localize/localize/ja.pm	Sat Sep 27 23:02:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Japanese Localization Lexicon
 #
-# $Id: ja.pm,v 1.5 2003/09/26 21:04:26 www Exp $
+# $Id: ja.pm,v 1.6 2003/09/28 03:02:36 www Exp $
 #
 # Copyright i-Learning Limited Partnership Company
 #
@@ -33,7 +33,8 @@
 use base qw(Apache::localize);
 %Lexicon=('_AUTO' => 1,
 'language_code' => 'ja',
-'char_encoding' => 'UTF-8',
+'char_encoding' => 'UTF-8',
+'lang_locale'   => 'japanese',
 
    'Domain'
 => 'ドメイン',