Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.146
diff -u -p -r1.146 install.php
--- install.php	24 Nov 2008 10:41:39 -0000	1.146
+++ install.php	26 Nov 2008 09:27:57 -0000
@@ -572,7 +572,10 @@ function install_select_locale($profilen
  * Form API array definition for language selection.
  */
 function install_select_locale_form(&$form_state, $locales) {
-  include_once DRUPAL_ROOT . '/includes/locale.inc';
+  if (!drupal_function_exists('_locale_get_predefined_list')) {
+    // Load include file for predefined function list.
+    return;
+  }
   $languages = _locale_get_predefined_list();
   foreach ($locales as $locale) {
     // Try to use verbose locale name
@@ -674,8 +677,7 @@ function install_tasks($profile, $task) 
 
   // Import interface translations for the enabled modules.
   if ($task == 'locale-initial-import') {
-    if (!empty($install_locale) && ($install_locale != 'en')) {
-      include_once DRUPAL_ROOT . '/includes/locale.inc';
+    if (!empty($install_locale) && ($install_locale != 'en') && drupal_function_exists('locale_add_language') && drupal_function_exists('locale_batch_by_language')) {
       // Enable installation language as default site language.
       locale_add_language($install_locale, NULL, NULL, NULL, NULL, NULL, 1, TRUE);
       // Collect files to import for this language.
@@ -779,8 +781,7 @@ if (Drupal.jsEnabled) {
   // Profile custom tasks are done, so let the installer regain
   // control and proceed with importing the remaining translations.
   if ($task == 'profile-finished') {
-    if (!empty($install_locale) && ($install_locale != 'en')) {
-      include_once DRUPAL_ROOT . '/includes/locale.inc';
+    if (!empty($install_locale) && ($install_locale != 'en') && drupal_function_exists('locale_batch_by_language')) {
       // Collect files to import for this language. Skip components
       // already covered in the initial batch set.
       $batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components', array()));
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.77
diff -u -p -r1.77 install.inc
--- includes/install.inc	24 Nov 2008 10:41:39 -0000	1.77
+++ includes/install.inc	26 Nov 2008 09:27:57 -0000
@@ -857,8 +857,7 @@ function st($string, $args = array()) {
   if (!isset($locale_strings)) {
     $locale_strings = array();
     $filename = 'profiles/' . $profile . '/translations/' . $install_locale . '.po';
-    if (file_exists(DRUPAL_ROOT . '/' . $filename)) {
-      require_once DRUPAL_ROOT . '/includes/locale.inc';
+    if (file_exists(DRUPAL_ROOT . '/' . $filename) && drupal_function_exists('_locale_import_read_po') && drupal_function_exists('_locale_import_one_string')) {
       $file = (object) array('filepath' => $filename);
       _locale_import_read_po('mem-store', $file);
       $locale_strings = _locale_import_one_string('mem-report');
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.232
diff -u -p -r1.232 locale.module
--- modules/locale/locale.module	23 Nov 2008 16:00:06 -0000	1.232
+++ modules/locale/locale.module	26 Nov 2008 09:27:57 -0000
@@ -176,16 +176,6 @@ function locale_menu() {
 }
 
 /**
- * Wrapper function to be able to set callbacks in locale.inc
- */
-function locale_inc_callback() {
-  $args = func_get_args();
-  $function = array_shift($args);
-  include_once DRUPAL_ROOT . '/includes/locale.inc';
-  return call_user_func_array($function, $args);
-}
-
-/**
  * Implementation of hook_perm().
  */
 function locale_perm() {
@@ -498,8 +488,7 @@ function locale_language_list($field = '
  *   translations for.
  */
 function locale_system_update($components) {
-  include_once DRUPAL_ROOT . '/includes/locale.inc';
-  if ($batch = locale_batch_by_component($components)) {
+  if (drupal_function_exists('locale_batch_by_component') && ($batch = locale_batch_by_component($components))) {
     batch_set($batch);
   }
 }
@@ -525,8 +514,8 @@ function locale_js_alter(&$javascript) {
       $filepath = $item['data'];
       if (!in_array($filepath, $parsed)) {
         // Don't parse our own translations files.
-        if (substr($filepath, 0, strlen($dir)) != $dir) {
-          locale_inc_callback('_locale_parse_js_file', $filepath);
+        if ((substr($filepath, 0, strlen($dir)) != $dir) && drupal_function_exists('_locale_parse_js_file')) {
+          _locale_parse_js_file($filepath);
           watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath));
           $parsed[] = $filepath;
           $new_files = TRUE;
@@ -538,15 +527,15 @@ function locale_js_alter(&$javascript) {
   // If there are any new source files we parsed, invalidate existing
   // JavaScript translation files for all languages, adding the refresh
   // flags into the existing array.
-  if ($new_files) {
-    $parsed += locale_inc_callback('_locale_invalidate_js');
+  if ($new_files && drupal_function_exists('_locale_invalidate_js')) {
+    $parsed += _locale_invalidate_js();
   }
 
   // If necessary, rebuild the translation file for the current language.
   if (!empty($parsed['refresh:' . $language->language])) {
     // Don't clear the refresh flag on failure, so that another try will
     // be performed later.
-    if (locale_inc_callback('_locale_rebuild_js')) {
+    if (drupal_function_exists('_locale_rebuild_js') && _locale_rebuild_js()) {
       unset($parsed['refresh:' . $language->language]);
     }
     // Store any changes after refresh was attempted.
