diff -urp --strip-trailing-cr ../drupal-6.x-dev/includes/locale.inc ./includes/locale.inc
--- ../drupal-6.x-dev/includes/locale.inc	2007-09-04 23:10:45.000000000 +0200
+++ ./includes/locale.inc	2007-10-12 19:35:26.000000000 +0200
@@ -839,8 +839,8 @@ function locale_translate_edit_form_subm
 
   drupal_set_message(t('The string has been saved.'));
 
-  // Refresh the locale cache.
-  locale_refresh_cache();
+  // Clear locale cache.
+  cache_clear_all('locale:', 'cache', TRUE);
 
   $form_state['redirect'] = 'admin/build/translate/search';
   return;
@@ -864,7 +864,7 @@ function locale_translate_delete($lid) {
   if ($langcode) {
     _locale_rebuild_js($langcode);
   }
-  locale_refresh_cache();
+  cache_clear_all('locale:', 'cache', TRUE);
   drupal_set_message(t('The string has been removed.'));
   drupal_goto('admin/build/translate/search');
 }
@@ -974,9 +974,9 @@ function _locale_import_po($file, $langc
     drupal_set_message(t('The translation file %filename appears to have a missing or malformed header.', array('%filename' => $file->filename)), 'error');
   }
 
-  // Rebuild locale cache.
+  // Clear cache and refresh JavaScript translations.
   _locale_rebuild_js($langcode);
-  cache_clear_all("locale:$langcode", 'cache');
+  cache_clear_all('locale:', 'cache', TRUE);
 
   // Rebuild the menu, strings may have changed.
   menu_rebuild();
diff -urp --strip-trailing-cr ../drupal-6.x-dev/modules/locale/locale.module ./modules/locale/locale.module
--- ../drupal-6.x-dev/modules/locale/locale.module	2007-09-28 20:11:27.000000000 +0200
+++ ./modules/locale/locale.module	2007-10-12 19:58:59.000000000 +0200
@@ -321,13 +321,19 @@ function locale($string = NULL, $langcod
     // perspective that is a really bad idea, so we have no user
     // interface for this. Be careful when turning this option off!
     if (variable_get('locale_cache_strings', 1) == 1) {
-      if (!($cache = cache_get('locale:'. $langcode, 'cache'))) {
-        locale_refresh_cache();
-        $cache = cache_get('locale:'. $langcode, 'cache');
-      }
-      if ($cache) {
+      if ($cache = cache_get('locale:'. $langcode, 'cache')) {
         $locale_t[$langcode] = $cache->data;
       }
+      else {
+        // Refresh database stored cache of translations for given language.
+        // We only store short strings used in current version, to improve
+        // performance and consume less memory.
+        $result = db_query("SELECT s.source, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.textgroup = 'default' AND s.version = '%s' AND LENGTH(s.source) < 75", $langcode, VERSION);
+        while ($data = db_fetch_object($result)) {
+          $locale_t[$langcode][$data->source] = (empty($data->translation) ? TRUE : $data->translation);
+        }
+        cache_set('locale:'. $langcode, $locale_t[$langcode]);
+      }
     }
   }
 
@@ -346,7 +352,7 @@ function locale($string = NULL, $langcod
         // and clear cache, to include the string into caching next time. Saved version is
         // also a string-history information for later pruning of the tables.
         db_query("UPDATE {locales_source} SET version = '%s' WHERE lid = %d LIMIT 1", VERSION, $translation->lid);
-        cache_clear_all('locale:'. $langcode, 'cache');
+        cache_clear_all('locale:', 'cache', TRUE);
       }
     }
     else {
@@ -354,7 +360,7 @@ function locale($string = NULL, $langcod
       db_query("INSERT INTO {locales_source} (location, source, textgroup, version) VALUES ('%s', '%s', 'default', '%s')", request_uri(), $string, VERSION);
       $locale_t[$langcode][$string] = TRUE;
       // Clear locale cache so this string can be added in a later request.
-      cache_clear_all('locale:'. $langcode, 'cache');
+      cache_clear_all('locale:', 'cache', TRUE);
     }
   }
 
@@ -362,26 +368,6 @@ function locale($string = NULL, $langcod
 }
 
 /**
- * Refreshes database stored cache of translations.
- *
- * We only store short strings used in current version, to improve performance and consume less memory.
- */
-function locale_refresh_cache() {
-  $languages = language_list('enabled');
-  $languages = $languages['1'];
-  unset($languages['en']);
-
-  foreach ($languages as $language) {
-    $result = db_query("SELECT s.source, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.textgroup = 'default' AND s.version = '%s' AND LENGTH(s.source) < 75", $language->language, VERSION);
-    $t = array();
-    while ($data = db_fetch_object($result)) {
-      $t[$data->source] = (empty($data->translation) ? TRUE : $data->translation);
-    }
-    cache_set('locale:'. $language->language, $t);
-  }
-}
-
-/**
  * Returns plural form index for a specific number.
  *
  * The index is computed from the formula of this language.
