From 0e4427aae2f0ed628dd75f440410bcdcf73234b4 Mon Sep 17 00:00:00 2001
From: Bill Seremetis <bill@seremetis.net>
Date: Sun, 22 Sep 2013 14:56:45 +0300
Subject: [PATCH] Display a list of all languages and mark ones that have local
 translations

---
 core/includes/install.core.inc | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 5580e16..cb8e398 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1563,19 +1563,19 @@ function install_select_language_form($form, &$form_state, $files = array()) {
   // Build a select list with language names in native language for the user
   // to choose from. And build a list of available languages for the browser
   // to select the language default from.
+
+  // Select lists based on all standard languages.
+  foreach ($standard_languages as $langcode => $language_names) {
+    $select_options[$langcode] = $language_names[1];
+    $browser_options[$langcode] = new Language(array(
+      'id' => $langcode,
+    ));
+  }
+
+  // Modify the select lists based on available language files.
   if (count($files)) {
-    // Select lists based on available language files.
     foreach ($files as $langcode => $uri) {
-      $select_options[$langcode] = isset($standard_languages[$langcode]) ? $standard_languages[$langcode][1] : $langcode;
-      $browser_options[$langcode] = new Language(array(
-        'id' => $langcode,
-      ));
-    }
-  }
-  else {
-    // Select lists based on all standard languages.
-    foreach ($standard_languages as $langcode => $language_names) {
-      $select_options[$langcode] = $language_names[1];
+      $select_options[$langcode] = isset($standard_languages[$langcode]) ? "* " . $standard_languages[$langcode][1] : $langcode;
       $browser_options[$langcode] = new Language(array(
         'id' => $langcode,
       ));
@@ -1592,10 +1592,17 @@ function install_select_language_form($form, &$form_state, $files = array()) {
     '#default_value' => !empty($browser_langcode) ? $browser_langcode : 'en',
   );
 
-  if (empty($files)) {
+  $normal_message = '<p>Translations will be downloaded from the <a href="http://localize.drupal.org">Drupal Translation website</a>. ' .
+    'If you do not want this, select <em>English</em> or any other existing translations and continue the installation.</p>' .
+    '<p>For more information, see the <a href="http://drupal.org/documentation/install">online handbook</a>.</p>';
+  $local_message = '<p>Translations were found in your Drupal installation directory  and are marked with a " * " (star sign).</p>';
+  
+  $form['help'] = array(
+    '#markup' => $normal_message,
+  );
+  if (!empty($files)) {
     $form['help'] = array(
-      '#markup' => '<p>Translations will be downloaded from the <a href="http://localize.drupal.org">Drupal Translation website</a>. ' .
-      'If you do not want this, select <em>English</em> and continue the installation. For more information, see the <a href="http://drupal.org/documentation/install">online handbook</a>.</p>',
+      '#markup' =>  $normal_message . $local_message,
     );
   }
   $form['actions'] = array('#type' => 'actions');
-- 
1.8.4

