Index: ckeditor_link.module
--- ckeditor_link.module Base (BASE)
+++ ckeditor_link.module Locally Modified (Based On LOCAL)
@@ -28,11 +28,24 @@
  * Implementation of hook_menu().
  */
 function ckeditor_link_menu() {
-  $items['ckeditor_link/autocomplete'] = array(
-    'page callback' => 'ckeditor_link_autocomplete',
-    'access arguments' => array('access ckeditor link'),
-    'type' => MENU_CALLBACK,
-  );
+  if (_ckeditor_link_restrictive_content_selection()) {
+    // Get active languages
+    $langs = language_list('enabled');
+    foreach ($langs[1] as $lang => $o) {
+      $items['ckeditor_link/'. $lang .'/autocomplete'] = array(
+        'page callback' => 'ckeditor_link_autocomplete',
+        'access arguments' => array('access ckeditor link'),
+        'type' => MENU_CALLBACK,
+      );
+    }
+  }
+  else {
+    $items['ckeditor_link/autocomplete'] = array(
+      'page callback' => 'ckeditor_link_autocomplete',
+      'access arguments' => array('access ckeditor link'),
+      'type' => MENU_CALLBACK,
+    );
+  }
   return $items;
 }
 
@@ -40,8 +53,15 @@
   $matches = array();
 
   if ($string !== '') {
-    $sql = db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.title LIKE '%%%s%%' ORDER BY n.title, n.type");
-    $result = db_query_range($sql, array($string), 0, 10);
+    if (_ckeditor_link_restrictive_content_selection()) {
+      $lang = arg(1);
+      $sql = "SELECT n.nid, n.title FROM {node} n WHERE n.title LIKE '%%%s%%' AND n.language = '%s' ORDER BY n.title, n.type";
+      $result = db_query_range($sql, array($string, $lang), 0, 10);
+    }
+    else {
+      $sql = db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.title LIKE '%%%s%%' ORDER BY n.title, n.type");
+      $result = db_query_range($sql, array($string), 0, 10);
+    }
     while ($node = db_fetch_object($result)) {
       $matches[$node->title .' (node/'. $node->nid. ')'] = '<div class="reference-autocomplete">'. check_plain($node->title) .'</div>';
     }
@@ -66,9 +86,15 @@
     if (isset($setting['ckeditor']) || isset($setting['wysiwyg']['configs']['ckeditor'])) {
       drupal_add_css(drupal_get_path('module', 'ckeditor_link').'/ckeditor_link.css');
       drupal_add_js('misc/autocomplete.js');
+      if (_ckeditor_link_restrictive_content_selection()) {
+        $path = 'ckeditor_link/'. $form_state['values']['language'] .'/autocomplete';
+      }
+      else {
+        $path = 'ckeditor_link/autocomplete';
+      }
       drupal_add_js(array('ckeditor_link' => array(
         'module_path' => base_path().drupal_get_path('module', 'ckeditor_link'),
-        'autocomplete_path' => url('ckeditor_link/autocomplete'),
+        'autocomplete_path' => url($path),
         'msg_invalid_path' => t('Link must be a valid Drupal path.'),
       )), 'setting');
       $added = TRUE;
@@ -129,3 +155,20 @@
 
   return 'href="'. url("node/$nid", $options);
 }
+
+function _ckeditor_link_restrictive_content_selection() {
+  static $result;
+  
+  if (is_null($result)) {
+    if (module_exists('i18n') &&
+        variable_get('i18n_selection_mode', 'off') != 'off' &&
+        !variable_get('i18n_translation_switch', 0)) {
+      $result = TRUE;
+    }
+    else {
+      $result = FALSE;
+    }
+  }
+  
+  return $result;
+}
\ No newline at end of file
