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 21:00:55 -0000 @@ -114,6 +114,8 @@ $('#l10n-client-string-editor .source-text').text(Drupal.l10nClient.getString(index, 'source')); $('#l10n-client-form .translation-target').val(Drupal.l10nClient.getString(index, 'target')); + $('#l10n-client-form .translation-target').val($('#l10n-client-string-editor .source-text').text()).translate('en','uk', {alwaysReplace:true, toggle: false, fromOriginal:false}); + Drupal.l10nClient.selected = index; $('#l10n-client-form .form-submit').removeAttr("disabled"); @@ -133,7 +135,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', {alwaysReplace:true, toggle: false, fromOriginal:false}); + return false; + }); + // Clear translation field on button click. $('#l10n-client-form .edit-clear').click(function() { $('#l10n-client-form .translation-target').val('');