[LON-CAPA-cvs] cvs: loncom(language_hyphenation) /interface loncommon.pm
foxr
foxr at source.lon-capa.org
Tue Dec 27 14:47:03 EST 2011
foxr Tue Dec 27 19:47:03 2011 EDT
Modified files: (Branch: language_hyphenation)
/loncom/interface loncommon.pm
Log:
BZ 6490 - Add as well hashes and function to fetch latex language from key.
This is needed because translations and metadata specify language in different
ways.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1028.2.1 loncom/interface/loncommon.pm:1.1028.2.2
--- loncom/interface/loncommon.pm:1.1028.2.1 Mon Dec 26 13:47:18 2011
+++ loncom/interface/loncommon.pm Tue Dec 27 19:47:02 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1028.2.1 2011/12/26 13:47:18 foxr Exp $
+# $Id: loncommon.pm,v 1.1028.2.2 2011/12/27 19:47:02 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -154,7 +154,8 @@
# ----------------------------------------------- Filetypes/Languages/Copyright
my %language;
my %supported_language;
-my %latex_language; # Language name LaTeX uses for selecting hyphenation.
+my %latex_language; # For choosing hyphenation in <transl..>
+my %latex_language_bykey; # for choosing hyphenation from metadata
my %cprtag;
my %scprtag;
my %fe; my %fd; my %fm;
@@ -193,6 +194,7 @@
$supported_language{$key}=$sup;
}
if ($latex) {
+ $latex_language_bykey{$key} = $latex;
$latex_language{$two} = $latex;
}
}
@@ -3279,6 +3281,20 @@
=pod
+=item * &latexhyphenation()
+
+Same as above but what's supplied is the language as it might be stored
+in the metadata.
+
+=cut
+
+sub latexhyphenation {
+ my $key = shift;
+ return $latex_language_bykey{$key};
+}
+
+=pod
+
=item * ©rightids()
returns list of all copyrights
More information about the LON-CAPA-cvs
mailing list