Index: l10n_client.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/l10n_client/Attic/l10n_client.js,v retrieving revision 1.10.4.8 diff -u -r1.10.4.8 l10n_client.js --- l10n_client.js 13 Oct 2010 11:42:47 -0000 1.10.4.8 +++ l10n_client.js 29 Nov 2010 12:43:23 -0000 @@ -114,6 +114,7 @@ $('#l10n-client-string-editor .source-text').text(Drupal.l10nClient.getString(index, 'source')); $('#l10n-client-form .translation-target').val(Drupal.l10nClient.getString(index, 'target')); + Drupal.l10nClient.selected = index; $('#l10n-client-form .form-submit').removeAttr("disabled"); @@ -133,7 +134,14 @@ $('#l10n-client-form .translation-target').val($('#l10n-client-string-editor .source-text').text()); return false; }); - + + // Google translate API v1 + + $('#l10n-client-form .google-button').click(function() { + $('#l10n-client-form .translation-target').val($('#l10n-client-string-editor .source-text').text()).translate('en','uk'); + return false; + }); + // Clear translation field on button click. $('#l10n-client-form .edit-clear').click(function() { $('#l10n-client-form .translation-target').val(''); Index: l10n_client.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/l10n_client/Attic/l10n_client.module,v retrieving revision 1.22.4.13 diff -u -r1.22.4.13 l10n_client.module --- l10n_client.module 27 Oct 2010 08:54:21 -0000 1.22.4.13 +++ l10n_client.module 29 Nov 2010 12:22:12 -0000 @@ -89,6 +89,7 @@ locale(NULL, NULL, NULL, TRUE); drupal_add_css(drupal_get_path('module', 'l10n_client') .'/l10n_client.css'); drupal_add_js(drupal_get_path('module', 'l10n_client') .'/jquery.hotkeys.js'); + drupal_add_js(drupal_get_path('module', 'l10n_client') .'/jquery.translate-1.3.9.min.js'); drupal_add_js('misc/jquery.cookie.js'); drupal_add_js(drupal_get_path('module', 'l10n_client') .'/l10n_client.js'); // We use textareas to be able to edit long text, which need resizing. @@ -380,6 +381,12 @@ '#attributes' => array('class' => array('edit-copy')), '#value' => t('Copy source'), ); + $form['google'] = array( + '#type' => 'button', + '#id' => 'l10n-client-google', + '#attributes' => array('class' => array('google-button')), + '#value' => t('Google translate'), + ); $form['clear'] = array( '#type' => 'button', '#id' => 'l10n-client-edit-clear',