--- l10n_client.module	2008-01-04 14:38:29.000000000 +0100
+++ l10n_client.module_patched	2008-03-23 13:00:51.000000000 +0100
@@ -44,6 +44,16 @@ function l10n_client_menu($may_cache) {
       'access' => $access,
       'type' => MENU_CALLBACK,
     );
+    // configuration settings
+    $items[] = array(
+      'path' => 'admin/settings/l10n_client',
+      'title' => t('Localization client'),
+      'description' => t('Allow or disallow Google translation suggestions'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'l10n_client_admin',
+      'access' => user_access('access administration pages'),
+      'type' => MENU_NORMAL_ITEM,
+     );      
   }
   
   return $items;
@@ -121,6 +131,16 @@ function l10n_client_init() {
     drupal_add_js(drupal_get_path('module', 'l10n_client') .'/l10n_client.js', 'module');
     // We use textareas to be able to edit long text, which need resizing.
     drupal_add_js('misc/textarea.js', 'module');
+    
+    // Load google translation api if activated
+    if (variable_get('l10n_client_suggest_translations', 1)){
+      drupal_set_html_head("<script type='text/javascript' src='http://www.google.com/jsapi'></script>");
+      drupal_set_html_head("<script type='text/javascript'>google.load('language', '1');</script>");
+      
+      // Make the current locale available
+      drupal_add_js(array('locale' => $locale), 'setting');
+      drupal_add_js(array('i18n_client_suggestTranslations' => variable_get('l10n_client_suggest_translations', 1)), 'setting');
+    }
   }
 }
 
@@ -264,6 +284,9 @@ function l10n_client_form($strings) {
   $form['copy'] = array(
     '#value' => "<input id='edit-copy' class='form-submit' type='button' value='".t('Copy Source')."'/>",
   );
+  $form['copytrans'] = array(
+    '#value' => "<input id='edit-copy-trans' class='form-submit' type='button' value='".t('Copy Translation')."'/>",
+  );    
   $form['clear'] = array(
     '#value' => "<input id='edit-clear' class='form-submit' type='button' value='".t('Clear')."'/>",
   );
@@ -319,6 +342,18 @@ function l10n_client_save_string() {
 }
 
 /**
+ * Add configuration menu.
+ */
+function l10n_client_admin() {
+  $form['l10n_client_suggest_translations'] = array(
+    '#type' => 'checkbox',
+    '#default_value' => variable_get('l10n_client_suggest_translations', 1) ,
+    '#title' => t('Let Google suggest translations')
+  );
+  return system_settings_form($form);
+}
+
+/**
  * Import one string into the database.
  * 
  * Note: Backport of Drupal 6 _locale_import_one_string_db basically 
