Bug 8742 - Example uses perl 5.8 in Makefile.PL
[koha.git] / C4 / Languages.pm
index a082b1f..d0eed69 100644 (file)
@@ -2,7 +2,7 @@ package C4::Languages;
 
 # Copyright 2006 (C) LibLime
 # Joshua Ferraro <jmf@liblime.com>
-#
+# Portions Copyright 2009 Chris Cormack and the Koha Dev Team
 # This file is part of Koha.
 #
 # Koha is free software; you can redistribute it and/or modify it under the
@@ -14,19 +14,30 @@ package C4::Languages;
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
 use strict; 
-#use warnings;   #FIXME: turn off warnings before release
+#use warnings; FIXME - Bug 2505
 use Carp;
 use C4::Context;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
 
+eval {
+    if (C4::Context->ismemcached) {
+        require Memoize::Memcached;
+        import Memoize::Memcached qw(memoize_memcached);
+
+        memoize_memcached('getTranslatedLanguages', memcached => C4::Context->memcached);
+        memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached);
+        memoize_memcached('getAllLanguages',        memcached => C4::Context->memcached);
+    }
+};
+
 BEGIN {
-    $VERSION = 3.00;
+    $VERSION = 3.07.00.049;
     require Exporter;
     @ISA    = qw(Exporter);
     @EXPORT = qw(
@@ -48,6 +59,8 @@ use C4::Languages;
 
 =head1 DESCRIPTION
 
+=cut
+
 =head1 FUNCTIONS
 
 =head2 getFrameworkLanguages
@@ -248,7 +261,7 @@ sub _get_language_dirs {
         next if $lang_string =~/css$/;
         next if $lang_string =~/CVS$/;
         next if $lang_string =~/\.txt$/i;     #Don't read the readme.txt !
-        next if $lang_string =~/img|images|famfam/;
+        next if $lang_string =~/img|images|famfam|sound|pdf/;
         push @lang_strings, $lang_string;
     }
         return (@lang_strings);
@@ -437,7 +450,6 @@ sub get_bidi {
 
 sub accept_language {
     # referenced http://search.cpan.org/src/CGILMORE/I18N-AcceptLanguage-1.04/lib/I18N/AcceptLanguage.pm
-    # FIXME: since this is only used in Output.pm as of Jan 8 2008, maybe it should be IN Output.pm
     my ($clientPreferences,$supportedLanguages) = @_;
     my @languages = ();
     if ($clientPreferences) {