[LON-CAPA-cvs] cvs: loncom(version_2_7_X) /interface loncommon.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 19 Sep 2008 23:03:22 -0000
raeburn Fri Sep 19 19:03:22 2008 EDT
Modified files: (Branch: version_2_7_X)
/loncom/interface loncommon.pm
Log:
Backport 1.686.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.679.2.3 loncom/interface/loncommon.pm:1.679.2.4
--- loncom/interface/loncommon.pm:1.679.2.3 Fri Sep 19 18:54:46 2008
+++ loncom/interface/loncommon.pm Fri Sep 19 19:03:20 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.679.2.3 2008/09/19 22:54:46 raeburn Exp $
+# $Id: loncommon.pm,v 1.679.2.4 2008/09/19 23:03:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2987,14 +2987,19 @@
}
}
}
+ return &get_genlanguages(@languages);
+}
+
+sub get_genlanguages {
+ my (@languages) = @_;
# turn "en-ca" into "en-ca,en"
my @genlanguages;
foreach my $lang (@languages) {
- unless ($lang=~/\w/) { next; }
- push(@genlanguages,$lang);
- if ($lang=~/(\-|\_)/) {
- push(@genlanguages,(split(/(\-|\_)/,$lang))[0]);
- }
+ unless ($lang=~/\w/) { next; }
+ push(@genlanguages,$lang);
+ if ($lang=~/(\-|\_)/) {
+ push(@genlanguages,(split(/(\-|\_)/,$lang))[0]);
+ }
}
#uniqueify the languages list
my %count;