--- sites/all/modules/autolocale/autolocale.install	2007-02-03 11:57:53.000000000 +0100
+++ sites/all/modules/autolocale/autolocale.install	2007-02-03 11:48:49.000000000 +0100
@@ -40,15 +40,20 @@ function _autolocale_import_po_files_for
 
   // PO files under the component folder
   $podir = dirname($component->filename) . '/po/';
-
   // Search for filename.langcode.po named files
-  $files = glob($podir. '*.' . $langcode .'.po');
-  if (!is_array($files)) {
-    $files = array();
+  // Can be done using glob(), but it's disabled on many shared hosts
+  $files = array();
+  if (is_dir($podir) && ($dh = opendir($podir))) {
+    while (($file = readdir($dh)) !== false) {
+      if (fnmatch("*.$langcode.po", $file) && is_readable($podir . $file)) {
+        array_push($files, $podir . $file);
+      }
+    }
+    closedir($dh);
   }
   
   // Add langcode.po file if exists
-  if (file_exists($podir. $langcode .'.po')) {
+  if (file_exists($podir. $langcode .'.po') && is_readable($podir. $langcode .'.po')) {
     $files[] = $podir . $langcode . '.po';
   }
 
@@ -56,6 +61,7 @@ function _autolocale_import_po_files_for
   foreach ($files as $filepath) {
     $file = (object) array('filepath' => $filepath);
     _locale_import_read_po('db-store', $file, 'overwrite', $langcode);
+    drupal_set_message(t('Imported translation file '.basename($filepath)), 'status');
   }
 }
 
